2024-04-11 11:40:14

by Hillf Danton

[permalink] [raw]
Subject: Re: [syzbot] [ext4?] WARNING: locking bug in ext4_xattr_inode_update_ref (3)

On Thu, 11 Apr 2024 02:48:27 -0700
> syzbot found the following issue on:
>
> HEAD commit: f2f80ac80987 Merge tag 'nfsd-6.9-2' of git://git.kernel.or..
> git tree: upstream
> C reproducer: https://syzkaller.appspot.com/x/repro.c?x=1614c105180000

#syz test https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git f2f80ac80987

--- x/fs/ext4/xattr.c
+++ y/fs/ext4/xattr.c
@@ -119,11 +119,12 @@ ext4_expand_inode_array(struct ext4_xatt
struct inode *inode);

#ifdef CONFIG_LOCKDEP
+static struct lock_class_key ea_i_rwsem_key;
void ext4_xattr_inode_set_class(struct inode *ea_inode)
{
struct ext4_inode_info *ei = EXT4_I(ea_inode);

- lockdep_set_subclass(&ea_inode->i_rwsem, 1);
+ lockdep_set_class(&ea_inode->i_rwsem, &ea_i_rwsem_key);
(void) ei; /* shut up clang warning if !CONFIG_LOCKDEP */
lockdep_set_subclass(&ei->i_data_sem, I_DATA_SEM_EA);
}
--


2024-04-11 12:02:28

by syzbot

[permalink] [raw]
Subject: Re: [syzbot] [ext4?] WARNING: locking bug in ext4_xattr_inode_update_ref (3)

Hello,

syzbot has tested the proposed patch and the reproducer did not trigger any issue:

Reported-and-tested-by: [email protected]

Tested on:

commit: f2f80ac8 Merge tag 'nfsd-6.9-2' of git://git.kernel.or..
git tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
console output: https://syzkaller.appspot.com/x/log.txt?x=17315a47180000
kernel config: https://syzkaller.appspot.com/x/.config?x=411644804960f423
dashboard link: https://syzkaller.appspot.com/bug?extid=3ca210b2c10e57015b3c
compiler: gcc (Debian 12.2.0-14) 12.2.0, GNU ld (GNU Binutils for Debian) 2.40
patch: https://syzkaller.appspot.com/x/patch.diff?x=12a085cb180000

Note: testing is done by a robot and is best-effort only.