syzbot


possible deadlock in ext4_xattr_inode_iget

Status: upstream: reported C repro on 2023/03/12 10:40
Bug presence: origin:upstream
[Documentation on labels]
Reported-by: syzbot+7ea78cee4928af04294d@syzkaller.appspotmail.com
First crash: 470d, last: 59d
Fix bisection: failed (error log, bisect log)
  
Bug presence (1)
Date Name Commit Repro Result
2023/05/12 upstream (ToT) 76c7f8873a76 C [report] possible deadlock in ext4_xattr_inode_iget
Similar bugs (4)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream possible deadlock in ext4_xattr_inode_iget ext4 C done 351 368d 526d 22/27 fixed on 2023/07/01 16:05
upstream possible deadlock in ext4_xattr_inode_iget (2) ext4 C done done 22 161d 354d 26/27 fixed on 2024/03/20 11:33
linux-5.15 possible deadlock in ext4_xattr_inode_iget origin:upstream C 68 28d 471d 0/3 upstream: reported C repro on 2023/03/12 00:08
upstream possible deadlock in ext4_xattr_inode_iget (3) ext4 C error 9 2d00h 82d 0/27 upstream: reported C repro on 2024/04/03 07:45
Fix bisection attempts (8)
Created Duration User Patch Repo Result
2024/05/30 21:31 13m bisect fix linux-6.1.y error job log (0)
2024/04/26 20:58 2h19m bisect fix linux-6.1.y job log (0) log
2024/03/19 04:10 53m bisect fix linux-6.1.y job log (0) log
2024/02/17 06:56 1h13m bisect fix linux-6.1.y job log (0) log
2024/01/08 02:02 1h03m bisect fix linux-6.1.y job log (0) log
2023/12/08 16:25 52m bisect fix linux-6.1.y job log (0) log
2023/11/07 22:58 1h23m bisect fix linux-6.1.y job log (0) log
2023/10/06 00:36 52m bisect fix linux-6.1.y job log (0) log

Sample crash report:
EXT4-fs: Warning: mounting with an experimental mount option 'dioread_nolock' for blocksize < PAGE_SIZE
EXT4-fs (loop0): 1 truncate cleaned up
EXT4-fs (loop0): mounted filesystem without journal. Quota mode: writeback.
======================================================
WARNING: possible circular locking dependency detected
6.1.27-syzkaller #0 Not tainted
------------------------------------------------------
syz-executor294/3541 is trying to acquire lock:
ffff888073145440 (&ea_inode->i_rwsem#8/1){+.+.}-{3:3}, at: inode_lock include/linux/fs.h:756 [inline]
ffff888073145440 (&ea_inode->i_rwsem#8/1){+.+.}-{3:3}, at: ext4_xattr_inode_iget+0x4a3/0x5e0 fs/ext4/xattr.c:438

but task is already holding lock:
ffff8880731448c0 (&ei->i_data_sem){++++}-{3:3}, at: ext4_setattr+0x13fa/0x1a00 fs/ext4/inode.c:5518

which lock already depends on the new lock.


the existing dependency chain (in reverse order) is:

-> #1 (&ei->i_data_sem){++++}-{3:3}:
       lock_acquire+0x1f8/0x5a0 kernel/locking/lockdep.c:5669
       down_write+0x36/0x60 kernel/locking/rwsem.c:1573
       ext4_update_i_disksize fs/ext4/ext4.h:3383 [inline]
       ext4_xattr_inode_write fs/ext4/xattr.c:1413 [inline]
       ext4_xattr_inode_lookup_create fs/ext4/xattr.c:1562 [inline]
       ext4_xattr_set_entry+0x3187/0x3c00 fs/ext4/xattr.c:1686
       ext4_xattr_ibody_set+0x11d/0x330 fs/ext4/xattr.c:2238
       ext4_xattr_set_handle+0xc72/0x1560 fs/ext4/xattr.c:2395
       ext4_xattr_set+0x231/0x3d0 fs/ext4/xattr.c:2509
       __vfs_setxattr+0x3e7/0x420 fs/xattr.c:182
       __vfs_setxattr_noperm+0x12a/0x5e0 fs/xattr.c:216
       vfs_setxattr+0x21d/0x420 fs/xattr.c:309
       do_setxattr fs/xattr.c:594 [inline]
       setxattr+0x250/0x2b0 fs/xattr.c:617
       path_setxattr+0x1bc/0x2a0 fs/xattr.c:636
       __do_sys_setxattr fs/xattr.c:652 [inline]
       __se_sys_setxattr fs/xattr.c:648 [inline]
       __x64_sys_setxattr+0xb7/0xd0 fs/xattr.c:648
       do_syscall_x64 arch/x86/entry/common.c:50 [inline]
       do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80
       entry_SYSCALL_64_after_hwframe+0x63/0xcd

-> #0 (&ea_inode->i_rwsem#8/1){+.+.}-{3:3}:
       check_prev_add kernel/locking/lockdep.c:3098 [inline]
       check_prevs_add kernel/locking/lockdep.c:3217 [inline]
       validate_chain+0x1667/0x58e0 kernel/locking/lockdep.c:3832
       __lock_acquire+0x125b/0x1f80 kernel/locking/lockdep.c:5056
       lock_acquire+0x1f8/0x5a0 kernel/locking/lockdep.c:5669
       down_write+0x36/0x60 kernel/locking/rwsem.c:1573
       inode_lock include/linux/fs.h:756 [inline]
       ext4_xattr_inode_iget+0x4a3/0x5e0 fs/ext4/xattr.c:438
       ext4_xattr_inode_get+0x17d/0x9a0 fs/ext4/xattr.c:501
       ext4_xattr_move_to_block fs/ext4/xattr.c:2590 [inline]
       ext4_xattr_make_inode_space fs/ext4/xattr.c:2692 [inline]
       ext4_expand_extra_isize_ea+0xe77/0x1bc0 fs/ext4/xattr.c:2784
       __ext4_expand_extra_isize+0x2f7/0x3d0 fs/ext4/inode.c:5890
       ext4_try_to_expand_extra_isize fs/ext4/inode.c:5933 [inline]
       __ext4_mark_inode_dirty+0x54f/0x920 fs/ext4/inode.c:6011
       ext4_setattr+0x1493/0x1a00 fs/ext4/inode.c:5521
       notify_change+0xdcd/0x1080 fs/attr.c:482
       do_truncate+0x21c/0x300 fs/open.c:65
       handle_truncate fs/namei.c:3216 [inline]
       do_open fs/namei.c:3561 [inline]
       path_openat+0x27e2/0x2e60 fs/namei.c:3714
       do_filp_open+0x230/0x480 fs/namei.c:3741
       do_sys_openat2+0x13b/0x500 fs/open.c:1310
       do_sys_open fs/open.c:1326 [inline]
       __do_sys_creat fs/open.c:1402 [inline]
       __se_sys_creat fs/open.c:1396 [inline]
       __x64_sys_creat+0x11f/0x160 fs/open.c:1396
       do_syscall_x64 arch/x86/entry/common.c:50 [inline]
       do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80
       entry_SYSCALL_64_after_hwframe+0x63/0xcd

other info that might help us debug this:

 Possible unsafe locking scenario:

       CPU0                    CPU1
       ----                    ----
  lock(&ei->i_data_sem);
                               lock(&ea_inode->i_rwsem#8/1);
                               lock(&ei->i_data_sem);
  lock(&ea_inode->i_rwsem#8/1);

 *** DEADLOCK ***

5 locks held by syz-executor294/3541:
 #0: ffff88807b46a460 (sb_writers#4){.+.+}-{0:0}, at: mnt_want_write+0x3b/0x80 fs/namespace.c:393
 #1: ffff888073144a38 (&sb->s_type->i_mutex_key#8){++++}-{3:3}, at: inode_lock include/linux/fs.h:756 [inline]
 #1: ffff888073144a38 (&sb->s_type->i_mutex_key#8){++++}-{3:3}, at: do_truncate+0x208/0x300 fs/open.c:63
 #2: ffff888073144bd8 (mapping.invalidate_lock){++++}-{3:3}, at: filemap_invalidate_lock include/linux/fs.h:801 [inline]
 #2: ffff888073144bd8 (mapping.invalidate_lock){++++}-{3:3}, at: ext4_setattr+0xec7/0x1a00 fs/ext4/inode.c:5478
 #3: ffff8880731448c0 (&ei->i_data_sem){++++}-{3:3}, at: ext4_setattr+0x13fa/0x1a00 fs/ext4/inode.c:5518
 #4: ffff888073144700 (&ei->xattr_sem){++++}-{3:3}, at: ext4_write_trylock_xattr fs/ext4/xattr.h:162 [inline]
 #4: ffff888073144700 (&ei->xattr_sem){++++}-{3:3}, at: ext4_try_to_expand_extra_isize fs/ext4/inode.c:5930 [inline]
 #4: ffff888073144700 (&ei->xattr_sem){++++}-{3:3}, at: __ext4_mark_inode_dirty+0x4b0/0x920 fs/ext4/inode.c:6011

stack backtrace:
CPU: 1 PID: 3541 Comm: syz-executor294 Not tainted 6.1.27-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/14/2023
Call Trace:
 <TASK>
 __dump_stack lib/dump_stack.c:88 [inline]
 dump_stack_lvl+0x1e3/0x2cb lib/dump_stack.c:106
 check_noncircular+0x2fa/0x3b0 kernel/locking/lockdep.c:2178
 check_prev_add kernel/locking/lockdep.c:3098 [inline]
 check_prevs_add kernel/locking/lockdep.c:3217 [inline]
 validate_chain+0x1667/0x58e0 kernel/locking/lockdep.c:3832
 __lock_acquire+0x125b/0x1f80 kernel/locking/lockdep.c:5056
 lock_acquire+0x1f8/0x5a0 kernel/locking/lockdep.c:5669
 down_write+0x36/0x60 kernel/locking/rwsem.c:1573
 inode_lock include/linux/fs.h:756 [inline]
 ext4_xattr_inode_iget+0x4a3/0x5e0 fs/ext4/xattr.c:438
 ext4_xattr_inode_get+0x17d/0x9a0 fs/ext4/xattr.c:501
 ext4_xattr_move_to_block fs/ext4/xattr.c:2590 [inline]
 ext4_xattr_make_inode_space fs/ext4/xattr.c:2692 [inline]
 ext4_expand_extra_isize_ea+0xe77/0x1bc0 fs/ext4/xattr.c:2784
 __ext4_expand_extra_isize+0x2f7/0x3d0 fs/ext4/inode.c:5890
 ext4_try_to_expand_extra_isize fs/ext4/inode.c:5933 [inline]
 __ext4_mark_inode_dirty+0x54f/0x920 fs/ext4/inode.c:6011
 ext4_setattr+0x1493/0x1a00 fs/ext4/inode.c:5521
 notify_change+0xdcd/0x1080 fs/attr.c:482
 do_truncate+0x21c/0x300 fs/open.c:65
 handle_truncate fs/namei.c:3216 [inline]
 do_open fs/namei.c:3561 [inline]
 path_openat+0x27e2/0x2e60 fs/namei.c:3714
 do_filp_open+0x230/0x480 fs/namei.c:3741
 do_sys_openat2+0x13b/0x500 fs/open.c:1310
 do_sys_open fs/open.c:1326 [inline]
 __do_sys_creat fs/open.c:1402 [inline]
 __se_sys_creat fs/open.c:1396 [inline]
 __x64_sys_creat+0x11f/0x160 fs/open.c:1396
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x63/0xcd
RIP: 0033:0x7f7d36a45c59
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 51 14 00 00 90 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 c0 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007ffe3bff7dc8 EFLAGS: 00000246 ORIG_RAX: 0000000000000055
RAX: ffffffffffffffda RBX: 0031656c69662f2e RCX: 00007f7d36a45c59
RDX: 00007f7d36a45c59 RSI: 0000000000000000 RDI: 0000000020000080
RBP: 00007f7d36a05260 R08: 0000000000000000 R09: 0000000000000000

Crashes (40):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2023/05/08 04:41 linux-6.1.y ca48fc16c493 90c93c40 .config console log report syz C [disk image] [vmlinux] [kernel image] [mounted in repro] ci2-linux-6-1-kasan possible deadlock in ext4_xattr_inode_iget
2024/03/26 10:06 linux-6.1.y d7543167affd bcd9b39f .config console log report syz C [disk image] [vmlinux] [kernel image] [mounted in repro] ci2-linux-6-1-kasan-arm64 possible deadlock in ext4_xattr_inode_iget
2024/03/26 05:16 linux-6.1.y d7543167affd bcd9b39f .config console log report syz C [disk image] [vmlinux] [kernel image] [mounted in repro] ci2-linux-6-1-kasan-arm64 possible deadlock in ext4_xattr_inode_iget
2023/07/23 07:32 linux-6.1.y a456e1743881 27cbe77f .config console log report syz C [disk image] [vmlinux] [kernel image] [mounted in repro] ci2-linux-6-1-kasan possible deadlock in ext4_xattr_inode_iget
2023/06/17 06:20 linux-6.1.y ca87e77a2ef8 f3921d4d .config console log report syz C [disk image] [vmlinux] [kernel image] [mounted in repro] ci2-linux-6-1-kasan possible deadlock in ext4_xattr_inode_iget
2023/06/07 16:54 linux-6.1.y 76ba310227d2 a4ae4f42 .config console log report syz C [disk image] [vmlinux] [kernel image] [mounted in repro] ci2-linux-6-1-kasan possible deadlock in ext4_xattr_inode_iget
2023/06/07 16:33 linux-6.1.y 76ba310227d2 a4ae4f42 .config console log report syz C [disk image] [vmlinux] [kernel image] [mounted in repro] ci2-linux-6-1-kasan possible deadlock in ext4_xattr_inode_iget
2023/06/07 16:12 linux-6.1.y 76ba310227d2 a4ae4f42 .config console log report syz C [disk image] [vmlinux] [kernel image] [mounted in repro] ci2-linux-6-1-kasan possible deadlock in ext4_xattr_inode_iget
2023/08/12 02:36 linux-6.1.y 1321ab403b38 39990d51 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in ext4_xattr_inode_iget
2023/08/10 06:25 linux-6.1.y 0a4a7855302d 13ca4cd6 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in ext4_xattr_inode_iget
2023/05/17 04:11 linux-6.1.y bf4ad6fa4e53 11c89444 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in ext4_xattr_inode_iget
2023/05/16 17:30 linux-6.1.y bf4ad6fa4e53 11c89444 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in ext4_xattr_inode_iget
2023/05/16 12:00 linux-6.1.y bf4ad6fa4e53 71b00cfb .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in ext4_xattr_inode_iget
2023/05/16 11:03 linux-6.1.y bf4ad6fa4e53 71b00cfb .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in ext4_xattr_inode_iget
2023/05/16 07:53 linux-6.1.y bf4ad6fa4e53 71b00cfb .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in ext4_xattr_inode_iget
2023/05/15 17:34 linux-6.1.y bf4ad6fa4e53 c4d362e7 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in ext4_xattr_inode_iget
2023/05/15 16:50 linux-6.1.y bf4ad6fa4e53 c4d362e7 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in ext4_xattr_inode_iget
2023/05/15 12:47 linux-6.1.y bf4ad6fa4e53 c4d362e7 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in ext4_xattr_inode_iget
2023/05/15 09:16 linux-6.1.y bf4ad6fa4e53 f1743960 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in ext4_xattr_inode_iget
2023/05/15 09:11 linux-6.1.y bf4ad6fa4e53 f1743960 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in ext4_xattr_inode_iget
2023/05/13 12:37 linux-6.1.y bf4ad6fa4e53 2b9ba477 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in ext4_xattr_inode_iget
2023/05/13 09:55 linux-6.1.y bf4ad6fa4e53 2b9ba477 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in ext4_xattr_inode_iget
2023/05/13 08:19 linux-6.1.y bf4ad6fa4e53 2b9ba477 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in ext4_xattr_inode_iget
2023/05/13 01:42 linux-6.1.y bf4ad6fa4e53 ecca8a24 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in ext4_xattr_inode_iget
2023/05/13 01:33 linux-6.1.y bf4ad6fa4e53 ecca8a24 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in ext4_xattr_inode_iget
2023/05/13 01:32 linux-6.1.y bf4ad6fa4e53 ecca8a24 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in ext4_xattr_inode_iget
2023/05/13 01:32 linux-6.1.y bf4ad6fa4e53 ecca8a24 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in ext4_xattr_inode_iget
2023/05/12 20:11 linux-6.1.y bf4ad6fa4e53 ecca8a24 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in ext4_xattr_inode_iget
2023/05/12 06:30 linux-6.1.y bf4ad6fa4e53 adb9a3cd .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in ext4_xattr_inode_iget
2023/05/12 00:58 linux-6.1.y bf4ad6fa4e53 adb9a3cd .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in ext4_xattr_inode_iget
2023/05/10 23:20 linux-6.1.y ca48fc16c493 14b12a99 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in ext4_xattr_inode_iget
2023/05/10 22:33 linux-6.1.y ca48fc16c493 14b12a99 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in ext4_xattr_inode_iget
2023/05/10 10:51 linux-6.1.y ca48fc16c493 14b12a99 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in ext4_xattr_inode_iget
2023/05/10 07:50 linux-6.1.y ca48fc16c493 1964022b .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in ext4_xattr_inode_iget
2023/05/09 22:39 linux-6.1.y ca48fc16c493 30aa2a7e .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in ext4_xattr_inode_iget
2023/05/08 23:44 linux-6.1.y ca48fc16c493 c7a5e2a0 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in ext4_xattr_inode_iget
2023/05/08 03:36 linux-6.1.y ca48fc16c493 90c93c40 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in ext4_xattr_inode_iget
2023/03/13 19:19 linux-6.1.y 6449a0ba6843 026e2200 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in ext4_xattr_inode_iget
2023/03/12 10:39 linux-6.1.y 1cc3fcf63192 5205ef30 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in ext4_xattr_inode_iget
2023/04/22 06:19 linux-6.1.y f17b0ab65d17 2b32bd34 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in ext4_xattr_inode_iget
* Struck through repros no longer work on HEAD.