====================================================== WARNING: possible circular locking dependency detected 6.16.0-syzkaller-11322-g352af6a011d5 #0 Not tainted ------------------------------------------------------ syz.1.4259/17844 is trying to acquire lock: ffff888032000068 (&pipe->mutex){+.+.}-{4:4}, at: anon_pipe_write+0x15d/0x1a90 fs/pipe.c:458 but task is already holding lock: ffff88802ad99140 (&sbi->pipe_mutex){+.+.}-{4:4}, at: autofs_write fs/autofs/waitq.c:55 [inline] ffff88802ad99140 (&sbi->pipe_mutex){+.+.}-{4:4}, at: autofs_notify_daemon+0x4a6/0xd60 fs/autofs/waitq.c:164 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #2 (&sbi->pipe_mutex){+.+.}-{4:4}: __mutex_lock_common kernel/locking/mutex.c:598 [inline] __mutex_lock+0x193/0x10b0 kernel/locking/mutex.c:760 autofs_write fs/autofs/waitq.c:55 [inline] autofs_notify_daemon+0x4a6/0xd60 fs/autofs/waitq.c:164 autofs_wait+0x10ca/0x1a70 fs/autofs/waitq.c:426 autofs_mount_wait+0x132/0x380 fs/autofs/root.c:255 autofs_d_automount+0x390/0x7f0 fs/autofs/root.c:401 follow_automount fs/namei.c:1455 [inline] __traverse_mounts+0x192/0x790 fs/namei.c:1500 traverse_mounts fs/namei.c:1529 [inline] handle_mounts fs/namei.c:1632 [inline] step_into+0x5aa/0x2270 fs/namei.c:1967 walk_component+0xfc/0x5b0 fs/namei.c:2135 lookup_last fs/namei.c:2630 [inline] path_lookupat+0x142/0x6d0 fs/namei.c:2654 filename_lookup+0x224/0x5f0 fs/namei.c:2683 kern_path+0x35/0x50 fs/namei.c:2816 lookup_bdev+0xd8/0x280 block/bdev.c:1205 resume_store+0x1d6/0x460 kernel/power/hibernate.c:1295 kobj_attr_store+0x55/0x80 lib/kobject.c:840 sysfs_kf_write+0xf2/0x150 fs/sysfs/file.c:145 kernfs_fop_write_iter+0x354/0x510 fs/kernfs/file.c:334 iter_file_splice_write+0x91c/0x1150 fs/splice.c:738 do_splice_from fs/splice.c:935 [inline] direct_splice_actor+0x192/0x6c0 fs/splice.c:1158 splice_direct_to_actor+0x342/0xa30 fs/splice.c:1102 do_splice_direct_actor fs/splice.c:1201 [inline] do_splice_direct+0x174/0x240 fs/splice.c:1227 do_sendfile+0xb06/0xe50 fs/read_write.c:1370 __do_sys_sendfile64 fs/read_write.c:1431 [inline] __se_sys_sendfile64 fs/read_write.c:1417 [inline] __x64_sys_sendfile64+0x1d8/0x220 fs/read_write.c:1417 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xcd/0x4c0 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f -> #1 (&of->mutex){+.+.}-{4:4}: __mutex_lock_common kernel/locking/mutex.c:598 [inline] __mutex_lock+0x193/0x10b0 kernel/locking/mutex.c:760 kernfs_fop_write_iter+0x28f/0x510 fs/kernfs/file.c:325 iter_file_splice_write+0x91c/0x1150 fs/splice.c:738 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] __x64_sys_splice+0x187/0x250 fs/splice.c:1615 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xcd/0x4c0 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f -> #0 (&pipe->mutex){+.+.}-{4:4}: check_prev_add kernel/locking/lockdep.c:3165 [inline] check_prevs_add kernel/locking/lockdep.c:3284 [inline] validate_chain kernel/locking/lockdep.c:3908 [inline] __lock_acquire+0x12a6/0x1ce0 kernel/locking/lockdep.c:5237 lock_acquire kernel/locking/lockdep.c:5868 [inline] lock_acquire+0x179/0x350 kernel/locking/lockdep.c:5825 __mutex_lock_common kernel/locking/mutex.c:598 [inline] __mutex_lock+0x193/0x10b0 kernel/locking/mutex.c:760 anon_pipe_write+0x15d/0x1a90 fs/pipe.c:458 __kernel_write_iter+0x71d/0xa90 fs/read_write.c:619 __kernel_write+0xf5/0x140 fs/read_write.c:639 autofs_write fs/autofs/waitq.c:57 [inline] autofs_notify_daemon+0x4db/0xd60 fs/autofs/waitq.c:164 autofs_wait+0x10ca/0x1a70 fs/autofs/waitq.c:426 autofs_mount_wait+0x132/0x380 fs/autofs/root.c:255 autofs_d_automount+0x390/0x7f0 fs/autofs/root.c:401 follow_automount fs/namei.c:1455 [inline] __traverse_mounts+0x192/0x790 fs/namei.c:1500 traverse_mounts fs/namei.c:1529 [inline] handle_mounts fs/namei.c:1632 [inline] step_into+0x5aa/0x2270 fs/namei.c:1967 walk_component+0xfc/0x5b0 fs/namei.c:2135 lookup_last fs/namei.c:2630 [inline] path_lookupat+0x142/0x6d0 fs/namei.c:2654 filename_lookup+0x224/0x5f0 fs/namei.c:2683 user_path_at+0x3a/0x60 fs/namei.c:3127 do_mount fs/namespace.c:4130 [inline] __do_sys_mount fs/namespace.c:4344 [inline] __se_sys_mount fs/namespace.c:4321 [inline] __x64_sys_mount+0x1fc/0x310 fs/namespace.c:4321 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xcd/0x4c0 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f other info that might help us debug this: Chain exists of: &pipe->mutex --> &of->mutex --> &sbi->pipe_mutex Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&sbi->pipe_mutex); lock(&of->mutex); lock(&sbi->pipe_mutex); lock(&pipe->mutex); *** DEADLOCK *** 1 lock held by syz.1.4259/17844: #0: ffff88802ad99140 (&sbi->pipe_mutex){+.+.}-{4:4}, at: autofs_write fs/autofs/waitq.c:55 [inline] #0: ffff88802ad99140 (&sbi->pipe_mutex){+.+.}-{4:4}, at: autofs_notify_daemon+0x4a6/0xd60 fs/autofs/waitq.c:164 stack backtrace: CPU: 3 UID: 0 PID: 17844 Comm: syz.1.4259 Not tainted 6.16.0-syzkaller-11322-g352af6a011d5 #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:2043 check_noncircular+0x14c/0x170 kernel/locking/lockdep.c:2175 check_prev_add kernel/locking/lockdep.c:3165 [inline] check_prevs_add kernel/locking/lockdep.c:3284 [inline] validate_chain kernel/locking/lockdep.c:3908 [inline] __lock_acquire+0x12a6/0x1ce0 kernel/locking/lockdep.c:5237 lock_acquire kernel/locking/lockdep.c:5868 [inline] lock_acquire+0x179/0x350 kernel/locking/lockdep.c:5825 __mutex_lock_common kernel/locking/mutex.c:598 [inline] __mutex_lock+0x193/0x10b0 kernel/locking/mutex.c:760 anon_pipe_write+0x15d/0x1a90 fs/pipe.c:458 __kernel_write_iter+0x71d/0xa90 fs/read_write.c:619 __kernel_write+0xf5/0x140 fs/read_write.c:639 autofs_write fs/autofs/waitq.c:57 [inline] autofs_notify_daemon+0x4db/0xd60 fs/autofs/waitq.c:164 autofs_wait+0x10ca/0x1a70 fs/autofs/waitq.c:426 autofs_mount_wait+0x132/0x380 fs/autofs/root.c:255 autofs_d_automount+0x390/0x7f0 fs/autofs/root.c:401 follow_automount fs/namei.c:1455 [inline] __traverse_mounts+0x192/0x790 fs/namei.c:1500 traverse_mounts fs/namei.c:1529 [inline] handle_mounts fs/namei.c:1632 [inline] step_into+0x5aa/0x2270 fs/namei.c:1967 walk_component+0xfc/0x5b0 fs/namei.c:2135 lookup_last fs/namei.c:2630 [inline] path_lookupat+0x142/0x6d0 fs/namei.c:2654 filename_lookup+0x224/0x5f0 fs/namei.c:2683 user_path_at+0x3a/0x60 fs/namei.c:3127 do_mount fs/namespace.c:4130 [inline] __do_sys_mount fs/namespace.c:4344 [inline] __se_sys_mount fs/namespace.c:4321 [inline] __x64_sys_mount+0x1fc/0x310 fs/namespace.c:4321 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xcd/0x4c0 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7fb0c258eb69 Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 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 a8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007fb0c34c2038 EFLAGS: 00000246 ORIG_RAX: 00000000000000a5 RAX: ffffffffffffffda RBX: 00007fb0c27b6080 RCX: 00007fb0c258eb69 RDX: 0000000000000000 RSI: 00002000000000c0 RDI: 0000000000000000 RBP: 00007fb0c2611df1 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 00007fb0c27b6080 R15: 00007ffe482e69f8