ext4 filesystem being mounted at /syzkaller-testdir310232738/syzkaller.dfvKb0/649/file0 supports timestamps until 2038 (0x7fffffff) ====================================================== WARNING: possible circular locking dependency detected 6.3.0-rc2-syzkaller-00181-gcb80b960ce44 #0 Not tainted ------------------------------------------------------ syz-executor.0/12117 is trying to acquire lock: ffff8880288319b0 (mapping.invalidate_lock){++++}-{3:3}, at: filemap_invalidate_lock include/linux/fs.h:803 [inline] ffff8880288319b0 (mapping.invalidate_lock){++++}-{3:3}, at: ext4_setattr+0x6f5/0x2870 fs/ext4/inode.c:5548 but task is already holding lock: ffff888028831810 (&ea_inode->i_rwsem#8/1){+.+.}-{3:3}, at: inode_lock include/linux/fs.h:758 [inline] ffff888028831810 (&ea_inode->i_rwsem#8/1){+.+.}-{3:3}, at: do_truncate+0x131/0x200 fs/open.c:64 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #2 (&ea_inode->i_rwsem#8/1){+.+.}-{3:3}: down_write+0x92/0x200 kernel/locking/rwsem.c:1573 inode_lock include/linux/fs.h:758 [inline] ext4_xattr_inode_create fs/ext4/xattr.c:1525 [inline] ext4_xattr_inode_lookup_create fs/ext4/xattr.c:1608 [inline] ext4_xattr_set_entry+0x2b19/0x39e0 fs/ext4/xattr.c:1737 ext4_xattr_block_set+0xcb7/0x3030 fs/ext4/xattr.c:2043 ext4_xattr_set_handle+0xd8a/0x1510 fs/ext4/xattr.c:2458 ext4_xattr_set+0x144/0x360 fs/ext4/xattr.c:2560 __vfs_setxattr+0x173/0x1e0 fs/xattr.c:203 __vfs_setxattr_noperm+0x129/0x5f0 fs/xattr.c:237 __vfs_setxattr_locked+0x1d3/0x260 fs/xattr.c:298 vfs_setxattr+0x143/0x340 fs/xattr.c:324 do_setxattr+0x147/0x190 fs/xattr.c:609 setxattr+0x146/0x160 fs/xattr.c:632 path_setxattr+0x197/0x1c0 fs/xattr.c:651 __do_sys_setxattr fs/xattr.c:667 [inline] __se_sys_setxattr fs/xattr.c:663 [inline] __ia32_sys_setxattr+0xc0/0x160 fs/xattr.c:663 do_syscall_32_irqs_on arch/x86/entry/common.c:112 [inline] __do_fast_syscall_32+0x65/0xf0 arch/x86/entry/common.c:178 do_fast_syscall_32+0x33/0x70 arch/x86/entry/common.c:203 entry_SYSENTER_compat_after_hwframe+0x70/0x82 -> #1 (&ei->xattr_sem){++++}-{3:3}: down_write+0x92/0x200 kernel/locking/rwsem.c:1573 ext4_write_lock_xattr fs/ext4/xattr.h:155 [inline] ext4_inline_data_truncate+0x1a8/0xd70 fs/ext4/inline.c:1932 ext4_truncate+0x992/0x1340 fs/ext4/inode.c:4298 ext4_setattr+0x1b27/0x2870 fs/ext4/inode.c:5625 notify_change+0xb2c/0x1180 fs/attr.c:482 do_truncate+0x143/0x200 fs/open.c:66 handle_truncate fs/namei.c:3219 [inline] do_open fs/namei.c:3564 [inline] path_openat+0x2083/0x2750 fs/namei.c:3715 do_filp_open+0x1ba/0x410 fs/namei.c:3742 do_sys_openat2+0x16d/0x4c0 fs/open.c:1348 do_sys_open fs/open.c:1364 [inline] __do_compat_sys_open fs/open.c:1415 [inline] __se_compat_sys_open fs/open.c:1413 [inline] __ia32_compat_sys_open+0x11d/0x1c0 fs/open.c:1413 do_syscall_32_irqs_on arch/x86/entry/common.c:112 [inline] __do_fast_syscall_32+0x65/0xf0 arch/x86/entry/common.c:178 do_fast_syscall_32+0x33/0x70 arch/x86/entry/common.c:203 entry_SYSENTER_compat_after_hwframe+0x70/0x82 -> #0 (mapping.invalidate_lock){++++}-{3:3} : check_prev_add kernel/locking/lockdep.c:3098 [inline] check_prevs_add kernel/locking/lockdep.c:3217 [inline] validate_chain kernel/locking/lockdep.c:3832 [inline] __lock_acquire+0x2ec7/0x5d40 kernel/locking/lockdep.c:5056 lock_acquire kernel/locking/lockdep.c:5669 [inline] lock_acquire+0x1af/0x520 kernel/locking/lockdep.c:5634 down_write+0x92/0x200 kernel/locking/rwsem.c:1573 filemap_invalidate_lock include/linux/fs.h:803 [inline] ext4_setattr+0x6f5/0x2870 fs/ext4/inode.c:5548 notify_change+0xb2c/0x1180 fs/attr.c:482 do_truncate+0x143/0x200 fs/open.c:66 handle_truncate fs/namei.c:3219 [inline] do_open fs/namei.c:3564 [inline] path_openat+0x2083/0x2750 fs/namei.c:3715 do_filp_open+0x1ba/0x410 fs/namei.c:3742 do_sys_openat2+0x16d/0x4c0 fs/open.c:1348 do_sys_open fs/open.c:1364 [inline] __do_sys_creat fs/open.c:1440 [inline] __se_sys_creat fs/open.c:1434 [inline] __ia32_sys_creat+0xcc/0x120 fs/open.c:1434 do_syscall_32_irqs_on arch/x86/entry/common.c:112 [inline] __do_fast_syscall_32+0x65/0xf0 arch/x86/entry/common.c:178 do_fast_syscall_32+0x33/0x70 arch/x86/entry/common.c:203 entry_SYSENTER_compat_after_hwframe+0x70/0x82 other info that might help us debug this: Chain exists of: mapping.invalidate_lock --> &ei->xattr_sem --> &ea_inode->i_rwsem#8/1 Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&ea_inode->i_rwsem#8/1); lock(&ei->xattr_sem); lock(&ea_inode->i_rwsem#8/1); lock(mapping.invalidate_lock); *** DEADLOCK *** 2 locks held by syz-executor.0/12117: #0: ffff88801d6a2460 (sb_writers#4){.+.+}-{0:0}, at: do_open fs/namei.c:3553 [inline] (sb_writers#4){.+.+}-{0:0}, at: path_openat+0x19a4/0x2750 fs/namei.c:3715 #1: ffff888028831810 (&ea_inode->i_rwsem#8/1){+.+.}-{3:3}, at: inode_lock include/linux/fs.h:758 [inline] #1: ffff888028831810 (&ea_inode->i_rwsem#8/1){+.+.}-{3:3}, at: do_truncate+0x131/0x200 fs/open.c:64 stack backtrace: CPU: 1 PID: 12117 Comm: syz-executor.0 Not tainted 6.3.0-rc2-syzkaller-00181-gcb80b960ce44 #0 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.14.0-2 04/01/2014 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xd9/0x150 lib/dump_stack.c:106 check_noncircular+0x25f/0x2e0 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 kernel/locking/lockdep.c:3832 [inline] __lock_acquire+0x2ec7/0x5d40 kernel/locking/lockdep.c:5056 lock_acquire kernel/locking/lockdep.c:5669 [inline] lock_acquire+0x1af/0x520 kernel/locking/lockdep.c:5634 down_write+0x92/0x200 kernel/locking/rwsem.c:1573 filemap_invalidate_lock include/linux/fs.h:803 [inline] ext4_setattr+0x6f5/0x2870 fs/ext4/inode.c:5548 notify_change+0xb2c/0x1180 fs/attr.c:482 do_truncate+0x143/0x200 fs/open.c:66 handle_truncate fs/namei.c:3219 [inline] do_open fs/namei.c:3564 [inline] path_openat+0x2083/0x2750 fs/namei.c:3715 do_filp_open+0x1ba/0x410 fs/namei.c:3742 do_sys_openat2+0x16d/0x4c0 fs/open.c:1348 do_sys_open fs/open.c:1364 [inline] __do_sys_creat fs/open.c:1440 [inline] __se_sys_creat fs/open.c:1434 [inline] __ia32_sys_creat+0xcc/0x120 fs/open.c:1434 do_syscall_32_irqs_on arch/x86/entry/common.c:112 [inline] __do_fast_syscall_32+0x65/0xf0 arch/x86/entry/common.c:178 do_fast_syscall_32+0x33/0x70 arch/x86/entry/common.c:203 entry_SYSENTER_compat_after_hwframe+0x70/0x82 RIP: 0023:0xf7ff3579 Code: b8 01 10 06 03 74 b4 01 10 07 03 74 b0 01 10 08 03 74 d8 01 00 00 00 00 00 00 00 00 00 00 00 00 00 51 52 55 89 e5 0f 34 cd 80 <5d> 5a 59 c3 90 90 90 90 8d b4 26 00 00 00 00 8d b4 26 00 00 00 00 RSP: 002b:00000000f7fee5cc EFLAGS: 00000296 ORIG_RAX: 0000000000000008 RAX: ffffffffffffffda RBX: 0000000020000000 RCX: 0000000000000000 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000 RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000296 R12: 0000000000000000 R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 ---------------- Code disassembly (best guess), 2 bytes skipped: 0: 10 06 adc %al,(%rsi) 2: 03 74 b4 01 add 0x1(%rsp,%rsi,4),%esi 6: 10 07 adc %al,(%rdi) 8: 03 74 b0 01 add 0x1(%rax,%rsi,4),%esi c: 10 08 adc %cl,(%rax) e: 03 74 d8 01 add 0x1(%rax,%rbx,8),%esi 1e: 00 51 52 add %dl,0x52(%rcx) 21: 55 push %rbp 22: 89 e5 mov %esp,%ebp 24: 0f 34 sysenter 26: cd 80 int $0x80 * 28: 5d pop %rbp <-- trapping instruction 29: 5a pop %rdx 2a: 59 pop %rcx 2b: c3 retq 2c: 90 nop 2d: 90 nop 2e: 90 nop 2f: 90 nop 30: 8d b4 26 00 00 00 00 lea 0x0(%rsi,%riz,1),%esi 37: 8d b4 26 00 00 00 00 lea 0x0(%rsi,%riz,1),%esi