====================================================== WARNING: possible circular locking dependency detected 6.4.0-rc2-syzkaller #0 Not tainted ------------------------------------------------------ syz-executor.1/4756 is trying to acquire lock: ffff888103f88358 (&p->lock){+.+.}-{3:3}, at: seq_read_iter+0x3c/0x3e0 fs/seq_file.c:182 but task is already holding lock: ffff8881013e7448 (sb_writers#4){.+.+}-{0:0}, at: do_sendfile+0x25d/0x410 fs/read_write.c:1253 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #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/0x30 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+0x4f4/0xce0 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+0x42/0x90 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd -> #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+0xd3/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/0xb0 block/bdev.c:938 resume_store+0xae/0x230 kernel/power/hibernate.c:1181 kernfs_fop_write_iter+0x129/0x1a0 fs/kernfs/file.c:334 do_iter_write+0x1dc/0x2d0 fs/read_write.c:860 iter_file_splice_write+0x270/0x430 fs/splice.c:763 do_splice_from fs/splice.c:841 [inline] direct_splice_actor+0x2b/0x90 fs/splice.c:1028 splice_direct_to_actor+0xcc/0x210 fs/splice.c:983 do_splice_direct+0x86/0xd0 fs/splice.c:1071 do_sendfile+0x278/0x410 fs/read_write.c:1254 __do_sys_sendfile64 fs/read_write.c:1322 [inline] __se_sys_sendfile64+0xa7/0xe0 fs/read_write.c:1308 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x42/0x90 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd -> #1 (&of->mutex){+.+.}-{3:3}: __mutex_lock_common kernel/locking/mutex.c:603 [inline] __mutex_lock+0x99/0x990 kernel/locking/mutex.c:747 kernfs_seq_start+0x21/0xf0 fs/kernfs/file.c:154 seq_read_iter+0x116/0x3e0 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+0x241/0x2a0 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+0x42/0x90 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd -> #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+0x125c/0x2590 kernel/locking/lockdep.c:5074 lock_acquire+0xea/0x260 kernel/locking/lockdep.c:5691 __mutex_lock_common kernel/locking/mutex.c:603 [inline] __mutex_lock+0x99/0x990 kernel/locking/mutex.c:747 seq_read_iter+0x3c/0x3e0 fs/seq_file.c:182 call_read_iter include/linux/fs.h:1862 [inline] copy_splice_read+0x1c4/0x320 fs/splice.c:366 splice_direct_to_actor+0x96/0x210 fs/splice.c:962 do_splice_direct+0x86/0xd0 fs/splice.c:1071 do_sendfile+0x278/0x410 fs/read_write.c:1254 __do_sys_sendfile64 fs/read_write.c:1322 [inline] __se_sys_sendfile64+0xa7/0xe0 fs/read_write.c:1308 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x42/0x90 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd other info that might help us debug this: Chain exists of: &p->lock --> &ovl_i_mutex_dir_key[depth] --> sb_writers#4 Possible unsafe locking scenario: CPU0 CPU1 ---- ---- rlock(sb_writers#4); lock(&ovl_i_mutex_dir_key[depth]); lock(sb_writers#4); lock(&p->lock); *** DEADLOCK *** 1 lock held by syz-executor.1/4756: #0: ffff8881013e7448 (sb_writers#4){.+.+}-{0:0}, at: do_sendfile+0x25d/0x410 fs/read_write.c:1253 stack backtrace: CPU: 0 PID: 4756 Comm: syz-executor.1 Not tainted 6.4.0-rc2-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/17/2023 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x8d/0xe0 lib/dump_stack.c:106 check_noncircular+0x108/0x110 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+0x125c/0x2590 kernel/locking/lockdep.c:5074 lock_acquire+0xea/0x260 kernel/locking/lockdep.c:5691 __mutex_lock_common kernel/locking/mutex.c:603 [inline] __mutex_lock+0x99/0x990 kernel/locking/mutex.c:747 seq_read_iter+0x3c/0x3e0 fs/seq_file.c:182 call_read_iter include/linux/fs.h:1862 [inline] copy_splice_read+0x1c4/0x320 fs/splice.c:366 splice_direct_to_actor+0x96/0x210 fs/splice.c:962 do_splice_direct+0x86/0xd0 fs/splice.c:1071 do_sendfile+0x278/0x410 fs/read_write.c:1254 __do_sys_sendfile64 fs/read_write.c:1322 [inline] __se_sys_sendfile64+0xa7/0xe0 fs/read_write.c:1308 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x42/0x90 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd RIP: 0033:0x7ff713c7cbe9 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:00007ff7149410c8 EFLAGS: 00000246 ORIG_RAX: 0000000000000028 RAX: ffffffffffffffda RBX: 00007ff713d9c050 RCX: 00007ff713c7cbe9 RDX: 0000000000000000 RSI: 0000000000000004 RDI: 0000000000000003 RBP: 00007ff713cc847a R08: 0000000000000000 R09: 0000000000000000 R10: 0001000000201007 R11: 0000000000000246 R12: 0000000000000000 R13: 000000000000006e R14: 00007ff713d9c050 R15: 00007ffdb45f3348