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: [email protected] Reported-by: [email protected] Signed-off-by: Theodore Ts'o <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Theodore Ts'o <[email protected]>
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)