audit: type=1400 audit(1561664052.573:36): avc: denied { map } for pid=6840 comm="syz-executor846" path="/root/syz-executor846538853" dev="sda1" ino=16483 scontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tcontext=unconfined_u:object_r:user_home_t:s0 tclass=file permissive=1 ====================================================== WARNING: possible circular locking dependency detected 4.14.131 #25 Not tainted ------------------------------------------------------ syz-executor846/6840 is trying to acquire lock: (pmus_lock){+.+.}, at: [] swevent_hlist_get kernel/events/core.c:7891 [inline] (pmus_lock){+.+.}, at: [] perf_swevent_init+0x12e/0x490 kernel/events/core.c:7951 but task is already holding lock: (&cpuctx_mutex/1){+.+.}, at: [] perf_event_ctx_lock_nested+0x150/0x2c0 kernel/events/core.c:1235 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #2 (&cpuctx_mutex/1){+.+.}: lock_acquire+0x16f/0x430 kernel/locking/lockdep.c:3991 __mutex_lock_common kernel/locking/mutex.c:756 [inline] __mutex_lock+0xe8/0x1470 kernel/locking/mutex.c:893 mutex_lock_nested+0x16/0x20 kernel/locking/mutex.c:908 mutex_lock_double kernel/events/core.c:9904 [inline] __perf_event_ctx_lock_double kernel/events/core.c:9963 [inline] SYSC_perf_event_open+0x121f/0x24b0 kernel/events/core.c:10225 SyS_perf_event_open+0x34/0x40 kernel/events/core.c:9983 do_syscall_64+0x1e8/0x640 arch/x86/entry/common.c:292 entry_SYSCALL_64_after_hwframe+0x42/0xb7 -> #1 (&cpuctx_mutex){+.+.}: lock_acquire+0x16f/0x430 kernel/locking/lockdep.c:3991 __mutex_lock_common kernel/locking/mutex.c:756 [inline] __mutex_lock+0xe8/0x1470 kernel/locking/mutex.c:893 mutex_lock_nested+0x16/0x20 kernel/locking/mutex.c:908 perf_event_init_cpu+0xc2/0x170 kernel/events/core.c:11223 perf_event_init+0x2d8/0x31a kernel/events/core.c:11270 start_kernel+0x3b6/0x6fd init/main.c:621 x86_64_start_reservations+0x29/0x2b arch/x86/kernel/head64.c:380 x86_64_start_kernel+0x77/0x7b arch/x86/kernel/head64.c:361 secondary_startup_64+0xa5/0xb0 arch/x86/kernel/head_64.S:240 -> #0 (pmus_lock){+.+.}: check_prev_add kernel/locking/lockdep.c:1901 [inline] check_prevs_add kernel/locking/lockdep.c:2018 [inline] validate_chain kernel/locking/lockdep.c:2460 [inline] __lock_acquire+0x2c89/0x45e0 kernel/locking/lockdep.c:3487 lock_acquire+0x16f/0x430 kernel/locking/lockdep.c:3991 __mutex_lock_common kernel/locking/mutex.c:756 [inline] __mutex_lock+0xe8/0x1470 kernel/locking/mutex.c:893 mutex_lock_nested+0x16/0x20 kernel/locking/mutex.c:908 swevent_hlist_get kernel/events/core.c:7891 [inline] perf_swevent_init+0x12e/0x490 kernel/events/core.c:7951 perf_try_init_event+0xe6/0x200 kernel/events/core.c:9342 perf_init_event kernel/events/core.c:9380 [inline] perf_event_alloc.part.0+0xd48/0x2530 kernel/events/core.c:9640 perf_event_alloc kernel/events/core.c:9993 [inline] SYSC_perf_event_open+0xa2d/0x24b0 kernel/events/core.c:10097 SyS_perf_event_open+0x34/0x40 kernel/events/core.c:9983 do_syscall_64+0x1e8/0x640 arch/x86/entry/common.c:292 entry_SYSCALL_64_after_hwframe+0x42/0xb7 other info that might help us debug this: Chain exists of: pmus_lock --> &cpuctx_mutex --> &cpuctx_mutex/1 Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&cpuctx_mutex/1); lock(&cpuctx_mutex); lock(&cpuctx_mutex/1); lock(pmus_lock); *** DEADLOCK *** 2 locks held by syz-executor846/6840: #0: (&pmus_srcu){....}, at: [] perf_event_alloc.part.0+0xba8/0x2530 kernel/events/core.c:9636 #1: (&cpuctx_mutex/1){+.+.}, at: [] perf_event_ctx_lock_nested+0x150/0x2c0 kernel/events/core.c:1235 stack backtrace: CPU: 1 PID: 6840 Comm: syz-executor846 Not tainted 4.14.131 #25 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:17 [inline] dump_stack+0x138/0x19c lib/dump_stack.c:53 print_circular_bug.isra.0.cold+0x1cc/0x28f kernel/locking/lockdep.c:1258 check_prev_add kernel/locking/lockdep.c:1901 [inline] check_prevs_add kernel/locking/lockdep.c:2018 [inline] validate_chain kernel/locking/lockdep.c:2460 [inline] __lock_acquire+0x2c89/0x45e0 kernel/locking/lockdep.c:3487 lock_acquire+0x16f/0x430 kernel/locking/lockdep.c:3991 __mutex_lock_common kernel/locking/mutex.c:756 [inline] __mutex_lock+0xe8/0x1470 kernel/locking/mutex.c:893 mutex_lock_nested+0x16/0x20 kernel/locking/mutex.c:908 swevent_hlist_get kernel/events/core.c:7891 [inline] perf_swevent_init+0x12e/0x490 kernel/events/core.c:7951 perf_try_init_event+0xe6/0x200 kernel/events/core.c:9342 perf_init_event kernel/events/core.c:9380 [inline] perf_event_alloc.part.0+0xd48/0x2530 kernel/events/core.c:9640 perf_event_alloc kernel/events/core.c:9993 [inline] SYSC_perf_event_open+0xa2d/0x24b0 kernel/events/core.c:10097 SyS_perf_event_open+0x34/0x40 kernel/events/core.c:9983 do_syscall_64+0x1e8/0x640 arch/x86/entry/common.c:292 entry_SYSCALL_64_after_hwframe+0x42/0xb7 RIP: 0033:0x440569 RSP: 002b:00007ffc9b023b38 EFLAGS: 00000246 ORIG_RAX: 000000000000012a RAX: ffffffffffffffda RBX: 00000000004002c8 RCX: 0000000000440569 RDX: 000000000000