====================================================== WARNING: possible circular locking dependency detected 6.15.0-rc5-syzkaller-00204-g0e1329d4045c #0 Not tainted ------------------------------------------------------ syz.4.3078/17997 is trying to acquire lock: ffff88801f4338e8 (&p->lock){+.+.}-{4:4}, at: seq_read_iter+0xe1/0x12c0 fs/seq_file.c:182 but task is already holding lock: ffff88804e915868 (&pipe->mutex){+.+.}-{4:4}, at: pipe_lock fs/pipe.c:92 [inline] ffff88804e915868 (&pipe->mutex){+.+.}-{4:4}, at: pipe_lock+0x64/0x80 fs/pipe.c:89 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #5 (&pipe->mutex){+.+.}-{4:4}: __mutex_lock_common kernel/locking/mutex.c:601 [inline] __mutex_lock+0x199/0xb90 kernel/locking/mutex.c:746 pipe_lock fs/pipe.c:92 [inline] pipe_lock+0x64/0x80 fs/pipe.c:89 iter_file_splice_write+0x1ea/0x1150 fs/splice.c:683 do_splice_from fs/splice.c:935 [inline] do_splice+0x1475/0x1fc0 fs/splice.c:1348 __do_splice+0x32a/0x360 fs/splice.c:1430 __do_sys_splice fs/splice.c:1633 [inline] __se_sys_splice fs/splice.c:1615 [inline] __ia32_sys_splice+0x189/0x250 fs/splice.c:1615 do_syscall_32_irqs_on arch/x86/entry/syscall_32.c:83 [inline] __do_fast_syscall_32+0x73/0x120 arch/x86/entry/syscall_32.c:306 do_fast_syscall_32+0x32/0x80 arch/x86/entry/syscall_32.c:331 entry_SYSENTER_compat_after_hwframe+0x84/0x8e -> #4 (sb_writers#5){.+.+}-{0:0}: percpu_down_read include/linux/percpu-rwsem.h:52 [inline] __sb_start_write include/linux/fs.h:1783 [inline] sb_start_write include/linux/fs.h:1919 [inline] mnt_want_write+0x6f/0x450 fs/namespace.c:556 ovl_create_object+0x12c/0x300 fs/overlayfs/dir.c:628 lookup_open.isra.0+0x11d0/0x1580 fs/namei.c:3701 open_last_lookups fs/namei.c:3800 [inline] path_openat+0x905/0x2d40 fs/namei.c:4036 do_filp_open+0x20b/0x470 fs/namei.c:4066 do_sys_openat2+0x11b/0x1d0 fs/open.c:1429 do_sys_open fs/open.c:1444 [inline] __do_sys_creat fs/open.c:1522 [inline] __se_sys_creat fs/open.c:1516 [inline] __ia32_sys_creat+0xcb/0x120 fs/open.c:1516 do_syscall_32_irqs_on arch/x86/entry/syscall_32.c:83 [inline] __do_fast_syscall_32+0x73/0x120 arch/x86/entry/syscall_32.c:306 do_fast_syscall_32+0x32/0x80 arch/x86/entry/syscall_32.c:331 entry_SYSENTER_compat_after_hwframe+0x84/0x8e -> #3 (&ovl_i_mutex_dir_key[depth]#2){++++}-{4:4}: down_read+0x9b/0x480 kernel/locking/rwsem.c:1524 inode_lock_shared include/linux/fs.h:877 [inline] lookup_slow fs/namei.c:1833 [inline] lookup_one_unlocked+0x131/0x160 fs/namei.c:3016 ovl_lookup_positive_unlocked fs/overlayfs/namei.c:208 [inline] ovl_lookup_single+0x1fe/0xfb0 fs/overlayfs/namei.c:238 ovl_lookup_layer+0x3d4/0x480 fs/overlayfs/namei.c:331 ovl_lookup+0x1417/0x2270 fs/overlayfs/namei.c:1122 __lookup_slow+0x24e/0x460 fs/namei.c:1817 lookup_slow fs/namei.c:1834 [inline] walk_component+0x353/0x5b0 fs/namei.c:2138 lookup_last fs/namei.c:2636 [inline] path_lookupat+0x17e/0x780 fs/namei.c:2660 filename_lookup+0x224/0x5f0 fs/namei.c:2689 kern_path+0x35/0x50 fs/namei.c:2822 lookup_bdev+0xd8/0x280 block/bdev.c:1205 resume_store+0x1d6/0x460 kernel/power/hibernate.c:1248 kobj_attr_store+0x55/0x80 lib/kobject.c:840 sysfs_kf_write+0xef/0x150 fs/sysfs/file.c:145 kernfs_fop_write_iter+0x351/0x510 fs/kernfs/file.c:334 new_sync_write fs/read_write.c:591 [inline] vfs_write+0x5ba/0x1180 fs/read_write.c:684 ksys_write+0x12a/0x240 fs/read_write.c:736 do_syscall_32_irqs_on arch/x86/entry/syscall_32.c:83 [inline] __do_fast_syscall_32+0x73/0x120 arch/x86/entry/syscall_32.c:306 do_fast_syscall_32+0x32/0x80 arch/x86/entry/syscall_32.c:331 entry_SYSENTER_compat_after_hwframe+0x84/0x8e -> #2 (&ovl_i_mutex_dir_key[depth]){.+.+}-{4:4}: down_read+0x9b/0x480 kernel/locking/rwsem.c:1524 inode_lock_shared include/linux/fs.h:877 [inline] lookup_slow fs/namei.c:1833 [inline] walk_component+0x345/0x5b0 fs/namei.c:2138 lookup_last fs/namei.c:2636 [inline] path_lookupat+0x17e/0x780 fs/namei.c:2660 filename_lookup+0x224/0x5f0 fs/namei.c:2689 kern_path+0x35/0x50 fs/namei.c:2822 lookup_bdev+0xd8/0x280 block/bdev.c:1205 resume_store+0x1d6/0x460 kernel/power/hibernate.c:1248 kobj_attr_store+0x55/0x80 lib/kobject.c:840 sysfs_kf_write+0xef/0x150 fs/sysfs/file.c:145 kernfs_fop_write_iter+0x351/0x510 fs/kernfs/file.c:334 new_sync_write fs/read_write.c:591 [inline] vfs_write+0x5ba/0x1180 fs/read_write.c:684 ksys_write+0x12a/0x240 fs/read_write.c:736 do_syscall_32_irqs_on arch/x86/entry/syscall_32.c:83 [inline] __do_fast_syscall_32+0x73/0x120 arch/x86/entry/syscall_32.c:306 do_fast_syscall_32+0x32/0x80 arch/x86/entry/syscall_32.c:331 entry_SYSENTER_compat_after_hwframe+0x84/0x8e -> #1 (&of->mutex){+.+.}-{4:4}: __mutex_lock_common kernel/locking/mutex.c:601 [inline] __mutex_lock+0x199/0xb90 kernel/locking/mutex.c:746 kernfs_seq_start+0x4d/0x240 fs/kernfs/file.c:154 traverse.part.0.constprop.0+0xac/0x640 fs/seq_file.c:106 traverse fs/seq_file.c:98 [inline] seq_read_iter+0x932/0x12c0 fs/seq_file.c:195 kernfs_fop_read_iter+0x40f/0x5a0 fs/kernfs/file.c:279 do_iter_readv_writev+0x735/0x950 fs/read_write.c:823 vfs_readv+0x4c5/0x8a0 fs/read_write.c:1016 do_readv+0x132/0x330 fs/read_write.c:1078 do_syscall_32_irqs_on arch/x86/entry/syscall_32.c:83 [inline] __do_fast_syscall_32+0x73/0x120 arch/x86/entry/syscall_32.c:306 do_fast_syscall_32+0x32/0x80 arch/x86/entry/syscall_32.c:331 entry_SYSENTER_compat_after_hwframe+0x84/0x8e -> #0 (&p->lock){+.+.}-{4:4}: check_prev_add kernel/locking/lockdep.c:3166 [inline] check_prevs_add kernel/locking/lockdep.c:3285 [inline] validate_chain kernel/locking/lockdep.c:3909 [inline] __lock_acquire+0x1173/0x1ba0 kernel/locking/lockdep.c:5235 lock_acquire kernel/locking/lockdep.c:5866 [inline] lock_acquire+0x179/0x350 kernel/locking/lockdep.c:5823 __mutex_lock_common kernel/locking/mutex.c:601 [inline] __mutex_lock+0x199/0xb90 kernel/locking/mutex.c:746 seq_read_iter+0xe1/0x12c0 fs/seq_file.c:182 kernfs_fop_read_iter+0x40f/0x5a0 fs/kernfs/file.c:279 copy_splice_read+0x615/0xba0 fs/splice.c:363 do_splice_read fs/splice.c:979 [inline] do_splice_read+0x282/0x370 fs/splice.c:953 splice_file_to_pipe+0x109/0x120 fs/splice.c:1289 do_sendfile+0x400/0xe50 fs/read_write.c:1374 __do_sys_sendfile64 fs/read_write.c:1429 [inline] __se_sys_sendfile64 fs/read_write.c:1415 [inline] __ia32_sys_sendfile64+0x1d7/0x220 fs/read_write.c:1415 do_syscall_32_irqs_on arch/x86/entry/syscall_32.c:83 [inline] __do_fast_syscall_32+0x73/0x120 arch/x86/entry/syscall_32.c:306 do_fast_syscall_32+0x32/0x80 arch/x86/entry/syscall_32.c:331 entry_SYSENTER_compat_after_hwframe+0x84/0x8e other info that might help us debug this: Chain exists of: &p->lock --> sb_writers#5 --> &pipe->mutex Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&pipe->mutex); lock(sb_writers#5); lock(&pipe->mutex); lock(&p->lock); *** DEADLOCK *** 1 lock held by syz.4.3078/17997: #0: ffff88804e915868 (&pipe->mutex){+.+.}-{4:4}, at: pipe_lock fs/pipe.c:92 [inline] #0: ffff88804e915868 (&pipe->mutex){+.+.}-{4:4}, at: pipe_lock+0x64/0x80 fs/pipe.c:89 stack backtrace: CPU: 0 UID: 0 PID: 17997 Comm: syz.4.3078 Not tainted 6.15.0-rc5-syzkaller-00204-g0e1329d4045c #0 PREEMPT(full) 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+0x275/0x350 kernel/locking/lockdep.c:2079 check_noncircular+0x14c/0x170 kernel/locking/lockdep.c:2211 check_prev_add kernel/locking/lockdep.c:3166 [inline] check_prevs_add kernel/locking/lockdep.c:3285 [inline] validate_chain kernel/locking/lockdep.c:3909 [inline] __lock_acquire+0x1173/0x1ba0 kernel/locking/lockdep.c:5235 lock_acquire kernel/locking/lockdep.c:5866 [inline] lock_acquire+0x179/0x350 kernel/locking/lockdep.c:5823 __mutex_lock_common kernel/locking/mutex.c:601 [inline] __mutex_lock+0x199/0xb90 kernel/locking/mutex.c:746 seq_read_iter+0xe1/0x12c0 fs/seq_file.c:182 kernfs_fop_read_iter+0x40f/0x5a0 fs/kernfs/file.c:279 copy_splice_read+0x615/0xba0 fs/splice.c:363 do_splice_read fs/splice.c:979 [inline] do_splice_read+0x282/0x370 fs/splice.c:953 splice_file_to_pipe+0x109/0x120 fs/splice.c:1289 do_sendfile+0x400/0xe50 fs/read_write.c:1374 __do_sys_sendfile64 fs/read_write.c:1429 [inline] __se_sys_sendfile64 fs/read_write.c:1415 [inline] __ia32_sys_sendfile64+0x1d7/0x220 fs/read_write.c:1415 do_syscall_32_irqs_on arch/x86/entry/syscall_32.c:83 [inline] __do_fast_syscall_32+0x73/0x120 arch/x86/entry/syscall_32.c:306 do_fast_syscall_32+0x32/0x80 arch/x86/entry/syscall_32.c:331 entry_SYSENTER_compat_after_hwframe+0x84/0x8e RIP: 0023:0xf702e579 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:00000000f501e55c EFLAGS: 00000296 ORIG_RAX: 00000000000000ef RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 0000000000000005 RDX: 0000000000000000 RSI: 0000000000000008 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 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