====================================================== WARNING: possible circular locking dependency detected 6.5.0-rc7-syzkaller-00093-gf8d6ff449094 #0 Not tainted ------------------------------------------------------ syz-executor.1/24410 is trying to acquire lock: ffff888050211e80 (&ovl_i_mutex_dir_key[depth]){++++}-{3:3}, at: inode_lock_shared include/linux/fs.h:781 [inline] ffff888050211e80 (&ovl_i_mutex_dir_key[depth]){++++}-{3:3}, at: lookup_slow fs/namei.c:1706 [inline] ffff888050211e80 (&ovl_i_mutex_dir_key[depth]){++++}-{3:3}, at: walk_component+0x33b/0x5a0 fs/namei.c:1998 but task is already holding lock: ffff88802bc24088 (&of->mutex){+.+.}-{3:3}, at: kernfs_fop_write_iter+0x281/0x610 fs/kernfs/file.c:325 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #3 (&of->mutex){+.+.}-{3:3}: __mutex_lock_common kernel/locking/mutex.c:603 [inline] __mutex_lock+0x181/0x1340 kernel/locking/mutex.c:747 kernfs_seq_start+0x4b/0x460 fs/kernfs/file.c:154 seq_read_iter+0x2ad/0x1280 fs/seq_file.c:225 kernfs_fop_read_iter+0x4c8/0x680 fs/kernfs/file.c:279 call_read_iter include/linux/fs.h:1871 [inline] new_sync_read fs/read_write.c:389 [inline] vfs_read+0x4e0/0x930 fs/read_write.c:470 ksys_read+0x12f/0x250 fs/read_write.c:613 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x38/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd -> #2 (&p->lock){+.+.}-{3:3}: __mutex_lock_common kernel/locking/mutex.c:603 [inline] __mutex_lock+0x181/0x1340 kernel/locking/mutex.c:747 seq_read_iter+0xda/0x1280 fs/seq_file.c:182 call_read_iter include/linux/fs.h:1871 [inline] copy_splice_read+0x418/0x8f0 fs/splice.c:367 vfs_splice_read fs/splice.c:996 [inline] vfs_splice_read+0x2c8/0x3b0 fs/splice.c:965 splice_direct_to_actor+0x2a5/0xa30 fs/splice.c:1072 do_splice_direct+0x1af/0x280 fs/splice.c:1197 do_sendfile+0xb88/0x1390 fs/read_write.c:1254 __do_compat_sys_sendfile fs/read_write.c:1343 [inline] __se_compat_sys_sendfile fs/read_write.c:1326 [inline] __ia32_compat_sys_sendfile+0x1e3/0x220 fs/read_write.c:1326 do_syscall_32_irqs_on arch/x86/entry/common.c:112 [inline] __do_fast_syscall_32+0x61/0xe0 arch/x86/entry/common.c:178 do_fast_syscall_32+0x33/0x70 arch/x86/entry/common.c:203 entry_SYSENTER_compat_after_hwframe+0x70/0x82 -> #1 (sb_writers#4){.+.+}-{0:0}: percpu_down_read include/linux/percpu-rwsem.h:51 [inline] __sb_start_write include/linux/fs.h:1494 [inline] sb_start_write include/linux/fs.h:1569 [inline] mnt_want_write+0x6f/0x440 fs/namespace.c:403 ovl_create_object+0x9e/0x2a0 fs/overlayfs/dir.c:629 lookup_open.isra.0+0x1049/0x1360 fs/namei.c:3492 open_last_lookups fs/namei.c:3560 [inline] path_openat+0x931/0x29c0 fs/namei.c:3790 do_filp_open+0x1de/0x430 fs/namei.c:3820 do_sys_openat2+0x176/0x1e0 fs/open.c:1407 do_sys_open fs/open.c:1422 [inline] __do_compat_sys_openat fs/open.c:1482 [inline] __se_compat_sys_openat fs/open.c:1480 [inline] __ia32_compat_sys_openat+0x16e/0x200 fs/open.c:1480 do_syscall_32_irqs_on arch/x86/entry/common.c:112 [inline] __do_fast_syscall_32+0x61/0xe0 arch/x86/entry/common.c:178 do_fast_syscall_32+0x33/0x70 arch/x86/entry/common.c:203 entry_SYSENTER_compat_after_hwframe+0x70/0x82 -> #0 (&ovl_i_mutex_dir_key[depth]){++++}-{3:3}: check_prev_add kernel/locking/lockdep.c:3142 [inline] check_prevs_add kernel/locking/lockdep.c:3261 [inline] validate_chain kernel/locking/lockdep.c:3876 [inline] __lock_acquire+0x2e3d/0x5de0 kernel/locking/lockdep.c:5144 lock_acquire kernel/locking/lockdep.c:5761 [inline] lock_acquire+0x1ae/0x510 kernel/locking/lockdep.c:5726 down_read+0x9c/0x470 kernel/locking/rwsem.c:1520 inode_lock_shared include/linux/fs.h:781 [inline] lookup_slow fs/namei.c:1706 [inline] walk_component+0x33b/0x5a0 fs/namei.c:1998 lookup_last fs/namei.c:2455 [inline] path_lookupat+0x17f/0x770 fs/namei.c:2479 filename_lookup+0x1e7/0x5b0 fs/namei.c:2508 kern_path+0x35/0x50 fs/namei.c:2606 lookup_bdev+0xd9/0x280 block/bdev.c:943 resume_store+0x1d4/0x460 kernel/power/hibernate.c:1177 kobj_attr_store+0x55/0x80 lib/kobject.c:833 sysfs_kf_write+0x117/0x170 fs/sysfs/file.c:136 kernfs_fop_write_iter+0x3ff/0x610 fs/kernfs/file.c:334 call_write_iter include/linux/fs.h:1877 [inline] do_iter_readv_writev+0x21e/0x3c0 fs/read_write.c:735 do_iter_write+0x17f/0x830 fs/read_write.c:860 vfs_iter_write+0x7a/0xb0 fs/read_write.c:901 iter_file_splice_write+0x698/0xbf0 fs/splice.c:739 do_splice_from fs/splice.c:936 [inline] direct_splice_actor+0x118/0x180 fs/splice.c:1145 splice_direct_to_actor+0x347/0xa30 fs/splice.c:1091 do_splice_direct+0x1af/0x280 fs/splice.c:1197 do_sendfile+0xb88/0x1390 fs/read_write.c:1254 __do_compat_sys_sendfile fs/read_write.c:1343 [inline] __se_compat_sys_sendfile fs/read_write.c:1326 [inline] __ia32_compat_sys_sendfile+0x1e3/0x220 fs/read_write.c:1326 do_syscall_32_irqs_on arch/x86/entry/common.c:112 [inline] __do_fast_syscall_32+0x61/0xe0 arch/x86/entry/common.c:178 do_fast_syscall_32+0x33/0x70 arch/x86/entry/common.c:203 entry_SYSENTER_compat_after_hwframe+0x70/0x82 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 *** 3 locks held by syz-executor.1/24410: #0: ffff8880260ee410 (sb_writers#8){.+.+}-{0:0}, at: __do_compat_sys_sendfile fs/read_write.c:1343 [inline] #0: ffff8880260ee410 (sb_writers#8){.+.+}-{0:0}, at: __se_compat_sys_sendfile fs/read_write.c:1326 [inline] #0: ffff8880260ee410 (sb_writers#8){.+.+}-{0:0}, at: __ia32_compat_sys_sendfile+0x1e3/0x220 fs/read_write.c:1326 #1: ffff88802bc24088 (&of->mutex){+.+.}-{3:3}, at: kernfs_fop_write_iter+0x281/0x610 fs/kernfs/file.c:325 #2: ffff8880133f13a8 (kn->active#61){.+.+}-{0:0}, at: kernfs_fop_write_iter+0x2a4/0x610 fs/kernfs/file.c:326 stack backtrace: CPU: 3 PID: 24410 Comm: syz-executor.1 Not tainted 6.5.0-rc7-syzkaller-00093-gf8d6ff449094 #0 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xd9/0x1b0 lib/dump_stack.c:106 check_noncircular+0x311/0x3f0 kernel/locking/lockdep.c:2195 check_prev_add kernel/locking/lockdep.c:3142 [inline] check_prevs_add kernel/locking/lockdep.c:3261 [inline] validate_chain kernel/locking/lockdep.c:3876 [inline] __lock_acquire+0x2e3d/0x5de0 kernel/locking/lockdep.c:5144 lock_acquire kernel/locking/lockdep.c:5761 [inline] lock_acquire+0x1ae/0x510 kernel/locking/lockdep.c:5726 down_read+0x9c/0x470 kernel/locking/rwsem.c:1520 inode_lock_shared include/linux/fs.h:781 [inline] lookup_slow fs/namei.c:1706 [inline] walk_component+0x33b/0x5a0 fs/namei.c:1998 lookup_last fs/namei.c:2455 [inline] path_lookupat+0x17f/0x770 fs/namei.c:2479 filename_lookup+0x1e7/0x5b0 fs/namei.c:2508 kern_path+0x35/0x50 fs/namei.c:2606 lookup_bdev+0xd9/0x280 block/bdev.c:943 resume_store+0x1d4/0x460 kernel/power/hibernate.c:1177 kobj_attr_store+0x55/0x80 lib/kobject.c:833 sysfs_kf_write+0x117/0x170 fs/sysfs/file.c:136 kernfs_fop_write_iter+0x3ff/0x610 fs/kernfs/file.c:334 call_write_iter include/linux/fs.h:1877 [inline] do_iter_readv_writev+0x21e/0x3c0 fs/read_write.c:735 do_iter_write+0x17f/0x830 fs/read_write.c:860 vfs_iter_write+0x7a/0xb0 fs/read_write.c:901 iter_file_splice_write+0x698/0xbf0 fs/splice.c:739 do_splice_from fs/splice.c:936 [inline] direct_splice_actor+0x118/0x180 fs/splice.c:1145 splice_direct_to_actor+0x347/0xa30 fs/splice.c:1091 do_splice_direct+0x1af/0x280 fs/splice.c:1197 do_sendfile+0xb88/0x1390 fs/read_write.c:1254 __do_compat_sys_sendfile fs/read_write.c:1343 [inline] __se_compat_sys_sendfile fs/read_write.c:1326 [inline] __ia32_compat_sys_sendfile+0x1e3/0x220 fs/read_write.c:1326 do_syscall_32_irqs_on arch/x86/entry/common.c:112 [inline] __do_fast_syscall_32+0x61/0xe0 arch/x86/entry/common.c:178 do_fast_syscall_32+0x33/0x70 arch/x86/entry/common.c:203 entry_SYSENTER_compat_after_hwframe+0x70/0x82 RIP: 0023:0xf7f3c579 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:00000000f7f375ac EFLAGS: 00000292 ORIG_RAX: 00000000000000bb RAX: ffffffffffffffda RBX: 0000000000000004 RCX: 0000000000000004 RDX: 0000000000000000 RSI: 000000000000cbb4 RDI: 0000000000000000 RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000292 R12: 0000000000000000 R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 PM: Image not found (code -6) ---------------- 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