====================================================== WARNING: possible circular locking dependency detected 6.10.0-next-20240725-syzkaller #0 Not tainted ------------------------------------------------------ syz.3.1712/12792 is trying to acquire lock: ffff88807e8acc88 (&of->mutex){+.+.}-{3:3}, at: kernfs_fop_write_iter+0x1eb/0x500 fs/kernfs/file.c:325 but task is already holding lock: ffff88806e72ec68 (&pipe->mutex){+.+.}-{3:3}, at: iter_file_splice_write+0x335/0x14e0 fs/splice.c:687 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #2 (&pipe->mutex){+.+.}-{3:3}: lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5822 __mutex_lock_common kernel/locking/mutex.c:608 [inline] __mutex_lock+0x136/0xd70 kernel/locking/mutex.c:752 pipe_write+0x1c9/0x1a40 fs/pipe.c:455 __kernel_write_iter+0x47e/0x900 fs/read_write.c:523 __kernel_write+0x120/0x180 fs/read_write.c:543 autofs_write fs/autofs/waitq.c:57 [inline] autofs_notify_daemon+0x732/0xf80 fs/autofs/waitq.c:164 autofs_wait+0x10b8/0x1b30 fs/autofs/waitq.c:426 autofs_mount_wait+0x170/0x330 fs/autofs/root.c:255 autofs_d_automount+0x555/0x710 fs/autofs/root.c:401 follow_automount fs/namei.c:1394 [inline] __traverse_mounts+0x2ba/0x580 fs/namei.c:1439 traverse_mounts fs/namei.c:1468 [inline] handle_mounts fs/namei.c:1571 [inline] step_into+0x5e5/0x1080 fs/namei.c:1877 lookup_last fs/namei.c:2542 [inline] path_lookupat+0x16f/0x450 fs/namei.c:2566 filename_lookup+0x256/0x610 fs/namei.c:2595 user_path_at+0x3a/0x60 fs/namei.c:3002 path_listxattr fs/xattr.c:871 [inline] __do_sys_listxattr fs/xattr.c:886 [inline] __se_sys_listxattr fs/xattr.c:883 [inline] __x64_sys_listxattr+0x109/0x230 fs/xattr.c:883 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f -> #1 (&sbi->pipe_mutex){+.+.}-{3:3}: lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5822 __mutex_lock_common kernel/locking/mutex.c:608 [inline] __mutex_lock+0x136/0xd70 kernel/locking/mutex.c:752 autofs_write fs/autofs/waitq.c:55 [inline] autofs_notify_daemon+0x71f/0xf80 fs/autofs/waitq.c:164 autofs_wait+0x10b8/0x1b30 fs/autofs/waitq.c:426 autofs_mount_wait+0x170/0x330 fs/autofs/root.c:255 autofs_d_automount+0x555/0x710 fs/autofs/root.c:401 follow_automount fs/namei.c:1394 [inline] __traverse_mounts+0x2ba/0x580 fs/namei.c:1439 traverse_mounts fs/namei.c:1468 [inline] handle_mounts fs/namei.c:1571 [inline] step_into+0x5e5/0x1080 fs/namei.c:1877 lookup_last fs/namei.c:2542 [inline] path_lookupat+0x16f/0x450 fs/namei.c:2566 filename_lookup+0x256/0x610 fs/namei.c:2595 kern_path+0x35/0x50 fs/namei.c:2703 lookup_bdev+0xc5/0x290 block/bdev.c:1157 resume_store+0x1a0/0x710 kernel/power/hibernate.c:1235 kernfs_fop_write_iter+0x3a1/0x500 fs/kernfs/file.c:334 iter_file_splice_write+0xbd7/0x14e0 fs/splice.c:743 do_splice_from fs/splice.c:941 [inline] direct_splice_actor+0x11e/0x220 fs/splice.c:1164 splice_direct_to_actor+0x58e/0xc90 fs/splice.c:1108 do_splice_direct_actor fs/splice.c:1207 [inline] do_splice_direct+0x28c/0x3e0 fs/splice.c:1233 do_sendfile+0x56d/0xe20 fs/read_write.c:1295 __do_sys_sendfile64 fs/read_write.c:1362 [inline] __se_sys_sendfile64+0x17c/0x1e0 fs/read_write.c:1348 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f -> #0 (&of->mutex){+.+.}-{3:3}: check_prev_add kernel/locking/lockdep.c:3158 [inline] check_prevs_add kernel/locking/lockdep.c:3277 [inline] validate_chain+0x18ef/0x5920 kernel/locking/lockdep.c:3901 __lock_acquire+0x1384/0x2050 kernel/locking/lockdep.c:5199 lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5822 __mutex_lock_common kernel/locking/mutex.c:608 [inline] __mutex_lock+0x136/0xd70 kernel/locking/mutex.c:752 kernfs_fop_write_iter+0x1eb/0x500 fs/kernfs/file.c:325 iter_file_splice_write+0xbd7/0x14e0 fs/splice.c:743 do_splice_from fs/splice.c:941 [inline] do_splice+0xd77/0x1900 fs/splice.c:1354 __do_splice fs/splice.c:1436 [inline] __do_sys_splice fs/splice.c:1652 [inline] __se_sys_splice+0x331/0x4a0 fs/splice.c:1634 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f other info that might help us debug this: Chain exists of: &of->mutex --> &sbi->pipe_mutex --> &pipe->mutex Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&pipe->mutex); lock(&sbi->pipe_mutex); lock(&pipe->mutex); lock(&of->mutex); *** DEADLOCK *** 2 locks held by syz.3.1712/12792: #0: ffff88807ccac420 (sb_writers#8){.+.+}-{0:0}, at: do_splice+0xcf0/0x1900 fs/splice.c:1353 #1: ffff88806e72ec68 (&pipe->mutex){+.+.}-{3:3}, at: iter_file_splice_write+0x335/0x14e0 fs/splice.c:687 stack backtrace: CPU: 1 UID: 0 PID: 12792 Comm: syz.3.1712 Not tainted 6.10.0-next-20240725-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 06/27/2024 Call Trace: __dump_stack lib/dump_stack.c:94 [inline] dump_stack_lvl+0x241/0x360 lib/dump_stack.c:120 print_circular_bug+0x13a/0x1b0 kernel/locking/lockdep.c:2074 check_noncircular+0x36a/0x4a0 kernel/locking/lockdep.c:2203 check_prev_add kernel/locking/lockdep.c:3158 [inline] check_prevs_add kernel/locking/lockdep.c:3277 [inline] validate_chain+0x18ef/0x5920 kernel/locking/lockdep.c:3901 __lock_acquire+0x1384/0x2050 kernel/locking/lockdep.c:5199 lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5822 __mutex_lock_common kernel/locking/mutex.c:608 [inline] __mutex_lock+0x136/0xd70 kernel/locking/mutex.c:752 kernfs_fop_write_iter+0x1eb/0x500 fs/kernfs/file.c:325 iter_file_splice_write+0xbd7/0x14e0 fs/splice.c:743 do_splice_from fs/splice.c:941 [inline] do_splice+0xd77/0x1900 fs/splice.c:1354 __do_splice fs/splice.c:1436 [inline] __do_sys_splice fs/splice.c:1652 [inline] __se_sys_splice+0x331/0x4a0 fs/splice.c:1634 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7efd44d75f19 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:00007efd45b01048 EFLAGS: 00000246 ORIG_RAX: 0000000000000113 RAX: ffffffffffffffda RBX: 00007efd44f06110 RCX: 00007efd44d75f19 RDX: 000000000000000e RSI: 0000000000000000 RDI: 000000000000000c RBP: 00007efd44de4e68 R08: 000000000000bfd1 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 000000000000006e R14: 00007efd44f06110 R15: 00007fffa2597758