lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Thu, 7 Nov 2019 12:36:42 +0100
From:   Jan Kara <jack@...e.cz>
To:     Chengguang Xu <cgxu519@...ernel.net>
Cc:     Jan Kara <jack@...e.cz>, jack <jack@...e.com>,
        linux-ext4 <linux-ext4@...r.kernel.org>
Subject: Re: [PATCH 2/5] ext2: code cleanup by calling
 ext2_group_last_block_no()

On Thu 07-11-19 17:44:23, Chengguang Xu wrote:
>  ---- 在 星期四, 2019-11-07 17:21:17 Jan Kara <jack@...e.cz> 撰写 ----
>  > On Thu 07-11-19 10:54:43, Chengguang Xu wrote:
>  > >  ---- 在 星期三, 2019-11-06 23:42:36 Jan Kara <jack@...e.cz> 撰写 ----
>  > >  > On Mon 04-11-19 19:40:33, Chengguang Xu wrote:
>  > >  > > Call common helper ext2_group_last_block_no() to
>  > >  > > calculate group last block number.
>  > >  > > 
>  > >  > > Signed-off-by: Chengguang Xu <cgxu519@...ernel.net>
>  > >  > 
>  > >  > Thanks for the patch! I've applied it (as well as 1/5) and added attached
>  > >  > simplification on top.
>  > >  > 
>  > > 
>  > > In ext2_try_to_allocate()
>  > > 
>  > > +        if (my_rsv->_rsv_end < group_last_block)
>  > > +            end = my_rsv->_rsv_end - group_first_block + 1;
>  > > +        if (grp_goal < start || grp_goal > end)
>  > > 
>  > > Based on original code, shouldn't it be  if (grp_goal < start || grp_goal
>  > > >=end) ?
>  > 
>  > Hum, that's a good point. The original code actually had an off-by-one bug
>  > because 'end' is really the last block that can be used so grp_goal == end
>  > still makes sense. And my cleanup fixed it. Now looking at the code in
>  > ext2_try_to_allocate() we also have a similar bug in the loop allocating
>  > blocks. There we can also go upto 'end' inclusive. Added a patch to fix
>  > that. Thanks for pointing me to this!
>  > 
> 
> Doesn't it depend on what starting number for grp_block inside block group?
> if it starts from 0, is the end number block still available for allocation?

Argh! You are right, I've misread the initialization of 'end' and that is
really one block past the last one. I've fixed up things in my tree. Thanks
for review!

								Honza
-- 
Jan Kara <jack@...e.com>
SUSE Labs, CR

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ