====================================================== WARNING: possible circular locking dependency detected 4.14.111+ #50 Not tainted ------------------------------------------------------ syz-executor.5/30043 is trying to acquire lock: (&event->child_mutex){+.+.}, at: [<0000000089f1d039>] perf_event_for_each_child+0x82/0x150 kernel/events/core.c:4687 but task is already holding lock: (&cpuctx_mutex){+.+.}, at: [<00000000485a6607>] perf_event_ctx_lock_nested+0x14d/0x2c0 kernel/events/core.c:1240 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #8 (&cpuctx_mutex){+.+.}: -> #7 (pmus_lock){+.+.}: -> #6 (cpu_hotplug_lock.rw_sem){++++}: -> #5 (&sb->s_type->i_mutex_key#10){+.+.}: -> #4 (ashmem_mutex){+.+.}: -> #3 (&mm->mmap_sem){++++}: -> #2 (&sb->s_type->i_mutex_key#5){++++}: -> #1 (event_mutex){+.+.}: -> #0 (&event->child_mutex){+.+.}: 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.5/30043: #0: (&cpuctx_mutex){+.+.}, at: [<00000000485a6607>] perf_event_ctx_lock_nested+0x14d/0x2c0 kernel/events/core.c:1240 stack backtrace: CPU: 0 PID: 30043 Comm: syz-executor.5 Not tainted 4.14.111+ #50 Call Trace: __dump_stack lib/dump_stack.c:17 [inline] dump_stack+0xb9/0x10e lib/dump_stack.c:53 print_circular_bug.isra.0.cold+0x2dc/0x425 kernel/locking/lockdep.c:1258 kauditd_printk_skb: 185 callbacks suppressed audit: type=1400 audit(1554668458.095:56580): avc: denied { map } for pid=30062 comm="modprobe" path="/etc/ld.so.cache" dev="sda1" ino=2503 scontext=system_u:system_r:kernel_t:s0 tcontext=system_u:object_r:file_t:s0 tclass=file permissive=1 audit: type=1400 audit(1554668458.115:56581): avc: denied { map } for pid=30067 comm="modprobe" path="/bin/kmod" dev="sda1" ino=1440 scontext=system_u:system_r:kernel_t:s0 tcontext=system_u:object_r:file_t:s0 tclass=file permissive=1 audit: type=1400 audit(1554668458.125:56582): avc: denied { map } for pid=30067 comm="modprobe" path="/bin/kmod" dev="sda1" ino=1440 scontext=system_u:system_r:kernel_t:s0 tcontext=system_u:object_r:file_t:s0 tclass=file permissive=1 audit: audit_backlog=65 > audit_backlog_limit=64 audit: audit_backlog=65 > audit_backlog_limit=64 audit: audit_lost=824 audit_rate_limit=0 audit_backlog_limit=64 audit: audit_lost=825 audit_rate_limit=0 audit_backlog_limit=64 audit: backlog limit exceeded audit: audit_backlog=65 > audit_backlog_limit=64 audit: audit_lost=826 audit_rate_limit=0 audit_backlog_limit=64 ip6_tunnel: l0 xmit: Local address not yet configured! kauditd_printk_skb: 454 callbacks suppressed audit: type=1400 audit(1554668463.115:57035): avc: denied { map } for pid=30199 comm="modprobe" path="/lib/x86_64-linux-gnu/libc-2.13.so" dev="sda1" ino=2784 scontext=system_u:system_r:kernel_t:s0 tcontext=system_u:object_r:file_t:s0 tclass=file permissive=1 audit: type=1400 audit(1554668463.115:57036): avc: denied { map } for pid=30198 comm="getty" path="/etc/ld.so.cache" dev="sda1" ino=2503 scontext=system_u:system_r:kernel_t:s0 tcontext=system_u:object_r:file_t:s0 tclass=file permissive=1 audit: type=1400 audit(1554668463.115:57037): avc: denied { map } for pid=30200 comm="modprobe" path="/lib/x86_64-linux-gnu/libc-2.13.so" dev="sda1" ino=2784 scontext=system_u:system_r:kernel_t:s0 tcontext=system_u:object_r:file_t:s0 tclass=file permissive=1 audit: type=1400 audit(1554668463.115:57038): avc: denied { map } for pid=30200 comm="modprobe" path="/lib/x86_64-linux-gnu/libc-2.13.so" dev="sda1" ino=2784 scontext=system_u:system_r:kernel_t:s0 tcontext=system_u:object_r:file_t:s0 tclass=file permissive=1 audit: type=1400 audit(1554668463.115:57039): avc: denied { map } for pid=30198 comm="getty" path="/lib/x86_64-linux-gnu/libutil-2.13.so" dev="sda1" ino=2681 scontext=system_u:system_r:kernel_t:s0 tcontext=system_u:object_r:file_t:s0 tclass=file permissive=1 audit: type=1400 audit(1554668463.145:57040): avc: denied { map } for pid=30198 comm="getty" path="/lib/x86_64-linux-gnu/libutil-2.13.so" dev="sda1" ino=2681 scontext=system_u:system_r:kernel_t:s0 tcontext=system_u:object_r:file_t:s0 tclass=file permissive=1 audit: audit_backlog=66 > audit_backlog_limit=64 audit: audit_backlog=66 > audit_backlog_limit=64 audit: audit_backlog=66 > audit_backlog_limit=64 audit: audit_backlog=66 > audit_backlog_limit=64