This is a note to let you know that I've just added the patch titled ext4: disallow ea_inodes with extended attributes to the 5.10-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: ext4-disallow-ea_inodes-with-extended-attributes.patch and it can be found in the queue-5.10 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. >From 2bc7e7c1a3bc9bd0cbf0f71006f6fe7ef24a00c2 Mon Sep 17 00:00:00 2001 From: Theodore Ts'o <tytso@xxxxxxx> Date: Tue, 23 May 2023 23:49:50 -0400 Subject: ext4: disallow ea_inodes with extended attributes From: Theodore Ts'o <tytso@xxxxxxx> commit 2bc7e7c1a3bc9bd0cbf0f71006f6fe7ef24a00c2 upstream. 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@xxxxxxxxxx Reported-by: syzbot+e44749b6ba4d0434cd47@xxxxxxxxxxxxxxxxxxxxxxxxx Signed-off-by: Theodore Ts'o <tytso@xxxxxxx> Link: https://lore.kernel.org/r/20230524034951.779531-4-tytso@xxxxxxx Signed-off-by: Theodore Ts'o <tytso@xxxxxxx> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- fs/ext4/inode.c | 3 +++ 1 file changed, 3 insertions(+) --- a/fs/ext4/inode.c +++ b/fs/ext4/inode.c @@ -4686,6 +4686,9 @@ static const char *check_igot_inode(stru if (flags & EXT4_IGET_EA_INODE) { if (!(EXT4_I(inode)->i_flags & EXT4_EA_INODE_FL)) return "missing EA_INODE flag"; + if (ext4_test_inode_state(inode, EXT4_STATE_XATTR) || + EXT4_I(inode)->i_file_acl) + return "ea_inode with extended attributes"; } else { if ((EXT4_I(inode)->i_flags & EXT4_EA_INODE_FL)) return "unexpected EA_INODE flag"; Patches currently in stable-queue which might be from tytso@xxxxxxx are queue-5.10/ext4-add-ea_inode-checking-to-ext4_iget.patch queue-5.10/ext4-set-lockdep-subclass-for-the-ea_inode-in-ext4_xattr_inode_cache_find.patch queue-5.10/ext4-disallow-ea_inodes-with-extended-attributes.patch queue-5.10/ext4-add-lockdep-annotations-for-i_data_sem-for-ea_inode-s.patch