====================================================== WARNING: possible circular locking dependency detected 5.7.0-rc3-syzkaller #0 Not tainted ------------------------------------------------------ syz-executor.3/8607 is trying to acquire lock: ffff8880a70b1f00 (&p->lock){+.+.}-{3:3}, at: seq_read+0x61/0xfd0 fs/seq_file.c:153 but task is already holding lock: ffff888098006450 (sb_writers#3){.+.+}-{0:0}, at: file_start_write include/linux/fs.h:2908 [inline] ffff888098006450 (sb_writers#3){.+.+}-{0:0}, at: do_sendfile+0xa29/0xc50 fs/read_write.c:1520 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #3 (sb_writers#3){.+.+}-{0:0}: percpu_down_read include/linux/percpu-rwsem.h:51 [inline] __sb_start_write+0x230/0x470 fs/super.c:1674 sb_start_write include/linux/fs.h:1655 [inline] mnt_want_write+0x3a/0xb0 fs/namespace.c:354 ovl_create_object+0x96/0x290 fs/overlayfs/dir.c:599 lookup_open+0xf4d/0x1320 fs/namei.c:3081 open_last_lookups fs/namei.c:3155 [inline] path_openat+0x93f/0x27d0 fs/namei.c:3343 do_filp_open+0x192/0x260 fs/namei.c:3373 do_sys_openat2+0x585/0x7d0 fs/open.c:1148 do_sys_open+0xc3/0x140 fs/open.c:1164 do_syscall_64+0xf6/0x7d0 arch/x86/entry/common.c:295 entry_SYSCALL_64_after_hwframe+0x49/0xb3 -> #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:807 [inline] lookup_slow fs/namei.c:1546 [inline] walk_component+0x409/0x6a0 fs/namei.c:1846 lookup_last fs/namei.c:2295 [inline] path_lookupat.isra.0+0x180/0x530 fs/namei.c:2319 filename_lookup+0x1a3/0x3e0 fs/namei.c:2352 create_local_trace_uprobe+0x87/0x480 kernel/trace/trace_uprobe.c:1575 perf_uprobe_init+0x132/0x210 kernel/trace/trace_event_perf.c:323 perf_uprobe_event_init+0xff/0x190 kernel/events/core.c:9478 perf_try_init_event+0x12a/0x560 kernel/events/core.c:10779 perf_init_event kernel/events/core.c:10831 [inline] perf_event_alloc.part.0+0xe26/0x38c0 kernel/events/core.c:11107 perf_event_alloc kernel/events/core.c:11486 [inline] __do_sys_perf_event_open+0x695/0x2930 kernel/events/core.c:11602 do_syscall_64+0xf6/0x7d0 arch/x86/entry/common.c:295 entry_SYSCALL_64_after_hwframe+0x49/0xb3 -> #1 (&sig->exec_update_mutex){+.+.}-{3:3}: __mutex_lock_common kernel/locking/mutex.c:956 [inline] __mutex_lock+0x156/0x13c0 kernel/locking/mutex.c:1103 lock_trace+0x45/0xe0 fs/proc/base.c:408 proc_pid_personality+0x17/0xc0 fs/proc/base.c:3086 proc_single_show+0xf7/0x1c0 fs/proc/base.c:758 seq_read+0x432/0xfd0 fs/seq_file.c:206 do_loop_readv_writev fs/read_write.c:715 [inline] do_loop_readv_writev fs/read_write.c:702 [inline] do_iter_read+0x483/0x650 fs/read_write.c:936 vfs_readv+0xf0/0x160 fs/read_write.c:1054 kernel_readv fs/splice.c:365 [inline] default_file_splice_read+0x4fb/0xa20 fs/splice.c:422 do_splice_to+0x114/0x160 fs/splice.c:892 splice_direct_to_actor+0x307/0x980 fs/splice.c:971 do_splice_direct+0x1b4/0x280 fs/splice.c:1080 do_sendfile+0x555/0xc50 fs/read_write.c:1521 __do_sys_sendfile64 fs/read_write.c:1582 [inline] __se_sys_sendfile64 fs/read_write.c:1568 [inline] __x64_sys_sendfile64+0x1cc/0x210 fs/read_write.c:1568 do_syscall_64+0xf6/0x7d0 arch/x86/entry/common.c:295 entry_SYSCALL_64_after_hwframe+0x49/0xb3 -> #0 (&p->lock){+.+.}-{3:3}: check_prev_add kernel/locking/lockdep.c:2515 [inline] check_prevs_add kernel/locking/lockdep.c:2620 [inline] validate_chain kernel/locking/lockdep.c:3237 [inline] __lock_acquire+0x2ab1/0x4c50 kernel/locking/lockdep.c:4355 lock_acquire+0x1f2/0x8f0 kernel/locking/lockdep.c:4934 __mutex_lock_common kernel/locking/mutex.c:956 [inline] __mutex_lock+0x156/0x13c0 kernel/locking/mutex.c:1103 seq_read+0x61/0xfd0 fs/seq_file.c:153 do_loop_readv_writev fs/read_write.c:715 [inline] do_loop_readv_writev fs/read_write.c:702 [inline] do_iter_read+0x483/0x650 fs/read_write.c:936 vfs_readv+0xf0/0x160 fs/read_write.c:1054 kernel_readv fs/splice.c:365 [inline] default_file_splice_read+0x4fb/0xa20 fs/splice.c:422 do_splice_to+0x114/0x160 fs/splice.c:892 splice_direct_to_actor+0x307/0x980 fs/splice.c:971 do_splice_direct+0x1b4/0x280 fs/splice.c:1080 do_sendfile+0x555/0xc50 fs/read_write.c:1521 __do_sys_sendfile64 fs/read_write.c:1582 [inline] __se_sys_sendfile64 fs/read_write.c:1568 [inline] __x64_sys_sendfile64+0x1cc/0x210 fs/read_write.c:1568 do_syscall_64+0xf6/0x7d0 arch/x86/entry/common.c:295 entry_SYSCALL_64_after_hwframe+0x49/0xb3 other info that might help us debug this: Chain exists of: &p->lock --> &ovl_i_mutex_dir_key[depth] --> sb_writers#3 Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(sb_writers#3); lock(&ovl_i_mutex_dir_key[depth]); lock(sb_writers#3); lock(&p->lock); *** DEADLOCK *** 1 lock held by syz-executor.3/8607: #0: ffff888098006450 (sb_writers#3){.+.+}-{0:0}, at: file_start_write include/linux/fs.h:2908 [inline] #0: ffff888098006450 (sb_writers#3){.+.+}-{0:0}, at: do_sendfile+0xa29/0xc50 fs/read_write.c:1520 stack backtrace: CPU: 0 PID: 8607 Comm: syz-executor.3 Not tainted 5.7.0-rc3-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+0x188/0x20d lib/dump_stack.c:118 check_noncircular+0x32e/0x3e0 kernel/locking/lockdep.c:1846 check_prev_add kernel/locking/lockdep.c:2515 [inline] check_prevs_add kernel/locking/lockdep.c:2620 [inline] validate_chain kernel/locking/lockdep.c:3237 [inline] __lock_acquire+0x2ab1/0x4c50 kernel/locking/lockdep.c:4355 lock_acquire+0x1f2/0x8f0 kernel/locking/lockdep.c:4934 __mutex_lock_common kernel/locking/mutex.c:956 [inline] __mutex_lock+0x156/0x13c0 kernel/locking/mutex.c:1103 seq_read+0x61/0xfd0 fs/seq_file.c:153 do_loop_readv_writev fs/read_write.c:715 [inline] do_loop_readv_writev fs/read_write.c:702 [inline] do_iter_read+0x483/0x650 fs/read_write.c:936 vfs_readv+0xf0/0x160 fs/read_write.c:1054 kernel_readv fs/splice.c:365 [inline] default_file_splice_read+0x4fb/0xa20 fs/splice.c:422 do_splice_to+0x114/0x160 fs/splice.c:892 splice_direct_to_actor+0x307/0x980 fs/splice.c:971 do_splice_direct+0x1b4/0x280 fs/splice.c:1080 do_sendfile+0x555/0xc50 fs/read_write.c:1521 __do_sys_sendfile64 fs/read_write.c:1582 [inline] __se_sys_sendfile64 fs/read_write.c:1568 [inline] __x64_sys_sendfile64+0x1cc/0x210 fs/read_write.c:1568 do_syscall_64+0xf6/0x7d0 arch/x86/entry/common.c:295 entry_SYSCALL_64_after_hwframe+0x49/0xb3 RIP: 0033:0x45c829 Code: 0d b7 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 b6 fb ff c3 66 2e 0f 1f 84 00 00 00 00 RSP: 002b:00007f69a6fb6c78 EFLAGS: 00000246 ORIG_RAX: 0000000000000028 RAX: ffffffffffffffda RBX: 00000000004fc040 RCX: 000000000045c829 RDX: 0000000000000000 RSI: 0000000000000003 RDI: 0000000000000004 RBP: 000000000078bf00 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000209 R11: 0000000000000246 R12: 00000000ffffffff R13: 00000000000008d6 R14: 00000000004cb7a1 R15: 00007f69a6fb76d4