2024-04-03 13:46:47

by Hillf Danton

[permalink] [raw]
Subject: Re: [syzbot] [ext4?] possible deadlock in ext4_xattr_inode_iget (3)

On Wed, 03 Apr 2024 00:45:29 -0700
> syzbot found the following issue on:
>
> HEAD commit: fe46a7dd189e Merge tag 'sound-6.9-rc1' of git://git.kernel..
> git tree: upstream
> C reproducer: https://syzkaller.appspot.com/x/repro.c?x=140d9db1180000

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

--- x/fs/ext4/inode.c
+++ y/fs/ext4/inode.c
@@ -5414,6 +5414,7 @@ int ext4_setattr(struct mnt_idmap *idmap
(attr->ia_size > 0 ? attr->ia_size - 1 : 0) >>
inode->i_sb->s_blocksize_bits);

+ down_read(&EXT4_I(inode)->xattr_sem);
down_write(&EXT4_I(inode)->i_data_sem);
old_disksize = EXT4_I(inode)->i_disksize;
EXT4_I(inode)->i_disksize = attr->ia_size;
@@ -5430,6 +5431,7 @@ int ext4_setattr(struct mnt_idmap *idmap
else
EXT4_I(inode)->i_disksize = old_disksize;
up_write(&EXT4_I(inode)->i_data_sem);
+ up_read(&EXT4_I(inode)->xattr_sem);
ext4_journal_stop(handle);
if (error)
goto out_mmap_sem;
--


2024-04-04 01:13:50

by syzbot

[permalink] [raw]
Subject: Re: [syzbot] [ext4?] possible deadlock in ext4_xattr_inode_iget (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: fe46a7dd Merge tag 'sound-6.9-rc1' of git://git.kernel..
git tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
console output: https://syzkaller.appspot.com/x/log.txt?x=10fceed3180000
kernel config: https://syzkaller.appspot.com/x/.config?x=1a07d5da4eb21586
dashboard link: https://syzkaller.appspot.com/bug?extid=ee72b9a7aad1e5a77c5c
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=132ad4f6180000

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