====================================================== WARNING: possible circular locking dependency detected 6.16.0-syzkaller-11699-g7e161a991ea7 #0 Not tainted ------------------------------------------------------ syz.4.3057/14218 is trying to acquire lock: ffff888047ff1868 (&pipe->mutex){+.+.}-{4:4}, at: anon_pipe_write+0x15d/0x1a90 fs/pipe.c:458 but task is already holding lock: ffff888026ed4140 (&sbi->pipe_mutex){+.+.}-{4:4}, at: autofs_write fs/autofs/waitq.c:55 [inline] ffff888026ed4140 (&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: -> #3 (&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+0xef/0x150 fs/sysfs/file.c:145 kernfs_fop_write_iter+0x351/0x510 fs/kernfs/file.c:334 iter_file_splice_write+0x91f/0x1150 fs/splice.c:738 do_splice_from fs/splice.c:935 [inline] direct_splice_actor+0x18f/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 -> #2 (&of->mutex){+.+.}-{4:4}: __mutex_lock_common kernel/locking/mutex.c:598 [inline] __mutex_lock+0x193/0x10b0 kernel/locking/mutex.c:760 kernfs_seq_start+0x4d/0x240 fs/kernfs/file.c:154 seq_read_iter+0x2c1/0x12c0 fs/seq_file.c:225 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+0x285/0x370 fs/splice.c:953 splice_direct_to_actor+0x2a1/0xa30 fs/splice.c:1083 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 (&p->lock){+.+.}-{4:4}: __mutex_lock_common kernel/locking/mutex.c:598 [inline] __mutex_lock+0x193/0x10b0 kernel/locking/mutex.c:760 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+0x285/0x370 fs/splice.c:953 splice_file_to_pipe+0x109/0x120 fs/splice.c:1289 do_sendfile+0x400/0xe50 fs/read_write.c:1376 __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 -> #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.4.3057/14218: #0: ffff888026ed4140 (&sbi->pipe_mutex){+.+.}-{4:4}, at: autofs_write fs/autofs/waitq.c:55 [inline] #0: ffff888026ed4140 (&sbi->pipe_mutex){+.+.}-{4:4}, at: autofs_notify_daemon+0x4a6/0xd60 fs/autofs/waitq.c:164 stack backtrace: CPU: 0 UID: 0 PID: 14218 Comm: syz.4.3057 Not tainted 6.16.0-syzkaller-11699-g7e161a991ea7 #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:0x7f416b58ebe9 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:00007f416c471038 EFLAGS: 00000246 ORIG_RAX: 00000000000000a5 RAX: ffffffffffffffda RBX: 00007f416b7b5fa0 RCX: 00007f416b58ebe9 RDX: 0000000000000000 RSI: 0000200000000300 RDI: 0000000000000000 RBP: 00007f416b611e19 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000081000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007f416b7b6038 R14: 00007f416b7b5fa0 R15: 00007ffe47b90628