android_kernel_oneplus_msm8998/fs/ext4
Theodore Ts'o db3b00e3f3 ext4: only look at the bg_flags field if it is valid
commit 8844618d8aa7a9973e7b527d038a2a589665002c upstream.

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
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-07-11 16:03:48 +02:00
..
acl.c ext4: Don't clear SGID when inheriting ACLs 2017-10-12 11:27:35 +02:00
acl.h ext2/3/4: use generic posix ACL infrastructure 2014-01-25 23:58:19 -05:00
balloc.c ext4: only look at the bg_flags field if it is valid 2018-07-11 16:03:48 +02:00
bitmap.c ext4: remove unused header files 2015-04-02 23:47:42 -04:00
block_validity.c ext4: call out CRC and corruption errors with specific error codes 2015-10-17 16:16:04 -04:00
crypto.c ext4 crypto: don't let data integrity writebacks fail with ENOMEM 2017-05-25 14:30:11 +02:00
crypto_fname.c fscrypt: avoid collisions when presenting long encrypted filenames 2017-05-25 14:30:11 +02:00
crypto_key.c fscrypt: lock mutex before checking for bounce page pool 2017-11-30 08:37:25 +00:00
crypto_policy.c fscrypt: fix context consistency check when key(s) unavailable 2017-05-25 14:30:11 +02:00
dir.c ext4 crypto: revalidate dentry after adding or removing the key 2017-05-08 07:46:02 +02:00
ext4.h ext4 crypto: don't let data integrity writebacks fail with ENOMEM 2017-05-25 14:30:11 +02:00
ext4_crypto.h fscrypt: remove broken support for detecting keyring key revocation 2017-03-31 09:49:54 +02:00
ext4_extents.h ext4: teach ext4_ext_find_extent() to realloc path if necessary 2014-09-01 14:40:09 -04:00
ext4_jbd2.c ext4: fix potential use after free in __ext4_journal_stop 2015-10-17 22:57:06 -04:00
ext4_jbd2.h ext4: do not perform data journaling when data is encrypted 2017-01-06 11:16:13 +01:00
extents.c ext4: prevent right-shifting extents beyond EXT_MAX_BLOCKS 2018-05-02 07:53:38 -07:00
extents_status.c ext4: move procfs registration code to fs/ext4/sysfs.c 2015-09-23 12:46:17 -04:00
extents_status.h ext4: move procfs registration code to fs/ext4/sysfs.c 2015-09-23 12:46:17 -04:00
file.c ext4: fix off-by-one on max nr_pages in ext4_find_unwritten_pgoff() 2018-04-13 19:50:11 +02:00
fsync.c Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2015-04-26 17:22:07 -07:00
hash.c ext4: remove unused header files 2015-04-02 23:47:42 -04:00
ialloc.c ext4: only look at the bg_flags field if it is valid 2018-07-11 16:03:48 +02:00
indirect.c ext4: clean up feature test macros with predicate functions 2015-10-17 16:18:43 -04:00
inline.c ext4: fix deadlock between inline_data and ext4_expand_extra_isize_ea() 2018-04-24 09:32:10 +02:00
inode.c ext4: update mtime in ext4_punch_hole even if no blocks are released 2018-07-03 11:21:25 +02:00
ioctl.c ext4: require encryption feature for EXT4_IOC_SET_ENCRYPTION_POLICY 2017-05-08 07:46:02 +02:00
Kconfig ext4: Update EXT4_USE_FOR_EXT2 description 2015-09-24 13:27:47 +02:00
Makefile ext4: move sysfs code from super.c to fs/ext4/sysfs.c 2015-09-23 12:44:17 -04:00
mballoc.c ext4: only look at the bg_flags field if it is valid 2018-07-11 16:03:48 +02:00
mballoc.h ext4: remove unused ac_ex_scanned 2014-02-20 13:32:10 -05:00
migrate.c ext4: clean up feature test macros with predicate functions 2015-10-17 16:18:43 -04:00
mmp.c ext4: call out CRC and corruption errors with specific error codes 2015-10-17 16:16:04 -04:00
move_extent.c fs: add i_blocksize() 2017-06-14 13:16:24 +02:00
namei.c do d_instantiate/unlock_new_inode combinations safely 2018-05-30 07:48:52 +02:00
page-io.c ext4 crypto: fix some error handling 2017-05-25 14:30:11 +02:00
readpage.c ext4 crypto: don't let data integrity writebacks fail with ENOMEM 2017-05-25 14:30:11 +02:00
resize.c ext4: fix fencepost error in check for inode count overflow during resize 2018-07-03 11:21:25 +02:00
super.c ext4: only look at the bg_flags field if it is valid 2018-07-11 16:03:48 +02:00
symlink.c don't put symlink bodies in pagecache into highmem 2018-02-16 20:09:38 +01:00
sysfs.c ext4: check return value of kstrtoull correctly in reserved_clusters_store 2017-07-15 11:57:50 +02:00
truncate.h ext4: fix races between page faults and hole punching 2016-05-04 14:48:53 -07:00
xattr.c ext4: fix deadlock between inline_data and ext4_expand_extra_isize_ea() 2018-04-24 09:32:10 +02:00
xattr.h ext4: fix deadlock between inline_data and ext4_expand_extra_isize_ea() 2018-04-24 09:32:10 +02:00
xattr_security.c xattr handlers: Pass handler to operations instead of flags 2015-11-13 20:34:32 -05:00
xattr_trusted.c xattr handlers: Pass handler to operations instead of flags 2015-11-13 20:34:32 -05:00
xattr_user.c xattr handlers: Pass handler to operations instead of flags 2015-11-13 20:34:32 -05:00