====================================================== WARNING: possible circular locking dependency detected 4.14.218-syzkaller #0 Not tainted ------------------------------------------------------ syz-executor.3/16832 is trying to acquire lock: (&event->child_mutex){+.+.}, at: [] perf_read_group kernel/events/core.c:4542 [inline] (&event->child_mutex){+.+.}, at: [] __perf_read kernel/events/core.c:4624 [inline] (&event->child_mutex){+.+.}, at: [] perf_read+0x2a2/0x7c0 kernel/events/core.c:4639 but task is already holding lock: (&cpuctx_mutex){+.+.}, at: [] perf_event_ctx_lock_nested+0x14d/0x2c0 kernel/events/core.c:1241 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #5 (&cpuctx_mutex){+.+.}: __mutex_lock_common kernel/locking/mutex.c:756 [inline] __mutex_lock+0xc4/0x1310 kernel/locking/mutex.c:893 perf_event_init_cpu+0xb7/0x170 kernel/events/core.c:11250 perf_event_init+0x2cc/0x308 kernel/events/core.c:11297 start_kernel+0x46a/0x770 init/main.c:620 secondary_startup_64+0xa5/0xb0 arch/x86/kernel/head_64.S:240 -> #4 (pmus_lock){+.+.}: __mutex_lock_common kernel/locking/mutex.c:756 [inline] __mutex_lock+0xc4/0x1310 kernel/locking/mutex.c:893 perf_event_init_cpu+0x2c/0x170 kernel/events/core.c:11244 cpuhp_invoke_callback+0x1e6/0x1a80 kernel/cpu.c:184 cpuhp_up_callbacks kernel/cpu.c:572 [inline] _cpu_up+0x219/0x500 kernel/cpu.c:1144 do_cpu_up+0x9a/0x160 kernel/cpu.c:1179 smp_init+0x197/0x1ac kernel/smp.c:578 kernel_init_freeable+0x3f4/0x614 init/main.c:1068 kernel_init+0xd/0x162 init/main.c:1000 ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:404 -> #3 (cpu_hotplug_lock.rw_sem){++++}: ieee80211 phy4: Selected rate control algorithm 'minstrel_ht' percpu_down_read_preempt_disable include/linux/percpu-rwsem.h:36 [inline] percpu_down_read include/linux/percpu-rwsem.h:59 [inline] cpus_read_lock+0x39/0xc0 kernel/cpu.c:295 static_key_slow_inc+0xe/0x20 kernel/jump_label.c:123 tracepoint_add_func+0x516/0x750 kernel/tracepoint.c:223 tracepoint_probe_register_prio kernel/tracepoint.c:283 [inline] tracepoint_probe_register+0x8c/0xc0 kernel/tracepoint.c:304 trace_event_reg+0x272/0x330 kernel/trace/trace_events.c:305 perf_trace_event_reg kernel/trace/trace_event_perf.c:122 [inline] perf_trace_event_init kernel/trace/trace_event_perf.c:197 [inline] perf_trace_init+0x424/0xa30 kernel/trace/trace_event_perf.c:221 perf_tp_event_init+0x79/0xf0 kernel/events/core.c:8138 perf_try_init_event+0x15b/0x1f0 kernel/events/core.c:9369 perf_init_event kernel/events/core.c:9407 [inline] perf_event_alloc.part.0+0xe2d/0x2640 kernel/events/core.c:9667 perf_event_alloc kernel/events/core.c:10020 [inline] SYSC_perf_event_open kernel/events/core.c:10124 [inline] SyS_perf_event_open+0x67f/0x24b0 kernel/events/core.c:10010 do_syscall_64+0x1d5/0x640 arch/x86/entry/common.c:292 entry_SYSCALL_64_after_hwframe+0x46/0xbb -> #2 (tracepoints_mutex){+.+.}: __mutex_lock_common kernel/locking/mutex.c:756 [inline] __mutex_lock+0xc4/0x1310 kernel/locking/mutex.c:893 tracepoint_probe_register_prio kernel/tracepoint.c:279 [inline] tracepoint_probe_register+0x68/0xc0 kernel/tracepoint.c:304 trace_event_reg+0x272/0x330 kernel/trace/trace_events.c:305 perf_trace_event_reg kernel/trace/trace_event_perf.c:122 [inline] perf_trace_event_init kernel/trace/trace_event_perf.c:197 [inline] perf_trace_init+0x424/0xa30 kernel/trace/trace_event_perf.c:221 perf_tp_event_init+0x79/0xf0 kernel/events/core.c:8138 perf_try_init_event+0x15b/0x1f0 kernel/events/core.c:9369 perf_init_event kernel/events/core.c:9407 [inline] perf_event_alloc.part.0+0xe2d/0x2640 kernel/events/core.c:9667 perf_event_alloc kernel/events/core.c:10020 [inline] SYSC_perf_event_open kernel/events/core.c:10124 [inline] SyS_perf_event_open+0x67f/0x24b0 kernel/events/core.c:10010 do_syscall_64+0x1d5/0x640 arch/x86/entry/common.c:292 entry_SYSCALL_64_after_hwframe+0x46/0xbb -> #1 (event_mutex){+.+.}: __mutex_lock_common kernel/locking/mutex.c:756 [inline] __mutex_lock+0xc4/0x1310 kernel/locking/mutex.c:893 perf_trace_destroy+0x23/0xf0 kernel/trace/trace_event_perf.c:234 _free_event+0x321/0xe20 kernel/events/core.c:4244 free_event+0x32/0x40 kernel/events/core.c:4271 perf_event_release_kernel+0x368/0x8a0 kernel/events/core.c:4415 perf_release+0x33/0x40 kernel/events/core.c:4441 __fput+0x25f/0x7a0 fs/file_table.c:210 task_work_run+0x11f/0x190 kernel/task_work.c:113 exit_task_work include/linux/task_work.h:22 [inline] do_exit+0xa44/0x2850 kernel/exit.c:868 do_group_exit+0x100/0x2e0 kernel/exit.c:965 get_signal+0x38d/0x1ca0 kernel/signal.c:2423 do_signal+0x7c/0x1550 arch/x86/kernel/signal.c:814 exit_to_usermode_loop+0x160/0x200 arch/x86/entry/common.c:160 prepare_exit_to_usermode+0x1af/0x210 arch/x86/entry/common.c:199 retint_user+0x8/0x18 -> #0 (&event->child_mutex){+.+.}: lock_acquire+0x170/0x3f0 kernel/locking/lockdep.c:3998 __mutex_lock_common kernel/locking/mutex.c:756 [inline] __mutex_lock+0xc4/0x1310 kernel/locking/mutex.c:893 perf_read_group kernel/events/core.c:4542 [inline] __perf_read kernel/events/core.c:4624 [inline] perf_read+0x2a2/0x7c0 kernel/events/core.c:4639 __vfs_read+0xe4/0x620 fs/read_write.c:411 vfs_read+0x139/0x340 fs/read_write.c:447 SYSC_read fs/read_write.c:574 [inline] SyS_read+0xf2/0x210 fs/read_write.c:567 do_syscall_64+0x1d5/0x640 arch/x86/entry/common.c:292 entry_SYSCALL_64_after_hwframe+0x46/0xbb other info that might help us debug this: Chain exists of: &event->child_mutex --> pmus_lock --> &cpuctx_mutex Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&cpuctx_mutex); lock(pmus_lock); lock(&cpuctx_mutex); lock(&event->child_mutex); *** DEADLOCK *** 1 lock held by syz-executor.3/16832: #0: (&cpuctx_mutex){+.+.}, at: [] perf_event_ctx_lock_nested+0x14d/0x2c0 kernel/events/core.c:1241 stack backtrace: CPU: 1 PID: 16832 Comm: syz-executor.3 Not tainted 4.14.218-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 ieee80211 phy4: hwaddr 02:00:00:00:04:00 registered Call Trace: __dump_stack lib/dump_stack.c:17 [inline] dump_stack+0x1b2/0x281 lib/dump_stack.c:58 print_circular_bug.constprop.0.cold+0x2d7/0x41e kernel/locking/lockdep.c:1258 check_prev_add kernel/locking/lockdep.c:1905 [inline] check_prevs_add kernel/locking/lockdep.c:2022 [inline] validate_chain kernel/locking/lockdep.c:2464 [inline] __lock_acquire+0x2e0e/0x3f20 kernel/locking/lockdep.c:3491 lock_acquire+0x170/0x3f0 kernel/locking/lockdep.c:3998 __mutex_lock_common kernel/locking/mutex.c:756 [inline] __mutex_lock+0xc4/0x1310 kernel/locking/mutex.c:893 perf_read_group kernel/events/core.c:4542 [inline] __perf_read kernel/events/core.c:4624 [inline] perf_read+0x2a2/0x7c0 kernel/events/core.c:4639 audit: type=1804 audit(1612116934.336:18): pid=16853 uid=0 auid=4294967295 ses=4294967295 op="invalid_pcr" cause="open_writers" comm="syz-executor.5" name="/root/syzkaller-testdir588396413/syzkaller.UIEsnD/389/bus" dev="sda1" ino=16297 res=1 __vfs_read+0xe4/0x620 fs/read_write.c:411 vfs_read+0x139/0x340 fs/read_write.c:447 SYSC_read fs/read_write.c:574 [inline] SyS_read+0xf2/0x210 fs/read_write.c:567 do_syscall_64+0x1d5/0x640 arch/x86/entry/common.c:292 entry_SYSCALL_64_after_hwframe+0x46/0xbb RIP: 0033:0x465b09 RSP: 002b:00007fbcb45fe188 EFLAGS: 00000246 ORIG_RAX: 0000000000000000 RAX: ffffffffffffffda RBX: 000000000056bf60 RCX: 0000000000465b09 RDX: 0000000000002020 RSI: 0000000020002c40 RDI: 0000000000000003 RBP: 00000000004b069f R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 000000000056bf60 R13: 00007ffc8e67bb1f R14: 00007fbcb45fe300 R15: 0000000000022000 audit: type=1804 audit(1612116934.766:19): pid=16874 uid=0 auid=4294967295 ses=4294967295 op="invalid_pcr" cause="open_writers" comm="syz-executor.1" name="/root/syzkaller-testdir945506070/syzkaller.0JrGQ8/382/bus" dev="sda1" ino=16256 res=1 netlink: 37263 bytes leftover after parsing attributes in process `syz-executor.2'. BTRFS: device fsid 4db1fa5c-a000-4cd9-8801-03e9a1b6892e devid 1 transid 7 /dev/loop0 BTRFS error (device loop0): unsupported checksum algorithm 3 audit: type=1804 audit(1612116935.006:20): pid=16894 uid=0 auid=4294967295 ses=4294967295 op="invalid_pcr" cause="ToMToU" comm="syz-executor.5" name="/root/syzkaller-testdir588396413/syzkaller.UIEsnD/389/bus" dev="sda1" ino=16297 res=1 BTRFS error (device loop0): superblock checksum mismatch BTRFS error (device loop0): open_ctree failed netlink: 37263 bytes leftover after parsing attributes in process `syz-executor.2'. BTRFS error (device loop0): unsupported checksum algorithm 3 BTRFS error (device loop0): superblock checksum mismatch BTRFS error (device loop0): open_ctree failed audit: type=1804 audit(1612116935.006:21): pid=16852 uid=0 auid=4294967295 ses=4294967295 op="invalid_pcr" cause="ToMToU" comm="syz-executor.5" name="/root/syzkaller-testdir588396413/syzkaller.UIEsnD/389/bus" dev="sda1" ino=16297 res=1 audit: type=1804 audit(1612116935.106:22): pid=16893 uid=0 auid=4294967295 ses=4294967295 op="invalid_pcr" cause="ToMToU" comm="syz-executor.5" name="/root/syzkaller-testdir588396413/syzkaller.UIEsnD/389/bus" dev="sda1" ino=16297 res=1 audit: type=1326 audit(1612116935.226:23): auid=4294967295 uid=0 gid=0 ses=4294967295 pid=16913 comm="syz-executor.5" exe="/root/syz-executor.5" sig=9 arch=c000003e syscall=231 compat=0 ip=0x465b09 code=0x0 netlink: 37263 bytes leftover after parsing attributes in process `syz-executor.2'. audit: type=1804 audit(1612116935.316:24): pid=16923 uid=0 auid=4294967295 ses=4294967295 op="invalid_pcr" cause="open_writers" comm="syz-executor.1" name="/root/syzkaller-testdir945506070/syzkaller.0JrGQ8/383/bus" dev="sda1" ino=16288 res=1 BTRFS error (device loop0): unsupported checksum algorithm 3 BTRFS error (device loop0): superblock checksum mismatch netlink: 37263 bytes leftover after parsing attributes in process `syz-executor.2'. BTRFS error (device loop0): open_ctree failed BTRFS error (device loop0): unsupported checksum algorithm 3 BTRFS error (device loop0): superblock checksum mismatch audit: type=1804 audit(1612116935.726:25): pid=16956 uid=0 auid=4294967295 ses=4294967295 op="invalid_pcr" cause="open_writers" comm="syz-executor.1" name="/root/syzkaller-testdir945506070/syzkaller.0JrGQ8/384/bus" dev="sda1" ino=16290 res=1 BTRFS error (device loop0): open_ctree failed FAT-fs (loop3): Unrecognized mount option "hash" or missing value FAT-fs (loop3): Unrecognized mount option "hash" or missing value audit: type=1326 audit(1612116936.066:26): auid=4294967295 uid=0 gid=0 ses=4294967295 pid=16913 comm="syz-executor.5" exe="/root/syz-executor.5" sig=9 arch=c000003e syscall=231 compat=0 ip=0x465b09 code=0x0 netlink: 8 bytes leftover after parsing attributes in process `syz-executor.3'. audit: type=1326 audit(1612116936.256:27): auid=4294967295 uid=0 gid=0 ses=4294967295 pid=16988 comm="syz-executor.5" exe="/root/syz-executor.5" sig=9 arch=c000003e syscall=231 compat=0 ip=0x465b09 code=0x0 BTRFS error (device loop0): unsupported checksum algorithm 3 BTRFS error (device loop0): superblock checksum mismatch netlink: 8 bytes leftover after parsing attributes in process `syz-executor.3'. audit: type=1804 audit(1612116936.286:28): pid=16997 uid=0 auid=4294967295 ses=4294967295 op="invalid_pcr" cause="open_writers" comm="syz-executor.1" name="/root/syzkaller-testdir945506070/syzkaller.0JrGQ8/385/bus" dev="sda1" ino=16313 res=1 BTRFS error (device loop0): open_ctree failed netlink: 24 bytes leftover after parsing attributes in process `syz-executor.3'. audit: type=1804 audit(1612116936.726:29): pid=17028 uid=0 auid=4294967295 ses=4294967295 op="invalid_pcr" cause="open_writers" comm="syz-executor.1" name="/root/syzkaller-testdir945506070/syzkaller.0JrGQ8/386/bus" dev="sda1" ino=15796 res=1 netlink: 24 bytes leftover after parsing attributes in process `syz-executor.3'. BTRFS error (device loop0): unsupported checksum algorithm 3 BTRFS error (device loop0): superblock checksum mismatch BTRFS error (device loop0): open_ctree failed audit: type=1326 audit(1612116937.206:30): auid=4294967295 uid=0 gid=0 ses=4294967295 pid=17067 comm="syz-executor.5" exe="/root/syz-executor.5" sig=9 arch=c000003e syscall=231 compat=0 ip=0x465b09 code=0x0 netlink: 24 bytes leftover after parsing attributes in process `syz-executor.3'. netlink: 44371 bytes leftover after parsing attributes in process `syz-executor.2'. BTRFS error (device loop3): unsupported checksum algorithm 3 BTRFS error (device loop3): superblock checksum mismatch BTRFS error (device loop3): open_ctree failed BTRFS error (device loop3): unsupported checksum algorithm 3 BTRFS error (device loop3): superblock checksum mismatch BTRFS error (device loop3): open_ctree failed BTRFS error (device loop3): unsupported checksum algorithm 3 BTRFS error (device loop3): superblock checksum mismatch BTRFS error (device loop3): open_ctree failed BTRFS error (device loop3): unsupported checksum algorithm 3 BTRFS error (device loop3): superblock checksum mismatch BTRFS error (device loop3): open_ctree failed BTRFS error (device loop0): unsupported checksum algorithm 3 BTRFS error (device loop0): superblock checksum mismatch BTRFS error (device loop0): open_ctree failed BTRFS error (device loop0): unsupported checksum algorithm 3 BTRFS error (device loop0): superblock checksum mismatch BTRFS error (device loop0): open_ctree failed BTRFS error (device loop0): unsupported checksum algorithm 3 BTRFS error (device loop0): superblock checksum mismatch BTRFS error (device loop0): open_ctree failed nla_parse: 14 callbacks suppressed netlink: 44371 bytes leftover after parsing attributes in process `syz-executor.2'. BTRFS error (device loop3): unsupported checksum algorithm 3 netlink: 44371 bytes leftover after parsing attributes in process `syz-executor.4'. BTRFS error (device loop3): superblock checksum mismatch BTRFS error (device loop3): open_ctree failed BTRFS error (device loop3): unsupported checksum algorithm 3 BTRFS error (device loop3): superblock checksum mismatch BTRFS error (device loop3): open_ctree failed netlink: 44371 bytes leftover after parsing attributes in process `syz-executor.2'. netlink: 44371 bytes leftover after parsing attributes in process `syz-executor.4'. kauditd_printk_skb: 11 callbacks suppressed audit: type=1804 audit(1612116941.646:42): pid=17507 uid=0 auid=4294967295 ses=4294967295 op="invalid_pcr" cause="open_writers" comm="syz-executor.1" name="/root/syzkaller-testdir945506070/syzkaller.0JrGQ8/409/bus" dev="sda1" ino=15841 res=1 audit: type=1804 audit(1612116942.286:43): pid=17526 uid=0 auid=4294967295 ses=4294967295 op="invalid_pcr" cause="open_writers" comm="syz-executor.1" name="/root/syzkaller-testdir945506070/syzkaller.0JrGQ8/410/bus" dev="sda1" ino=16376 res=1 netlink: 44371 bytes leftover after parsing attributes in process `syz-executor.2'. BTRFS error (device loop0): unsupported checksum algorithm 3 BTRFS error (device loop0): superblock checksum mismatch netlink: 44371 bytes leftover after parsing attributes in process `syz-executor.4'. audit: type=1804 audit(1612116942.396:44): pid=17541 uid=0 auid=4294967295 ses=4294967295 op="invalid_pcr" cause="open_writers" comm="syz-executor.1" name="/root/syzkaller-testdir945506070/syzkaller.0JrGQ8/411/bus" dev="sda1" ino=16371 res=1 BTRFS error (device loop0): open_ctree failed netlink: 44371 bytes leftover after parsing attributes in process `syz-executor.2'. BTRFS error (device loop3): unsupported checksum algorithm 3 BTRFS error (device loop3): superblock checksum mismatch netlink: 44371 bytes leftover after parsing attributes in process `syz-executor.2'. netlink: 41731 bytes leftover after parsing attributes in process `syz-executor.4'. BTRFS error (device loop3): open_ctree failed audit: type=1804 audit(1612116942.566:45): pid=17566 uid=0 auid=4294967295 ses=4294967295 op="invalid_pcr" cause="open_writers" comm="syz-executor.1" name="/root/syzkaller-testdir945506070/syzkaller.0JrGQ8/412/bus" dev="sda1" ino=16376 res=1 netlink: 44371 bytes leftover after parsing attributes in process `syz-executor.2'. BTRFS error (device loop0): unsupported checksum algorithm 3 BTRFS error (device loop0): superblock checksum mismatch audit: type=1804 audit(1612116942.726:46): pid=17590 uid=0 auid=4294967295 ses=4294967295 op="invalid_pcr" cause="open_writers" comm="syz-executor.1" name="/root/syzkaller-testdir945506070/syzkaller.0JrGQ8/413/bus" dev="sda1" ino=16378 res=1 BTRFS error (device loop0): open_ctree failed BTRFS error (device loop0): unsupported checksum algorithm 3 BTRFS error (device loop0): superblock checksum mismatch audit: type=1804 audit(1612116942.836:47): pid=17599 uid=0 auid=4294967295 ses=4294967295 op="invalid_pcr" cause="open_writers" comm="syz-executor.1" name="/root/syzkaller-testdir945506070/syzkaller.0JrGQ8/414/bus" dev="sda1" ino=16371 res=1 BTRFS error (device loop0): open_ctree failed BTRFS error (device loop0): unsupported checksum algorithm 3 BTRFS error (device loop0): superblock checksum mismatch audit: type=1804 audit(1612116942.966:48): pid=17614 uid=0 auid=4294967295 ses=4294967295 op="invalid_pcr" cause="open_writers" comm="syz-executor.1" name="/root/syzkaller-testdir945506070/syzkaller.0JrGQ8/415/bus" dev="sda1" ino=16375 res=1 BTRFS error (device loop0): open_ctree failed audit: type=1804 audit(1612116943.086:49): pid=17629 uid=0 auid=4294967295 ses=4294967295 op="invalid_pcr" cause="open_writers" comm="syz-executor.1" name="/root/syzkaller-testdir945506070/syzkaller.0JrGQ8/416/bus" dev="sda1" ino=16395 res=1 BTRFS error (device loop3): unsupported checksum algorithm 3 BTRFS error (device loop3): superblock checksum mismatch audit: type=1804 audit(1612116943.226:50): pid=17649 uid=0 auid=4294967295 ses=4294967295 op="invalid_pcr" cause="open_writers" comm="syz-executor.1" name="/root/syzkaller-testdir945506070/syzkaller.0JrGQ8/417/bus" dev="sda1" ino=16395 res=1 BTRFS error (device loop3): open_ctree failed BTRFS error (device loop0): unsupported checksum algorithm 3 BTRFS error (device loop0): superblock checksum mismatch audit: type=1804 audit(1612116943.316:51): pid=17666 uid=0 auid=4294967295 ses=4294967295 op="invalid_pcr" cause="open_writers" comm="syz-executor.1" name="/root/syzkaller-testdir945506070/syzkaller.0JrGQ8/418/bus" dev="sda1" ino=16381 res=1 BTRFS error (device loop0): open_ctree failed BTRFS error (device loop3): unsupported checksum algorithm 3 BTRFS error (device loop3): superblock checksum mismatch BTRFS error (device loop3): open_ctree failed