Skip to content

Commit 2bc7e7c

Browse files
committed
ext4: disallow ea_inodes with extended attributes
An ea_inode stores the value of an extended attribute; it can not have extended attributes itself, or this will cause recursive nightmares. Add a check in ext4_iget() to make sure this is the case. Cc: stable@kernel.org Reported-by: syzbot+e44749b6ba4d0434cd47@syzkaller.appspotmail.com Signed-off-by: Theodore Ts'o <tytso@mit.edu> Link: https://lore.kernel.org/r/20230524034951.779531-4-tytso@mit.edu Signed-off-by: Theodore Ts'o <tytso@mit.edu>
1 parent b928dfd commit 2bc7e7c

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

fs/ext4/inode.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4647,6 +4647,9 @@ static const char *check_igot_inode(struct inode *inode, ext4_iget_flags flags)
46474647
if (flags & EXT4_IGET_EA_INODE) {
46484648
if (!(EXT4_I(inode)->i_flags & EXT4_EA_INODE_FL))
46494649
return "missing EA_INODE flag";
4650+
if (ext4_test_inode_state(inode, EXT4_STATE_XATTR) ||
4651+
EXT4_I(inode)->i_file_acl)
4652+
return "ea_inode with extended attributes";
46504653
} else {
46514654
if ((EXT4_I(inode)->i_flags & EXT4_EA_INODE_FL))
46524655
return "unexpected EA_INODE flag";

0 commit comments

Comments
 (0)