====================================================== WARNING: possible circular locking dependency detected 6.14.0-syzkaller-01103-g2df0c02dab82 #0 Not tainted ------------------------------------------------------ syz.6.2028/13745 is trying to acquire lock: ffff888078a146c8 (&ovl_i_mutex_dir_key[depth]){++++}-{4:4}, at: inode_lock_shared include/linux/fs.h:877 [inline] ffff888078a146c8 (&ovl_i_mutex_dir_key[depth]){++++}-{4:4}, at: lookup_slow fs/namei.c:1823 [inline] ffff888078a146c8 (&ovl_i_mutex_dir_key[depth]){++++}-{4:4}, at: walk_component+0x345/0x5b0 fs/namei.c:2128 but task is already holding lock: ffff888076774488 (&of->mutex){+.+.}-{4:4}, at: kernfs_fop_write_iter+0x287/0x510 fs/kernfs/file.c:325 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:587 [inline] __mutex_lock+0x19a/0xb00 kernel/locking/mutex.c:732 kernfs_fop_write_iter+0x287/0x510 fs/kernfs/file.c:325 iter_file_splice_write+0x91c/0x1150 fs/splice.c:738 do_splice_from fs/splice.c:935 [inline] do_splice+0x1475/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] __x64_sys_splice+0x187/0x250 fs/splice.c:1615 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xcd/0x260 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f -> #2 (&pipe->mutex){+.+.}-{4:4}: __mutex_lock_common kernel/locking/mutex.c:587 [inline] __mutex_lock+0x19a/0xb00 kernel/locking/mutex.c:732 pipe_lock fs/pipe.c:92 [inline] pipe_lock+0x64/0x80 fs/pipe.c:89 iter_file_splice_write+0x1ea/0x1150 fs/splice.c:683 do_splice_from fs/splice.c:935 [inline] do_splice+0x1475/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] __x64_sys_splice+0x187/0x250 fs/splice.c:1615 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xcd/0x260 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f -> #1 (sb_writers#6){.+.+}-{0:0}: percpu_down_read include/linux/percpu-rwsem.h:52 [inline] __sb_start_write include/linux/fs.h:1775 [inline] sb_start_write include/linux/fs.h:1911 [inline] mnt_want_write+0x6f/0x450 fs/namespace.c:556 ovl_create_object+0x12c/0x300 fs/overlayfs/dir.c:628 lookup_open.isra.0+0x11d0/0x1580 fs/namei.c:3666 open_last_lookups fs/namei.c:3765 [inline] path_openat+0x905/0x2d40 fs/namei.c:4001 do_filp_open+0x20b/0x470 fs/namei.c:4031 do_sys_openat2+0x11b/0x1d0 fs/open.c:1429 do_sys_open fs/open.c:1444 [inline] __do_sys_open fs/open.c:1452 [inline] __se_sys_open fs/open.c:1448 [inline] __x64_sys_open+0x153/0x1e0 fs/open.c:1448 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xcd/0x260 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f -> #0 (&ovl_i_mutex_dir_key[depth]){++++}-{4:4}: check_prev_add kernel/locking/lockdep.c:3166 [inline] check_prevs_add kernel/locking/lockdep.c:3285 [inline] validate_chain kernel/locking/lockdep.c:3909 [inline] __lock_acquire+0x1173/0x1ba0 kernel/locking/lockdep.c:5235 lock_acquire kernel/locking/lockdep.c:5866 [inline] lock_acquire+0x179/0x350 kernel/locking/lockdep.c:5823 down_read+0x9b/0x480 kernel/locking/rwsem.c:1524 inode_lock_shared include/linux/fs.h:877 [inline] lookup_slow fs/namei.c:1823 [inline] walk_component+0x345/0x5b0 fs/namei.c:2128 lookup_last fs/namei.c:2626 [inline] path_lookupat+0x17e/0x780 fs/namei.c:2650 filename_lookup+0x224/0x5f0 fs/namei.c:2679 kern_path+0x35/0x50 fs/namei.c:2787 lookup_bdev+0xd8/0x280 block/bdev.c:1167 resume_store+0x1d6/0x460 kernel/power/hibernate.c:1247 kobj_attr_store+0x55/0x80 lib/kobject.c:840 sysfs_kf_write+0x117/0x170 fs/sysfs/file.c:139 kernfs_fop_write_iter+0x349/0x510 fs/kernfs/file.c:334 new_sync_write fs/read_write.c:591 [inline] vfs_write+0x5ba/0x1180 fs/read_write.c:684 ksys_write+0x12a/0x240 fs/read_write.c:736 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xcd/0x260 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: &ovl_i_mutex_dir_key[depth] --> &pipe->mutex --> &of->mutex Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&of->mutex); lock(&pipe->mutex); lock(&of->mutex); rlock(&ovl_i_mutex_dir_key[depth]); *** DEADLOCK *** 4 locks held by syz.6.2028/13745: #0: ffff8880343d5b38 (&f->f_pos_lock){+.+.}-{4:4}, at: fdget_pos+0x2a2/0x370 fs/file.c:1213 #1: ffff888036652420 (sb_writers#8){.+.+}-{0:0}, at: ksys_write+0x12a/0x240 fs/read_write.c:736 #2: ffff888076774488 (&of->mutex){+.+.}-{4:4}, at: kernfs_fop_write_iter+0x287/0x510 fs/kernfs/file.c:325 #3: ffff888140ac9788 (kn->active#63){.+.+}-{0:0}, at: kernfs_fop_write_iter+0x2aa/0x510 fs/kernfs/file.c:326 stack backtrace: CPU: 1 UID: 0 PID: 13745 Comm: syz.6.2028 Not tainted 6.14.0-syzkaller-01103-g2df0c02dab82 #0 PREEMPT(full) Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 02/12/2025 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:2079 check_noncircular+0x14c/0x170 kernel/locking/lockdep.c:2211 check_prev_add kernel/locking/lockdep.c:3166 [inline] check_prevs_add kernel/locking/lockdep.c:3285 [inline] validate_chain kernel/locking/lockdep.c:3909 [inline] __lock_acquire+0x1173/0x1ba0 kernel/locking/lockdep.c:5235 lock_acquire kernel/locking/lockdep.c:5866 [inline] lock_acquire+0x179/0x350 kernel/locking/lockdep.c:5823 down_read+0x9b/0x480 kernel/locking/rwsem.c:1524 inode_lock_shared include/linux/fs.h:877 [inline] lookup_slow fs/namei.c:1823 [inline] walk_component+0x345/0x5b0 fs/namei.c:2128 lookup_last fs/namei.c:2626 [inline] path_lookupat+0x17e/0x780 fs/namei.c:2650 filename_lookup+0x224/0x5f0 fs/namei.c:2679 kern_path+0x35/0x50 fs/namei.c:2787 lookup_bdev+0xd8/0x280 block/bdev.c:1167 resume_store+0x1d6/0x460 kernel/power/hibernate.c:1247 kobj_attr_store+0x55/0x80 lib/kobject.c:840 sysfs_kf_write+0x117/0x170 fs/sysfs/file.c:139 kernfs_fop_write_iter+0x349/0x510 fs/kernfs/file.c:334 new_sync_write fs/read_write.c:591 [inline] vfs_write+0x5ba/0x1180 fs/read_write.c:684 ksys_write+0x12a/0x240 fs/read_write.c:736 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xcd/0x260 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7fe22a58d169 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:00007fe2283d5038 EFLAGS: 00000246 ORIG_RAX: 0000000000000001 RAX: ffffffffffffffda RBX: 00007fe22a7a6080 RCX: 00007fe22a58d169 RDX: 0000000000000012 RSI: 0000200000000040 RDI: 0000000000000003 RBP: 00007fe22a60e2a0 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 00007fe22a7a6080 R15: 00007ffe8d812d28 syz.6.2028: attempt to access beyond end of device md2: rw=2048, sector=0, nr_sectors = 8 limit=0 PM: Image not found (code -5)