android_kernel_motorola_sm6375/fs/ext4
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Luís Henriques 2fa24d0274 ext4: fix BUG_ON() when directory entry has invalid rec_len
commit 17a0bc9bd697f75cfdf9b378d5eb2d7409c91340 upstream.

The rec_len field in the directory entry has to be a multiple of 4.  A
corrupted filesystem image can be used to hit a BUG() in
ext4_rec_len_to_disk(), called from make_indexed_dir().

 ------------[ cut here ]------------
 kernel BUG at fs/ext4/ext4.h:2413!
 ...
 RIP: 0010:make_indexed_dir+0x53f/0x5f0
 ...
 Call Trace:
  <TASK>
  ? add_dirent_to_buf+0x1b2/0x200
  ext4_add_entry+0x36e/0x480
  ext4_add_nondir+0x2b/0xc0
  ext4_create+0x163/0x200
  path_openat+0x635/0xe90
  do_filp_open+0xb4/0x160
  ? __create_object.isra.0+0x1de/0x3b0
  ? _raw_spin_unlock+0x12/0x30
  do_sys_openat2+0x91/0x150
  __x64_sys_open+0x6c/0xa0
  do_syscall_64+0x3c/0x80
  entry_SYSCALL_64_after_hwframe+0x46/0xb0

The fix simply adds a call to ext4_check_dir_entry() to validate the
directory entry, returning -EFSCORRUPTED if the entry is invalid.

CC: [email protected]
Link: https://bugzilla.kernel.org/show_bug.cgi?id=216540
Signed-off-by: Luís Henriques <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Theodore Ts'o <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
2022-11-10 17:57:56 +01:00
..
acl.c
acl.h
balloc.c ext4: shrink race window in ext4_should_retry_alloc() 2021-04-07 14:47:38 +02:00
bitmap.c
block_validity.c
dir.c ext4: fix potential infinite loop in ext4_dx_readdir() 2021-10-06 15:42:37 +02:00
ext4.h ext4: fix use-after-free in ext4_search_dir 2022-04-27 13:50:50 +02:00
ext4_extents.h
ext4_jbd2.c
ext4_jbd2.h
extents.c ext4: fix bug in extents parsing when eh_entries == 0 and eh_depth > 0 2022-09-28 11:04:09 +02:00
extents_status.c ext4: remove check for zero nr_to_scan in ext4_es_scan() 2021-07-14 16:53:03 +02:00
extents_status.h
file.c ext4: avoid crash when inline data creation follows DIO write 2022-10-26 13:22:18 +02:00
fsmap.c
fsmap.h
fsync.c
hash.c
ialloc.c ext4: make directory inode spreading reflect flexbg size 2022-09-28 11:04:11 +02:00
indirect.c
inline.c ext4: correct max_inline_xattr_value_size computing 2022-08-25 11:18:13 +02:00
inode.c ext4: place buffer head allocation before handle start 2022-10-26 13:22:18 +02:00
ioctl.c ext4: avoid trim error on fs with small groups 2022-01-27 09:19:37 +01:00
Kconfig
Makefile
mballoc.c ext4: fix bug_on ext4_mb_use_inode_pa 2022-06-22 14:11:23 +02:00
mballoc.h
migrate.c ext4: fix warning in 'ext4_da_release_space' 2022-11-10 17:57:56 +01:00
mmp.c
move_extent.c
namei.c ext4: fix BUG_ON() when directory entry has invalid rec_len 2022-11-10 17:57:56 +01:00
page-io.c ext4: fix symlink file size not match to file content 2022-04-27 13:50:50 +02:00
readpage.c
resize.c ext4: continue to expand file system when the target size doesn't reach 2022-10-26 13:23:00 +02:00
super.c ext4: make ext4_lazyinit_thread freezable 2022-10-26 13:22:18 +02:00
symlink.c ext4: report correct st_size for encrypted symlinks 2021-09-12 08:56:38 +02:00
sysfs.c ext4: shrink race window in ext4_should_retry_alloc() 2021-04-07 14:47:38 +02:00
truncate.h
verity.c ext4: fix error handling in ext4_end_enable_verity() 2021-05-26 12:05:21 +02:00
xattr.c ext4: fix use-after-free in ext4_xattr_set_entry 2022-08-25 11:18:12 +02:00
xattr.h ext4: add EXT4_INODE_HAS_XATTR_SPACE macro in xattr.h 2022-08-25 11:18:12 +02:00
xattr_security.c
xattr_trusted.c
xattr_user.c