linux-IllusionX/fs/ext4
Eric Sandeen 5872331b3d ext4: fix potential negative array index in do_split()
If for any reason a directory passed to do_split() does not have enough
active entries to exceed half the size of the block, we can end up
iterating over all "count" entries without finding a split point.

In this case, count == move, and split will be zero, and we will
attempt a negative index into map[].

Guard against this by detecting this case, and falling back to
split-to-half-of-count instead; in this case we will still have
plenty of space (> half blocksize) in each split block.

Fixes: ef2b02d3e6 ("ext34: ensure do_split leaves enough free space in both blocks")
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Andreas Dilger <adilger@dilger.ca>
Reviewed-by: Jan Kara <jack@suse.cz>
Link: https://lore.kernel.org/r/f53e246b-647c-64bb-16ec-135383c70ad7@redhat.com
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2020-08-06 00:11:16 -04:00
..
acl.c ext4: handle ext4_mark_inode_dirty errors 2020-06-03 23:16:50 -04:00
acl.h
balloc.c ext4: balloc: use task_pid_nr() helper 2020-06-03 23:16:52 -04:00
bitmap.c
block_validity.c ext4: save all error info in save_error_info() and drop ext4_set_errno() 2020-04-01 17:29:06 -04:00
dir.c ext4: avoid utf8_strncasecmp() with unstable name 2020-06-11 11:01:33 -04:00
ext4.h This is the second round of ext4 commits for 5.8 merge window. It 2020-06-15 09:32:10 -07:00
ext4_extents.h ext4: fix EXT_MAX_EXTENT/INDEX to check for zeroed eh_max 2020-06-03 23:16:49 -04:00
ext4_jbd2.c ext4: remove set but not used variable 'es' in ext4_jbd2.c 2020-04-15 23:58:49 -04:00
ext4_jbd2.h ext4: drop ext4_journal_free_reserved() 2020-06-03 23:16:53 -04:00
extents.c ext4: delete unnecessary checks before brelse() 2020-08-06 00:08:56 -04:00
extents_status.c ext4: remove unnecessary comparisons to bool 2020-06-03 23:16:49 -04:00
extents_status.h
file.c ext4: fix coding style in file.c 2020-08-06 00:11:15 -04:00
fsmap.c
fsmap.h
fsync.c A lot of bug fixes and cleanups for ext4, including: 2020-06-05 16:19:28 -07:00
hash.c
ialloc.c This is the second round of ext4 commits for 5.8 merge window. It 2020-06-15 09:32:10 -07:00
indirect.c ext4: handle ext4_mark_inode_dirty errors 2020-06-03 23:16:50 -04:00
inline.c ext4: handle ext4_mark_inode_dirty errors 2020-06-03 23:16:50 -04:00
inode-test.c
inode.c This is the second round of ext4 commits for 5.8 merge window. It 2020-06-15 09:32:10 -07:00
ioctl.c Enable ext4 support for per-file/directory dax operations 2020-06-11 10:51:44 -04:00
Kconfig linux-kselftest-kunit-5.8-rc1 2020-06-09 10:04:47 -07:00
Makefile ext4: support xattr gnu.* namespace for the Hurd 2020-06-12 13:23:34 -04:00
mballoc.c ext4: mballoc: Use this_cpu_read instead of this_cpu_ptr 2020-06-11 11:03:26 -04:00
mballoc.h ext4: mballoc: make mb_debug() implementation to use pr_debug() 2020-06-03 23:16:52 -04:00
migrate.c ext4: handle ext4_mark_inode_dirty errors 2020-06-03 23:16:50 -04:00
mmp.c ext4: save all error info in save_error_info() and drop ext4_set_errno() 2020-04-01 17:29:06 -04:00
move_extent.c ext4: save all error info in save_error_info() and drop ext4_set_errno() 2020-04-01 17:29:06 -04:00
namei.c ext4: fix potential negative array index in do_split() 2020-08-06 00:11:16 -04:00
page-io.c
readpage.c ext4: pass the inode to ext4_mpage_readpages 2020-06-02 10:59:07 -07:00
resize.c
super.c This is the second round of ext4 commits for 5.8 merge window. It 2020-06-15 09:32:10 -07:00
symlink.c
sysfs.c fscrypt: support test_dummy_encryption=v2 2020-05-18 20:21:48 -07:00
truncate.h
verity.c This is the second round of ext4 commits for 5.8 merge window. It 2020-06-15 09:32:10 -07:00
xattr.c ext4: delete unnecessary checks before brelse() 2020-08-06 00:08:56 -04:00
xattr.h ext4: support xattr gnu.* namespace for the Hurd 2020-06-12 13:23:34 -04:00
xattr_hurd.c ext4: support xattr gnu.* namespace for the Hurd 2020-06-12 13:23:34 -04:00
xattr_security.c
xattr_trusted.c
xattr_user.c