+53
−60
Loading
mainline inclusion from mainline-v6.10-rc1 commit 0a46ef234756dca04623b7591e8ebb3440622f0b category: bugfix bugzilla: https://gitee.com/src-openeuler/kernel/issues/IAD03M CVE: CVE-2024-40972 Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=0a46ef234756dca04623b7591e8ebb3440622f0b -------------------------------- ext4_xattr_set_entry() creates new EA inodes while holding buffer lock on the external xattr block. This is problematic as it nests all the allocation locking (which acquires locks on other buffers) under the buffer lock. This can even deadlock when the filesystem is corrupted and e.g. quota file is setup to contain xattr block as data block. Move the allocation of EA inode out of ext4_xattr_set_entry() into the callers. Reported-by:<syzbot+a43d4f48b8397d0e41a9@syzkaller.appspotmail.com> Signed-off-by:
Jan Kara <jack@suse.cz> Link: https://lore.kernel.org/r/20240321162657.27420-2-jack@suse.cz Signed-off-by:
Theodore Ts'o <tytso@mit.edu> Conflicts: fs/ext4/xattr.c [context differences] Signed-off-by:
Yifan Qiao <qiaoyifan4@huawei.com>