====================================================== WARNING: possible circular locking dependency detected 6.4.0-rc2-syzkaller #0 Not tainted ------------------------------------------------------ syz-executor.0/2623 is trying to acquire lock: ffff888102f3f440 (&p->lock){+.+.}-{3:3}, at: seq_read_iter+0x3c/0x420 fs/seq_file.c:182 but task is already holding lock: ffff888103664068 (&pipe->mutex/1){+.+.}-{3:3}, at: splice_file_to_pipe+0x25/0x140 fs/splice.c:1107 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #4 (&pipe->mutex/1){+.+.}-{3:3}: __mutex_lock_common kernel/locking/mutex.c:603 [inline] __mutex_lock+0x99/0x9a0 kernel/locking/mutex.c:747 iter_file_splice_write+0xb9/0x430 fs/splice.c:710 ovl_splice_write+0x148/0x220 fs/overlayfs/file.c:473 do_splice_from fs/splice.c:841 [inline] do_splice+0x52d/0x8e0 fs/splice.c:1171 __do_splice fs/splice.c:1249 [inline] __do_sys_splice fs/splice.c:1460 [inline] __se_sys_splice+0x18f/0x240 fs/splice.c:1442 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x46/0xa0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x73/0xdd -> #3 (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+0x34/0xd0 include/linux/fs.h:1569 mnt_want_write+0x12/0x40 fs/namespace.c:394 ovl_create_object+0x3e/0x100 fs/overlayfs/dir.c:630 lookup_open fs/namei.c:3492 [inline] open_last_lookups fs/namei.c:3560 [inline] path_openat+0x520/0xd50 fs/namei.c:3788 do_filp_open+0xac/0x150 fs/namei.c:3818 do_sys_openat2+0x89/0x160 fs/open.c:1356 do_sys_open fs/open.c:1372 [inline] __do_sys_open fs/open.c:1380 [inline] __se_sys_open fs/open.c:1376 [inline] __x64_sys_open+0x7a/0xa0 fs/open.c:1376 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x46/0xa0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x73/0xdd -> #2 (&ovl_i_mutex_dir_key[depth]){++++}-{3:3}: down_read+0x4a/0x440 kernel/locking/rwsem.c:1520 inode_lock_shared include/linux/fs.h:785 [inline] lookup_slow+0x20/0x50 fs/namei.c:1706 walk_component+0xda/0xf0 fs/namei.c:1998 lookup_last fs/namei.c:2455 [inline] path_lookupat+0x45/0x100 fs/namei.c:2479 filename_lookup+0xd9/0x1f0 fs/namei.c:2508 kern_path+0x2a/0x80 fs/namei.c:2606 lookup_bdev+0x4a/0xc0 block/bdev.c:938 resume_store+0xb2/0x240 kernel/power/hibernate.c:1181 kernfs_fop_write_iter+0x12a/0x1b0 fs/kernfs/file.c:334 call_write_iter include/linux/fs.h:1868 [inline] new_sync_write fs/read_write.c:491 [inline] vfs_write+0x255/0x2c0 fs/read_write.c:584 ksys_write+0x70/0xe0 fs/read_write.c:637 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x46/0xa0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x73/0xdd -> #1 (&of->mutex){+.+.}-{3:3}: __mutex_lock_common kernel/locking/mutex.c:603 [inline] __mutex_lock+0x99/0x9a0 kernel/locking/mutex.c:747 kernfs_seq_start+0x21/0xf0 fs/kernfs/file.c:154 seq_read_iter+0x11a/0x420 fs/seq_file.c:225 call_read_iter include/linux/fs.h:1862 [inline] new_sync_read fs/read_write.c:389 [inline] vfs_read+0x250/0x2b0 fs/read_write.c:470 ksys_read+0x70/0xe0 fs/read_write.c:613 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x46/0xa0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x73/0xdd -> #0 (&p->lock){+.+.}-{3:3}: check_prev_add kernel/locking/lockdep.c:3108 [inline] check_prevs_add kernel/locking/lockdep.c:3227 [inline] validate_chain kernel/locking/lockdep.c:3842 [inline] __lock_acquire+0x1260/0x2590 kernel/locking/lockdep.c:5074 lock_acquire+0xea/0x270 kernel/locking/lockdep.c:5691 __mutex_lock_common kernel/locking/mutex.c:603 [inline] __mutex_lock+0x99/0x9a0 kernel/locking/mutex.c:747 seq_read_iter+0x3c/0x420 fs/seq_file.c:182 call_read_iter include/linux/fs.h:1862 [inline] copy_splice_read+0x1c8/0x320 fs/splice.c:366 splice_file_to_pipe+0xc0/0x140 fs/splice.c:1110 do_sendfile+0x19f/0x410 fs/read_write.c:1261 __do_sys_sendfile64 fs/read_write.c:1322 [inline] __se_sys_sendfile64+0xab/0xe0 fs/read_write.c:1308 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x46/0xa0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x73/0xdd other info that might help us debug this: Chain exists of: &p->lock --> sb_writers#4 --> &pipe->mutex/1 Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&pipe->mutex/1); lock(sb_writers#4); lock(&pipe->mutex/1); lock(&p->lock); *** DEADLOCK *** 1 lock held by syz-executor.0/2623: #0: ffff888103664068 (&pipe->mutex/1){+.+.}-{3:3}, at: splice_file_to_pipe+0x25/0x140 fs/splice.c:1107 stack backtrace: CPU: 0 PID: 2623 Comm: syz-executor.0 Not tainted 6.4.0-rc2-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/27/2024 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x8d/0xe0 lib/dump_stack.c:106 check_noncircular+0x10c/0x120 kernel/locking/lockdep.c:2188 check_prev_add kernel/locking/lockdep.c:3108 [inline] check_prevs_add kernel/locking/lockdep.c:3227 [inline] validate_chain kernel/locking/lockdep.c:3842 [inline] __lock_acquire+0x1260/0x2590 kernel/locking/lockdep.c:5074 lock_acquire+0xea/0x270 kernel/locking/lockdep.c:5691 __mutex_lock_common kernel/locking/mutex.c:603 [inline] __mutex_lock+0x99/0x9a0 kernel/locking/mutex.c:747 seq_read_iter+0x3c/0x420 fs/seq_file.c:182 call_read_iter include/linux/fs.h:1862 [inline] copy_splice_read+0x1c8/0x320 fs/splice.c:366 splice_file_to_pipe+0xc0/0x140 fs/splice.c:1110 do_sendfile+0x19f/0x410 fs/read_write.c:1261 __do_sys_sendfile64 fs/read_write.c:1322 [inline] __se_sys_sendfile64+0xab/0xe0 fs/read_write.c:1308 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x46/0xa0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x73/0xdd RIP: 0033:0x7fb98e47dd69 Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 e1 20 00 00 90 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 b0 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007fb98f1650c8 EFLAGS: 00000246 ORIG_RAX: 0000000000000028 RAX: ffffffffffffffda RBX: 00007fb98e5ac050 RCX: 00007fb98e47dd69 RDX: 0000000000000000 RSI: 0000000000000007 RDI: 0000000000000006 RBP: 00007fb98e4ca49e R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000004 R11: 0000000000000246 R12: 0000000000000000 R13: 000000000000006e R14: 00007fb98e5ac050 R15: 00007ffc86b14338