Whamcloud - gitweb
libext2fs: fix potential OOB read check_for_inode_bad_blocks()
authorTheodore Ts'o <tytso@mit.edu>
Thu, 16 Jan 2020 23:14:37 +0000 (18:14 -0500)
committerTheodore Ts'o <tytso@mit.edu>
Wed, 12 Feb 2020 16:28:29 +0000 (11:28 -0500)
commit7d25ea4628c0743a1b62e1884305fa283f2eb6e2
treeb8d7c9f341cfebf9a58b902671accef9c17a8691
parentbc56227376223c02b16703691fd0de6929a1036b
libext2fs: fix potential OOB read check_for_inode_bad_blocks()

If the bad block list has been reset in the middle of an inode scan,
it's possible for bb->list[scan->bad_blocks_ptr] to result in an
out-of-bounds read access.

This is highly unlikely to happen under normal circumstances; in
particular, we generally don't use bad block inodes any more.  In
addition, this would only happen if the bad block inode itself is
corrupt so e2fsck needs to wipe it out.  This might cause e2fsck to
crash, but it will more likely cause a part of the inode table to be
wrongly considered invalid, causing file system to be incorrectly
fixed.

This was reported by TALOS as TALOS-2020-0974 and CVE-2020-6057, but
after closer examination, we don't believe this can be used in any way
to exploit the system or release information about the system, since
all this can do is to cause part of the inode table to be skipped when
it shouldn't be, and this can't be leveraged since any information
about the ASLR of the process is obsolete once e2fsck exits.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
lib/ext2fs/inode.c