ext4: add EA_INODE checking to ext4_iget()
authorTheodore Ts'o <tytso@mit.edu>
Wed, 24 May 2023 03:49:48 +0000 (23:49 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Sun, 28 May 2023 18:18:03 +0000 (14:18 -0400)
commitb3e6bcb94590dea45396b9481e47b809b1be4afa
treefc4ee8b7fd26e3e0df1dd673fd3b4f53739d3e62
parent7877cb91f1081754a1487c144d85dc0d2e2e7fc4
ext4: add EA_INODE checking to ext4_iget()

Add a new flag, EXT4_IGET_EA_INODE which indicates whether the inode
is expected to have the EA_INODE flag or not.  If the flag is not
set/clear as expected, then fail the iget() operation and mark the
file system as corrupted.

This commit also makes the ext4_iget() always perform the
is_bad_inode() check even when the inode is already inode cache.  This
allows us to remove the is_bad_inode() check from the callers of
ext4_iget() in the ea_inode code.

Reported-by: syzbot+cbb68193bdb95af4340a@syzkaller.appspotmail.com
Reported-by: syzbot+62120febbd1ee3c3c860@syzkaller.appspotmail.com
Reported-by: syzbot+edce54daffee36421b4c@syzkaller.appspotmail.com
Cc: stable@kernel.org
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Link: https://lore.kernel.org/r/20230524034951.779531-2-tytso@mit.edu
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
fs/ext4/ext4.h
fs/ext4/inode.c
fs/ext4/xattr.c