]> git.baikalelectronics.ru Git - kernel.git/commit
ext4: only look at the bg_flags field if it is valid
authorTheodore Ts'o <tytso@mit.edu>
Thu, 14 Jun 2018 04:58:00 +0000 (00:58 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Thu, 14 Jun 2018 04:58:00 +0000 (00:58 -0400)
commitf8477b8b4c748e7781187089e10271f05bf9ca34
tree73e3eeb52d03d548d6cab2c600984f07a72b9e10
parentbbc7e096248917f5b71011963bd694693583319a
ext4: only look at the bg_flags field if it is valid

The bg_flags field in the block group descripts is only valid if the
uninit_bg or metadata_csum feature is enabled.  We were not
consistently looking at this field; fix this.

Also block group #0 must never have uninitialized allocation bitmaps,
or need to be zeroed, since that's where the root inode, and other
special inodes are set up.  Check for these conditions and mark the
file system as corrupted if they are detected.

This addresses CVE-2018-10876.

https://bugzilla.kernel.org/show_bug.cgi?id=199403

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Cc: stable@kernel.org
fs/ext4/balloc.c
fs/ext4/ialloc.c
fs/ext4/mballoc.c
fs/ext4/super.c