lkml.org 
[lkml]   [2018]   [Apr]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 4.9 37/95] ext4: add validity checks for bitmap block numbers
On Sun, Apr 22, 2018 at 10:54:23PM +0100, Ben Hutchings wrote:
> > offset = blk - group_first_block;
> > - if (!ext4_test_bit(EXT4_B2C(sbi, offset), bh->b_data))
> > + if (offset < 0 || EXT4_B2C(sbi, offset) >= sb->s_blocksize ||
> > + !ext4_test_bit(EXT4_B2C(sbi, offset), bh->b_data))
>
> Isn't sb->s_blocksize a count of bytes? If so, doesn't that mean that
> we should be comparing with sb->s_blocksize * 8?

Yes, nice catch, Ben! Can we temporarily drop this patch from the
stable queue until I can get a fix in?

In practice this shouldn't be a problem because of the default ext4
layout with flex_bg. But we should definitely get this fixed before
we let this flow into the stable kernel.

- Ted

\
 
 \ /
  Last update: 2018-04-23 08:04    [W:0.112 / U:0.296 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site