====================================================== WARNING: possible circular locking dependency detected 6.16.0-rc2-syzkaller-00047-g52da431bf03b #0 Not tainted ------------------------------------------------------ syz.1.7642/4517 is trying to acquire lock: ffff8880267ac6c8 (&ovl_i_mutex_dir_key[depth]){++++}-{4:4}, at: inode_lock_shared include/linux/fs.h:884 [inline] ffff8880267ac6c8 (&ovl_i_mutex_dir_key[depth]){++++}-{4:4}, at: lookup_slow fs/namei.c:1833 [inline] ffff8880267ac6c8 (&ovl_i_mutex_dir_key[depth]){++++}-{4:4}, at: walk_component+0x345/0x5b0 fs/namei.c:2138 but task is already holding lock: ffff88805f93c488 (&of->mutex){+.+.}-{4:4}, at: kernfs_fop_write_iter+0x28f/0x510 fs/kernfs/file.c:325 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #4 (&of->mutex){+.+.}-{4:4}: __mutex_lock_common kernel/locking/mutex.c:602 [inline] __mutex_lock+0x199/0xb90 kernel/locking/mutex.c:747 kernfs_seq_start+0x4d/0x240 fs/kernfs/file.c:154 traverse.part.0.constprop.0+0xaf/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:825 vfs_readv+0x4cb/0x8b0 fs/read_write.c:1018 do_preadv+0x1a6/0x270 fs/read_write.c:1132 do_syscall_32_irqs_on arch/x86/entry/syscall_32.c:83 [inline] __do_fast_syscall_32+0x7c/0x3a0 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 (&p->lock){+.+.}-{4:4}: __mutex_lock_common kernel/locking/mutex.c:602 [inline] __mutex_lock+0x199/0xb90 kernel/locking/mutex.c:747 seq_read_iter+0xe1/0x12c0 fs/seq_file.c:182 kernfs_fop_read_iter+0x40f/0x5a0 fs/kernfs/file.c:279 copy_splice_read+0x618/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:1376 __do_sys_sendfile64 fs/read_write.c:1431 [inline] __se_sys_sendfile64 fs/read_write.c:1417 [inline] __ia32_sys_sendfile64+0x1d7/0x220 fs/read_write.c:1417 do_syscall_32_irqs_on arch/x86/entry/syscall_32.c:83 [inline] __do_fast_syscall_32+0x7c/0x3a0 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 (&pipe->mutex){+.+.}-{4:4}: __mutex_lock_common kernel/locking/mutex.c:602 [inline] __mutex_lock+0x199/0xb90 kernel/locking/mutex.c:747 pipe_lock fs/pipe.c:91 [inline] pipe_lock+0x64/0x80 fs/pipe.c:88 iter_file_splice_write+0x1ea/0x1150 fs/splice.c:683 do_splice_from fs/splice.c:935 [inline] do_splice+0x1478/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+0x7c/0x3a0 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 (sb_writers#5){.+.+}-{0:0}: percpu_down_read_internal include/linux/percpu-rwsem.h:53 [inline] percpu_down_read_freezable include/linux/percpu-rwsem.h:83 [inline] __sb_start_write include/linux/fs.h:1795 [inline] sb_start_write include/linux/fs.h:1931 [inline] mnt_want_write+0x6f/0x450 fs/namespace.c:557 ovl_create_object+0x12c/0x300 fs/overlayfs/dir.c:628 lookup_open.isra.0+0x11d3/0x1580 fs/namei.c:3717 open_last_lookups fs/namei.c:3816 [inline] path_openat+0x893/0x2cb0 fs/namei.c:4052 do_filp_open+0x20b/0x470 fs/namei.c:4082 do_sys_openat2+0x11b/0x1d0 fs/open.c:1437 do_sys_open fs/open.c:1452 [inline] __do_compat_sys_open fs/open.c:1505 [inline] __se_compat_sys_open fs/open.c:1503 [inline] __ia32_compat_sys_open+0x146/0x1e0 fs/open.c:1503 do_syscall_32_irqs_on arch/x86/entry/syscall_32.c:83 [inline] __do_fast_syscall_32+0x7c/0x3a0 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 (&ovl_i_mutex_dir_key[depth]){++++}-{4:4}: check_prev_add kernel/locking/lockdep.c:3168 [inline] check_prevs_add kernel/locking/lockdep.c:3287 [inline] validate_chain kernel/locking/lockdep.c:3911 [inline] __lock_acquire+0x126f/0x1c90 kernel/locking/lockdep.c:5240 lock_acquire kernel/locking/lockdep.c:5871 [inline] lock_acquire+0x179/0x350 kernel/locking/lockdep.c:5828 down_read+0x9b/0x480 kernel/locking/rwsem.c:1524 inode_lock_shared include/linux/fs.h:884 [inline] lookup_slow fs/namei.c:1833 [inline] walk_component+0x345/0x5b0 fs/namei.c:2138 lookup_last fs/namei.c:2639 [inline] path_lookupat+0x142/0x6d0 fs/namei.c:2663 filename_lookup+0x224/0x5f0 fs/namei.c:2692 kern_path+0x35/0x50 fs/namei.c:2825 lookup_bdev+0xd8/0x280 block/bdev.c:1205 resume_store+0x1d6/0x460 kernel/power/hibernate.c:1272 kobj_attr_store+0x55/0x80 lib/kobject.c:840 sysfs_kf_write+0xef/0x150 fs/sysfs/file.c:145 kernfs_fop_write_iter+0x354/0x510 fs/kernfs/file.c:334 new_sync_write fs/read_write.c:593 [inline] vfs_write+0x6c7/0x1150 fs/read_write.c:686 ksys_write+0x12a/0x250 fs/read_write.c:738 do_syscall_32_irqs_on arch/x86/entry/syscall_32.c:83 [inline] __do_fast_syscall_32+0x7c/0x3a0 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: &ovl_i_mutex_dir_key[depth] --> &p->lock --> &of->mutex Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&of->mutex); lock(&p->lock); lock(&of->mutex); rlock(&ovl_i_mutex_dir_key[depth]); *** DEADLOCK *** 4 locks held by syz.1.7642/4517: #0: ffff8880519902b8 (&f->f_pos_lock){+.+.}-{4:4}, at: fdget_pos+0x2a2/0x370 fs/file.c:1217 #1: ffff8880249fa428 (sb_writers#7){.+.+}-{0:0}, at: ksys_write+0x12a/0x250 fs/read_write.c:738 #2: ffff88805f93c488 (&of->mutex){+.+.}-{4:4}, at: kernfs_fop_write_iter+0x28f/0x510 fs/kernfs/file.c:325 #3: ffff88801cb10e18 (kn->active#64){.+.+}-{0:0}, at: kernfs_fop_write_iter+0x2b2/0x510 fs/kernfs/file.c:326 stack backtrace: CPU: 1 UID: 0 PID: 4517 Comm: syz.1.7642 Not tainted 6.16.0-rc2-syzkaller-00047-g52da431bf03b #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:2046 check_noncircular+0x14c/0x170 kernel/locking/lockdep.c:2178 check_prev_add kernel/locking/lockdep.c:3168 [inline] check_prevs_add kernel/locking/lockdep.c:3287 [inline] validate_chain kernel/locking/lockdep.c:3911 [inline] __lock_acquire+0x126f/0x1c90 kernel/locking/lockdep.c:5240 lock_acquire kernel/locking/lockdep.c:5871 [inline] lock_acquire+0x179/0x350 kernel/locking/lockdep.c:5828 down_read+0x9b/0x480 kernel/locking/rwsem.c:1524 inode_lock_shared include/linux/fs.h:884 [inline] lookup_slow fs/namei.c:1833 [inline] walk_component+0x345/0x5b0 fs/namei.c:2138 lookup_last fs/namei.c:2639 [inline] path_lookupat+0x142/0x6d0 fs/namei.c:2663 filename_lookup+0x224/0x5f0 fs/namei.c:2692 kern_path+0x35/0x50 fs/namei.c:2825 lookup_bdev+0xd8/0x280 block/bdev.c:1205 resume_store+0x1d6/0x460 kernel/power/hibernate.c:1272 kobj_attr_store+0x55/0x80 lib/kobject.c:840 sysfs_kf_write+0xef/0x150 fs/sysfs/file.c:145 kernfs_fop_write_iter+0x354/0x510 fs/kernfs/file.c:334 new_sync_write fs/read_write.c:593 [inline] vfs_write+0x6c7/0x1150 fs/read_write.c:686 ksys_write+0x12a/0x250 fs/read_write.c:738 do_syscall_32_irqs_on arch/x86/entry/syscall_32.c:83 [inline] __do_fast_syscall_32+0x7c/0x3a0 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:0xf70be579 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:00000000f4c4955c EFLAGS: 00000296 ORIG_RAX: 0000000000000004 RAX: ffffffffffffffda RBX: 0000000000000009 RCX: 0000000080000040 RDX: 0000000000000012 RSI: 0000000000000000 RDI: 0000000000000000 RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000296 R12: 0000000000000000 R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 PM: Image not found (code -22) ---------------- 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