====================================================== WARNING: possible circular locking dependency detected 6.14.0-rc3-syzkaller-00267-gff202c5028a1 #0 Not tainted ------------------------------------------------------ syz.0.10008/13478 is trying to acquire lock: ffff8880129cbb38 (&ovl_i_mutex_dir_key[depth]#2){++++}-{4:4}, at: inode_lock_shared include/linux/fs.h:887 [inline] ffff8880129cbb38 (&ovl_i_mutex_dir_key[depth]#2){++++}-{4:4}, at: lookup_slow fs/namei.c:1809 [inline] ffff8880129cbb38 (&ovl_i_mutex_dir_key[depth]#2){++++}-{4:4}, at: walk_component+0x342/0x5b0 fs/namei.c:2114 but task is already holding lock: ffff88805a52e488 (&of->mutex){+.+.}-{4:4}, at: kernfs_fop_write_iter+0x27b/0x500 fs/kernfs/file.c:325 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #3 (&of->mutex){+.+.}-{4:4}: __mutex_lock_common kernel/locking/mutex.c:585 [inline] __mutex_lock+0x19b/0xb10 kernel/locking/mutex.c:730 kernfs_fop_write_iter+0x27b/0x500 fs/kernfs/file.c:325 iter_file_splice_write+0x90f/0x10b0 fs/splice.c:743 do_splice_from fs/splice.c:941 [inline] do_splice+0x146a/0x1f70 fs/splice.c:1354 __do_splice+0x327/0x360 fs/splice.c:1436 __do_sys_splice fs/splice.c:1639 [inline] __se_sys_splice fs/splice.c:1621 [inline] __ia32_sys_splice+0x189/0x250 fs/splice.c:1621 do_syscall_32_irqs_on arch/x86/entry/common.c:165 [inline] __do_fast_syscall_32+0x73/0x120 arch/x86/entry/common.c:386 do_fast_syscall_32+0x32/0x80 arch/x86/entry/common.c:411 entry_SYSENTER_compat_after_hwframe+0x84/0x8e -> #2 (&pipe->mutex){+.+.}-{4:4}: __mutex_lock_common kernel/locking/mutex.c:585 [inline] __mutex_lock+0x19b/0xb10 kernel/locking/mutex.c:730 pipe_lock fs/pipe.c:92 [inline] pipe_lock+0x64/0x80 fs/pipe.c:89 iter_file_splice_write+0x1eb/0x10b0 fs/splice.c:687 backing_file_splice_write+0x277/0x880 fs/backing-file.c:315 ovl_splice_write+0x38e/0x630 fs/overlayfs/file.c:440 do_splice_from fs/splice.c:941 [inline] do_splice+0x146a/0x1f70 fs/splice.c:1354 __do_splice+0x327/0x360 fs/splice.c:1436 __do_sys_splice fs/splice.c:1639 [inline] __se_sys_splice fs/splice.c:1621 [inline] __ia32_sys_splice+0x189/0x250 fs/splice.c:1621 do_syscall_32_irqs_on arch/x86/entry/common.c:165 [inline] __do_fast_syscall_32+0x73/0x120 arch/x86/entry/common.c:386 do_fast_syscall_32+0x32/0x80 arch/x86/entry/common.c:411 entry_SYSENTER_compat_after_hwframe+0x84/0x8e -> #1 (sb_writers#5){.+.+}-{0:0}: percpu_down_read include/linux/percpu-rwsem.h:51 [inline] __sb_start_write include/linux/fs.h:1785 [inline] sb_start_write include/linux/fs.h:1921 [inline] mnt_want_write+0x6f/0x450 fs/namespace.c:547 ovl_set_or_remove_acl fs/overlayfs/inode.c:517 [inline] ovl_set_acl+0x39f/0x9f0 fs/overlayfs/inode.c:566 set_posix_acl+0x25c/0x320 fs/posix_acl.c:954 vfs_set_acl+0x5a7/0x930 fs/posix_acl.c:1133 do_set_acl+0xd9/0x1a0 fs/posix_acl.c:1278 do_setxattr+0xe7/0x170 fs/xattr.c:633 file_setxattr fs/xattr.c:646 [inline] file_setxattr+0x139/0x1b0 fs/xattr.c:640 path_setxattrat+0x233/0x290 fs/xattr.c:711 __do_sys_fsetxattr fs/xattr.c:761 [inline] __se_sys_fsetxattr fs/xattr.c:758 [inline] __ia32_sys_fsetxattr+0xc4/0x140 fs/xattr.c:758 do_syscall_32_irqs_on arch/x86/entry/common.c:165 [inline] __do_fast_syscall_32+0x73/0x120 arch/x86/entry/common.c:386 do_fast_syscall_32+0x32/0x80 arch/x86/entry/common.c:411 entry_SYSENTER_compat_after_hwframe+0x84/0x8e -> #0 (&ovl_i_mutex_dir_key[depth]#2){++++}-{4:4}: check_prev_add kernel/locking/lockdep.c:3163 [inline] check_prevs_add kernel/locking/lockdep.c:3282 [inline] validate_chain kernel/locking/lockdep.c:3906 [inline] __lock_acquire+0x249e/0x3c40 kernel/locking/lockdep.c:5228 lock_acquire.part.0+0x11b/0x380 kernel/locking/lockdep.c:5851 down_read+0x9a/0x330 kernel/locking/rwsem.c:1524 inode_lock_shared include/linux/fs.h:887 [inline] lookup_slow fs/namei.c:1809 [inline] walk_component+0x342/0x5b0 fs/namei.c:2114 lookup_last fs/namei.c:2612 [inline] path_lookupat+0x17f/0x770 fs/namei.c:2636 filename_lookup+0x221/0x5f0 fs/namei.c:2665 kern_path+0x35/0x50 fs/namei.c:2773 lookup_bdev+0xd9/0x280 block/bdev.c:1163 resume_store+0x1d8/0x460 kernel/power/hibernate.c:1247 kobj_attr_store+0x55/0x80 lib/kobject.c:840 sysfs_kf_write+0x117/0x170 fs/sysfs/file.c:139 kernfs_fop_write_iter+0x33d/0x500 fs/kernfs/file.c:334 new_sync_write fs/read_write.c:586 [inline] vfs_write+0x5ae/0x1150 fs/read_write.c:679 ksys_write+0x12b/0x250 fs/read_write.c:731 do_syscall_32_irqs_on arch/x86/entry/common.c:165 [inline] __do_fast_syscall_32+0x73/0x120 arch/x86/entry/common.c:386 do_fast_syscall_32+0x32/0x80 arch/x86/entry/common.c:411 entry_SYSENTER_compat_after_hwframe+0x84/0x8e other info that might help us debug this: Chain exists of: &ovl_i_mutex_dir_key[depth]#2 --> &pipe->mutex --> &of->mutex Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&of->mutex); lock(&pipe->mutex); lock(&of->mutex); rlock(&ovl_i_mutex_dir_key[depth]#2); *** DEADLOCK *** 4 locks held by syz.0.10008/13478: #0: ffff8880217ea0f8 (&f->f_pos_lock){+.+.}-{4:4}, at: fdget_pos+0x267/0x390 fs/file.c:1192 #1: ffff88804d258420 (sb_writers#8){.+.+}-{0:0}, at: ksys_write+0x12b/0x250 fs/read_write.c:731 #2: ffff88805a52e488 (&of->mutex){+.+.}-{4:4}, at: kernfs_fop_write_iter+0x27b/0x500 fs/kernfs/file.c:325 #3: ffff888041689d28 (kn->active#74){.+.+}-{0:0}, at: kernfs_fop_write_iter+0x29e/0x500 fs/kernfs/file.c:326 stack backtrace: CPU: 3 UID: 0 PID: 13478 Comm: syz.0.10008 Not tainted 6.14.0-rc3-syzkaller-00267-gff202c5028a1 #0 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2~bpo12+1 04/01/2014 Call Trace: __dump_stack lib/dump_stack.c:94 [inline] dump_stack_lvl+0x116/0x1f0 lib/dump_stack.c:120 print_circular_bug+0x490/0x760 kernel/locking/lockdep.c:2076 check_noncircular+0x31a/0x400 kernel/locking/lockdep.c:2208 check_prev_add kernel/locking/lockdep.c:3163 [inline] check_prevs_add kernel/locking/lockdep.c:3282 [inline] validate_chain kernel/locking/lockdep.c:3906 [inline] __lock_acquire+0x249e/0x3c40 kernel/locking/lockdep.c:5228 lock_acquire.part.0+0x11b/0x380 kernel/locking/lockdep.c:5851 down_read+0x9a/0x330 kernel/locking/rwsem.c:1524 inode_lock_shared include/linux/fs.h:887 [inline] lookup_slow fs/namei.c:1809 [inline] walk_component+0x342/0x5b0 fs/namei.c:2114 lookup_last fs/namei.c:2612 [inline] path_lookupat+0x17f/0x770 fs/namei.c:2636 filename_lookup+0x221/0x5f0 fs/namei.c:2665 kern_path+0x35/0x50 fs/namei.c:2773 lookup_bdev+0xd9/0x280 block/bdev.c:1163 resume_store+0x1d8/0x460 kernel/power/hibernate.c:1247 kobj_attr_store+0x55/0x80 lib/kobject.c:840 sysfs_kf_write+0x117/0x170 fs/sysfs/file.c:139 kernfs_fop_write_iter+0x33d/0x500 fs/kernfs/file.c:334 new_sync_write fs/read_write.c:586 [inline] vfs_write+0x5ae/0x1150 fs/read_write.c:679 ksys_write+0x12b/0x250 fs/read_write.c:731 do_syscall_32_irqs_on arch/x86/entry/common.c:165 [inline] __do_fast_syscall_32+0x73/0x120 arch/x86/entry/common.c:386 do_fast_syscall_32+0x32/0x80 arch/x86/entry/common.c:411 entry_SYSENTER_compat_after_hwframe+0x84/0x8e RIP: 0023:0xf7f96579 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:00000000f50b655c EFLAGS: 00000296 ORIG_RAX: 0000000000000004 RAX: ffffffffffffffda RBX: 0000000000000005 RCX: 0000000080000040 RDX: 0000000000000012 RSI: 0000000000000000 RDI: 0000000000000000 RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000296 R12: 0000000000000000 R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 PM: Image not found (code -22) ---------------- 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 ret 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