====================================================== WARNING: possible circular locking dependency detected 5.9.0-rc7-syzkaller #0 Not tainted ------------------------------------------------------ syz-executor.1/24882 is trying to acquire lock: ffff888090a8c330 (&p->lock){+.+.}-{3:3}, at: seq_read+0x61/0x1070 fs/seq_file.c:155 but task is already holding lock: ffff888098680450 (sb_writers#4){.+.+}-{0:0}, at: file_start_write include/linux/fs.h:2783 [inline] ffff888098680450 (sb_writers#4){.+.+}-{0:0}, at: do_sendfile+0xa39/0xd40 fs/read_write.c:1547 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+0x228/0x450 fs/super.c:1672 sb_start_write include/linux/fs.h:1643 [inline] mnt_want_write+0x3a/0xb0 fs/namespace.c:354 ovl_create_object+0x96/0x290 fs/overlayfs/dir.c:625 lookup_open.isra.0+0xf85/0x1350 fs/namei.c:3103 open_last_lookups fs/namei.c:3177 [inline] path_openat+0x96d/0x2730 fs/namei.c:3365 do_filp_open+0x17e/0x3c0 fs/namei.c:3395 do_sys_openat2+0x16d/0x420 fs/open.c:1168 do_sys_open fs/open.c:1184 [inline] __do_sys_creat fs/open.c:1258 [inline] __se_sys_creat fs/open.c:1252 [inline] __x64_sys_creat+0xc9/0x120 fs/open.c:1252 do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x44/0xa9 -> #2 (&ovl_i_mutex_dir_key[depth]){++++}-{3:3}: down_read+0x96/0x420 kernel/locking/rwsem.c:1492 inode_lock_shared include/linux/fs.h:789 [inline] lookup_slow fs/namei.c:1560 [inline] walk_component+0x409/0x6a0 fs/namei.c:1860 lookup_last fs/namei.c:2309 [inline] path_lookupat+0x1ba/0x830 fs/namei.c:2333 filename_lookup+0x19f/0x560 fs/namei.c:2366 create_local_trace_uprobe+0x87/0x4e0 kernel/trace/trace_uprobe.c:1574 perf_uprobe_init+0x132/0x210 kernel/trace/trace_event_perf.c:323 perf_uprobe_event_init+0xff/0x1c0 kernel/events/core.c:9580 perf_try_init_event+0x12a/0x560 kernel/events/core.c:10899 perf_init_event kernel/events/core.c:10951 [inline] perf_event_alloc.part.0+0xdee/0x37d0 kernel/events/core.c:11229 perf_event_alloc kernel/events/core.c:11608 [inline] __do_sys_perf_event_open+0x72c/0x2cb0 kernel/events/core.c:11724 do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x44/0xa9 -> #1 (&sig->exec_update_mutex){+.+.}-{3:3}: __mutex_lock_common kernel/locking/mutex.c:956 [inline] __mutex_lock+0x134/0x10e0 kernel/locking/mutex.c:1103 lock_trace fs/proc/base.c:408 [inline] proc_pid_stack+0xf0/0x2a0 fs/proc/base.c:452 proc_single_show+0x116/0x1e0 fs/proc/base.c:775 seq_read+0x432/0x1070 fs/seq_file.c:208 do_loop_readv_writev fs/read_write.c:742 [inline] do_loop_readv_writev fs/read_write.c:729 [inline] do_iter_read+0x48e/0x6e0 fs/read_write.c:963 vfs_readv+0xe5/0x150 fs/read_write.c:1081 do_preadv fs/read_write.c:1173 [inline] __do_sys_preadv fs/read_write.c:1223 [inline] __se_sys_preadv fs/read_write.c:1218 [inline] __x64_sys_preadv+0x231/0x310 fs/read_write.c:1218 do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x44/0xa9 -> #0 (&p->lock){+.+.}-{3:3}: check_prev_add kernel/locking/lockdep.c:2496 [inline] check_prevs_add kernel/locking/lockdep.c:2601 [inline] validate_chain kernel/locking/lockdep.c:3218 [inline] __lock_acquire+0x2a96/0x5780 kernel/locking/lockdep.c:4441 lock_acquire+0x1f3/0xaf0 kernel/locking/lockdep.c:5029 __mutex_lock_common kernel/locking/mutex.c:956 [inline] __mutex_lock+0x134/0x10e0 kernel/locking/mutex.c:1103 seq_read+0x61/0x1070 fs/seq_file.c:155 do_loop_readv_writev fs/read_write.c:742 [inline] do_loop_readv_writev fs/read_write.c:729 [inline] do_iter_read+0x48e/0x6e0 fs/read_write.c:963 vfs_readv+0xe5/0x150 fs/read_write.c:1081 kernel_readv fs/splice.c:355 [inline] default_file_splice_read.constprop.0+0x4e6/0x9e0 fs/splice.c:412 do_splice_to+0x137/0x170 fs/splice.c:871 splice_direct_to_actor+0x307/0x980 fs/splice.c:950 do_splice_direct+0x1b3/0x280 fs/splice.c:1059 do_sendfile+0x55f/0xd40 fs/read_write.c:1548 __do_sys_sendfile64 fs/read_write.c:1609 [inline] __se_sys_sendfile64 fs/read_write.c:1595 [inline] __x64_sys_sendfile64+0x1cc/0x210 fs/read_write.c:1595 do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x44/0xa9 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 ---- ---- lock(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/24882: #0: ffff888098680450 (sb_writers#4){.+.+}-{0:0}, at: file_start_write include/linux/fs.h:2783 [inline] #0: ffff888098680450 (sb_writers#4){.+.+}-{0:0}, at: do_sendfile+0xa39/0xd40 fs/read_write.c:1547 stack backtrace: CPU: 1 PID: 24882 Comm: syz-executor.1 Not tainted 5.9.0-rc7-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x198/0x1fd lib/dump_stack.c:118 check_noncircular+0x324/0x3e0 kernel/locking/lockdep.c:1827 check_prev_add kernel/locking/lockdep.c:2496 [inline] check_prevs_add kernel/locking/lockdep.c:2601 [inline] validate_chain kernel/locking/lockdep.c:3218 [inline] __lock_acquire+0x2a96/0x5780 kernel/locking/lockdep.c:4441 lock_acquire+0x1f3/0xaf0 kernel/locking/lockdep.c:5029 __mutex_lock_common kernel/locking/mutex.c:956 [inline] __mutex_lock+0x134/0x10e0 kernel/locking/mutex.c:1103 seq_read+0x61/0x1070 fs/seq_file.c:155 do_loop_readv_writev fs/read_write.c:742 [inline] do_loop_readv_writev fs/read_write.c:729 [inline] do_iter_read+0x48e/0x6e0 fs/read_write.c:963 vfs_readv+0xe5/0x150 fs/read_write.c:1081 kernel_readv fs/splice.c:355 [inline] default_file_splice_read.constprop.0+0x4e6/0x9e0 fs/splice.c:412 do_splice_to+0x137/0x170 fs/splice.c:871 splice_direct_to_actor+0x307/0x980 fs/splice.c:950 do_splice_direct+0x1b3/0x280 fs/splice.c:1059 do_sendfile+0x55f/0xd40 fs/read_write.c:1548 __do_sys_sendfile64 fs/read_write.c:1609 [inline] __se_sys_sendfile64 fs/read_write.c:1595 [inline] __x64_sys_sendfile64+0x1cc/0x210 fs/read_write.c:1595 do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x44/0xa9 RIP: 0033:0x45dd99 Code: 0d b4 fb ff c3 66 2e 0f 1f 84 00 00 00 00 00 66 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 0f 83 db b3 fb ff c3 66 2e 0f 1f 84 00 00 00 00 RSP: 002b:00007fe6c9821c78 EFLAGS: 00000246 ORIG_RAX: 0000000000000028 RAX: ffffffffffffffda RBX: 0000000000027ec0 RCX: 000000000045dd99 RDX: 0000000000000000 RSI: 0000000000000007 RDI: 0000000000000008 RBP: 000000000118bf68 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000001000206 R11: 0000000000000246 R12: 000000000118bf2c R13: 00007ffdc7478e7f R14: 00007fe6c98229c0 R15: 000000000118bf2c