====================================================== WARNING: possible circular locking dependency detected syzkaller #0 Not tainted ------------------------------------------------------ syz.1.780/8770 is trying to acquire lock: ffff88806bd46948 (&sbi->pipe_mutex){+.+.}-{4:4}, at: autofs_write fs/autofs/waitq.c:55 [inline] ffff88806bd46948 (&sbi->pipe_mutex){+.+.}-{4:4}, at: autofs_notify_daemon+0x4f8/0xd90 fs/autofs/waitq.c:164 but task is already holding lock: ffff8880246c5c88 (&of->mutex){+.+.}-{4:4}, at: kernfs_fop_write_iter+0x2c2/0x5f0 fs/kernfs/file.c:343 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:614 [inline] __mutex_lock+0x1a2/0x1b90 kernel/locking/mutex.c:776 kernfs_seq_start+0x4f/0x2a0 fs/kernfs/file.c:172 seq_read_iter+0x2c1/0x1270 fs/seq_file.c:226 kernfs_fop_read_iter+0x46c/0x610 fs/kernfs/file.c:297 copy_splice_read+0x4ba/0xb90 fs/splice.c:362 do_splice_read fs/splice.c:980 [inline] do_splice_read+0x285/0x370 fs/splice.c:954 splice_direct_to_actor+0x2a1/0xa30 fs/splice.c:1084 do_splice_direct_actor fs/splice.c:1202 [inline] do_splice_direct+0x174/0x240 fs/splice.c:1228 do_sendfile+0xadc/0xe20 fs/read_write.c:1372 __do_compat_sys_sendfile fs/read_write.c:1454 [inline] __se_compat_sys_sendfile fs/read_write.c:1437 [inline] __ia32_compat_sys_sendfile+0x1e5/0x220 fs/read_write.c:1437 do_syscall_32_irqs_on arch/x86/entry/syscall_32.c:83 [inline] __do_fast_syscall_32+0xe3/0x8c0 arch/x86/entry/syscall_32.c:307 do_fast_syscall_32+0x32/0x70 arch/x86/entry/syscall_32.c:332 entry_SYSENTER_compat_after_hwframe+0x84/0x8e -> #2 (&p->lock){+.+.}-{4:4}: __mutex_lock_common kernel/locking/mutex.c:614 [inline] __mutex_lock+0x1a2/0x1b90 kernel/locking/mutex.c:776 seq_read_iter+0xe1/0x1270 fs/seq_file.c:183 kernfs_fop_read_iter+0x46c/0x610 fs/kernfs/file.c:297 copy_splice_read+0x4ba/0xb90 fs/splice.c:362 do_splice_read fs/splice.c:980 [inline] do_splice_read+0x285/0x370 fs/splice.c:954 splice_file_to_pipe+0x82/0x120 fs/splice.c:1290 do_sendfile+0x366/0xe20 fs/read_write.c:1378 __do_compat_sys_sendfile fs/read_write.c:1454 [inline] __se_compat_sys_sendfile fs/read_write.c:1437 [inline] __ia32_compat_sys_sendfile+0x1e5/0x220 fs/read_write.c:1437 do_syscall_32_irqs_on arch/x86/entry/syscall_32.c:83 [inline] __do_fast_syscall_32+0xe3/0x8c0 arch/x86/entry/syscall_32.c:307 do_fast_syscall_32+0x32/0x70 arch/x86/entry/syscall_32.c:332 entry_SYSENTER_compat_after_hwframe+0x84/0x8e -> #1 (&pipe->mutex){+.+.}-{4:4}: __mutex_lock_common kernel/locking/mutex.c:614 [inline] __mutex_lock+0x1a2/0x1b90 kernel/locking/mutex.c:776 anon_pipe_write+0x163/0x1d40 fs/pipe.c:458 __kernel_write_iter+0x6b2/0x920 fs/read_write.c:621 __kernel_write+0xf6/0x140 fs/read_write.c:641 autofs_write fs/autofs/waitq.c:57 [inline] autofs_notify_daemon+0x50d/0xd90 fs/autofs/waitq.c:164 autofs_wait+0x10fd/0x1b50 fs/autofs/waitq.c:426 autofs_mount_wait+0x132/0x3b0 fs/autofs/root.c:255 autofs_d_automount+0x490/0x950 fs/autofs/root.c:409 follow_automount fs/namei.c:1560 [inline] __traverse_mounts+0x1b9/0x8a0 fs/namei.c:1613 traverse_mounts fs/namei.c:1642 [inline] handle_mounts fs/namei.c:1744 [inline] step_into_slowpath+0xb7e/0xf90 fs/namei.c:2101 step_into fs/namei.c:2149 [inline] walk_component fs/namei.c:2285 [inline] lookup_last fs/namei.c:2780 [inline] path_lookupat+0x58b/0xc40 fs/namei.c:2804 filename_lookup+0x202/0x590 fs/namei.c:2833 vfs_statx+0xff/0x3f0 fs/stat.c:353 vfs_fstatat fs/stat.c:373 [inline] vfs_lstat include/linux/fs.h:3200 [inline] __do_compat_sys_newlstat+0xaa/0x130 fs/stat.c:871 do_syscall_32_irqs_on arch/x86/entry/syscall_32.c:83 [inline] __do_fast_syscall_32+0xe3/0x8c0 arch/x86/entry/syscall_32.c:307 do_fast_syscall_32+0x32/0x70 arch/x86/entry/syscall_32.c:332 entry_SYSENTER_compat_after_hwframe+0x84/0x8e -> #0 (&sbi->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+0x14b8/0x2630 kernel/locking/lockdep.c:5237 lock_acquire kernel/locking/lockdep.c:5868 [inline] lock_acquire+0x1cf/0x380 kernel/locking/lockdep.c:5825 __mutex_lock_common kernel/locking/mutex.c:614 [inline] __mutex_lock+0x1a2/0x1b90 kernel/locking/mutex.c:776 autofs_write fs/autofs/waitq.c:55 [inline] autofs_notify_daemon+0x4f8/0xd90 fs/autofs/waitq.c:164 autofs_wait+0x10fd/0x1b50 fs/autofs/waitq.c:426 autofs_mount_wait+0x132/0x3b0 fs/autofs/root.c:255 autofs_d_automount+0x490/0x950 fs/autofs/root.c:409 follow_automount fs/namei.c:1560 [inline] __traverse_mounts+0x1b9/0x8a0 fs/namei.c:1613 traverse_mounts fs/namei.c:1642 [inline] handle_mounts fs/namei.c:1744 [inline] step_into_slowpath+0xb7e/0xf90 fs/namei.c:2101 step_into fs/namei.c:2149 [inline] walk_component fs/namei.c:2285 [inline] lookup_last fs/namei.c:2780 [inline] path_lookupat+0x58b/0xc40 fs/namei.c:2804 filename_lookup+0x202/0x590 fs/namei.c:2833 kern_path+0x37/0x50 fs/namei.c:3040 lookup_bdev+0xd8/0x280 block/bdev.c:1221 resume_store+0x1d6/0x460 kernel/power/hibernate.c:1306 kobj_attr_store+0x58/0x80 lib/kobject.c:840 sysfs_kf_write+0xf2/0x150 fs/sysfs/file.c:142 kernfs_fop_write_iter+0x3e0/0x5f0 fs/kernfs/file.c:352 new_sync_write fs/read_write.c:595 [inline] vfs_write+0x6ac/0x1070 fs/read_write.c:688 ksys_write+0x12a/0x250 fs/read_write.c:740 do_syscall_32_irqs_on arch/x86/entry/syscall_32.c:83 [inline] __do_fast_syscall_32+0xe3/0x8c0 arch/x86/entry/syscall_32.c:307 do_fast_syscall_32+0x32/0x70 arch/x86/entry/syscall_32.c:332 entry_SYSENTER_compat_after_hwframe+0x84/0x8e other info that might help us debug this: Chain exists of: &sbi->pipe_mutex --> &p->lock --> &of->mutex Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&of->mutex); lock(&p->lock ); lock( &of->mutex); lock(&sbi->pipe_mutex); *** DEADLOCK *** 4 locks held by syz.1.780/8770: #0: ffff88802aaf9eb8 (&f->f_pos_lock ){+.+.}-{4:4}, at: fdget_pos+0x2aa/0x380 fs/file.c:1261 #1: ffff8880233ba420 (sb_writers#7){.+.+}-{0:0}, at: ksys_write+0x12a/0x250 fs/read_write.c:740 #2: ffff8880246c5c88 (&of->mutex){+.+.}-{4:4}, at: kernfs_fop_write_iter+0x2c2/0x5f0 fs/kernfs/file.c:343 #3: ffff88801cb77788 (kn->active#77){.+.+}-{0:0} , at: kernfs_get_active_of fs/kernfs/file.c:80 [inline] , at: kernfs_fop_write_iter+0x332/0x5f0 fs/kernfs/file.c:344 stack backtrace: CPU: 3 UID: 0 PID: 8770 Comm: syz.1.780 Not tainted syzkaller #0 PREEMPT(full) Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014 Call Trace: __dump_stack lib/dump_stack.c:94 [inline] dump_stack_lvl+0x100/0x190 lib/dump_stack.c:120 print_circular_bug.cold+0x178/0x1c7 kernel/locking/lockdep.c:2043 check_noncircular+0x146/0x160 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+0x14b8/0x2630 kernel/locking/lockdep.c:5237 lock_acquire kernel/locking/lockdep.c:5868 [inline] lock_acquire+0x1cf/0x380 kernel/locking/lockdep.c:5825 __mutex_lock_common kernel/locking/mutex.c:614 [inline] __mutex_lock+0x1a2/0x1b90 kernel/locking/mutex.c:776 autofs_write fs/autofs/waitq.c:55 [inline] autofs_notify_daemon+0x4f8/0xd90 fs/autofs/waitq.c:164 autofs_wait+0x10fd/0x1b50 fs/autofs/waitq.c:426 autofs_mount_wait+0x132/0x3b0 fs/autofs/root.c:255 autofs_d_automount+0x490/0x950 fs/autofs/root.c:409 follow_automount fs/namei.c:1560 [inline] __traverse_mounts+0x1b9/0x8a0 fs/namei.c:1613 traverse_mounts fs/namei.c:1642 [inline] handle_mounts fs/namei.c:1744 [inline] step_into_slowpath+0xb7e/0xf90 fs/namei.c:2101 step_into fs/namei.c:2149 [inline] walk_component fs/namei.c:2285 [inline] lookup_last fs/namei.c:2780 [inline] path_lookupat+0x58b/0xc40 fs/namei.c:2804 filename_lookup+0x202/0x590 fs/namei.c:2833 kern_path+0x37/0x50 fs/namei.c:3040 lookup_bdev+0xd8/0x280 block/bdev.c:1221 resume_store+0x1d6/0x460 kernel/power/hibernate.c:1306 kobj_attr_store+0x58/0x80 lib/kobject.c:840 sysfs_kf_write+0xf2/0x150 fs/sysfs/file.c:142 kernfs_fop_write_iter+0x3e0/0x5f0 fs/kernfs/file.c:352 new_sync_write fs/read_write.c:595 [inline] vfs_write+0x6ac/0x1070 fs/read_write.c:688 ksys_write+0x12a/0x250 fs/read_write.c:740 do_syscall_32_irqs_on arch/x86/entry/syscall_32.c:83 [inline] __do_fast_syscall_32+0xe3/0x8c0 arch/x86/entry/syscall_32.c:307 do_fast_syscall_32+0x32/0x70 arch/x86/entry/syscall_32.c:332 entry_SYSENTER_compat_after_hwframe+0x84/0x8e RIP: 0023:0xf70bef6c Code: d2 74 05 c1 e8 0c 89 02 8b 5d fc 31 c0 c9 c3 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 0f 1f 00 51 52 55 89 e5 0f 34 cd 80 <5d> 5a 59 c3 90 2e 8d b4 26 00 00 00 00 8d b4 26 00 00 00 00 58 b8 RSP: 002b:00000000f548c50c EFLAGS: 00000292 ORIG_RAX: 0000000000000004 RAX: ffffffffffffffda RBX: 0000000000000005 RCX: 0000000080000040 RDX: 0000000000000012 RSI: 0000000000000000 RDI: 0000000000000000 RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000292 R12: 0000000000000000 R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 block device autoloading is deprecated and will be removed. PM: Image not found (code -22) ---------------- Code disassembly (best guess): 0: d2 74 05 c1 shlb %cl,-0x3f(%rbp,%rax,1) 4: e8 0c 89 02 8b call 0x8b028915 9: 5d pop %rbp a: fc cld b: 31 c0 xor %eax,%eax d: c9 leave e: c3 ret f: 90 nop 10: 90 nop 11: 90 nop 12: 90 nop 13: 90 nop 14: 90 nop 15: 90 nop 16: 90 nop 17: 90 nop 18: 90 nop 19: 90 nop 1a: 90 nop 1b: 90 nop 1c: 90 nop 1d: 90 nop 1e: 0f 1f 00 nopl (%rax) 21: 51 push %rcx 22: 52 push %rdx 23: 55 push %rbp 24: 89 e5 mov %esp,%ebp 26: 0f 34 sysenter 28: cd 80 int $0x80 * 2a: 5d pop %rbp <-- trapping instruction 2b: 5a pop %rdx 2c: 59 pop %rcx 2d: c3 ret 2e: 90 nop 2f: 2e 8d b4 26 00 00 00 cs lea 0x0(%rsi,%riz,1),%esi 36: 00 37: 8d b4 26 00 00 00 00 lea 0x0(%rsi,%riz,1),%esi 3e: 58 pop %rax 3f: b8 .byte 0xb8