====================================================== WARNING: possible circular locking dependency detected 4.14.111+ #54 Not tainted ------------------------------------------------------ syz-executor.5/32344 is trying to acquire lock: (&cpuctx_mutex/1){+.+.}, at: [<000000008c401b4e>] mutex_lock_double kernel/events/core.c:9907 [inline] (&cpuctx_mutex/1){+.+.}, at: [<000000008c401b4e>] __perf_event_ctx_lock_double kernel/events/core.c:9966 [inline] (&cpuctx_mutex/1){+.+.}, at: [<000000008c401b4e>] SYSC_perf_event_open kernel/events/core.c:10231 [inline] (&cpuctx_mutex/1){+.+.}, at: [<000000008c401b4e>] SyS_perf_event_open+0x11f1/0x2520 kernel/events/core.c:9986 but task is already holding lock: (&cpuctx_mutex){+.+.}, at: [<000000008836875b>] mutex_lock_double kernel/events/core.c:9906 [inline] (&cpuctx_mutex){+.+.}, at: [<000000008836875b>] __perf_event_ctx_lock_double kernel/events/core.c:9966 [inline] (&cpuctx_mutex){+.+.}, at: [<000000008836875b>] SYSC_perf_event_open kernel/events/core.c:10231 [inline] (&cpuctx_mutex){+.+.}, at: [<000000008836875b>] SyS_perf_event_open+0x11e4/0x2520 kernel/events/core.c:9986 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #2 (&cpuctx_mutex){+.+.}: -> #1 (pmus_lock){+.+.}: -> #0 (&cpuctx_mutex/1){+.+.}: other info that might help us debug this: Chain exists of: &cpuctx_mutex/1 --> pmus_lock --> &cpuctx_mutex Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&cpuctx_mutex); lock(pmus_lock); lock(&cpuctx_mutex); lock(&cpuctx_mutex/1); *** DEADLOCK *** 1 lock held by syz-executor.5/32344: #0: (&cpuctx_mutex){+.+.}, at: [<000000008836875b>] mutex_lock_double kernel/events/core.c:9906 [inline] #0: (&cpuctx_mutex){+.+.}, at: [<000000008836875b>] __perf_event_ctx_lock_double kernel/events/core.c:9966 [inline] #0: (&cpuctx_mutex){+.+.}, at: [<000000008836875b>] SYSC_perf_event_open kernel/events/core.c:10231 [inline] #0: (&cpuctx_mutex){+.+.}, at: [<000000008836875b>] SyS_perf_event_open+0x11e4/0x2520 kernel/events/core.c:9986 stack backtrace: CPU: 1 PID: 32344 Comm: syz-executor.5 Not tainted 4.14.111+ #54 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: 111 callbacks suppressed audit: type=1400 audit(1555152548.792:15391): avc: denied { map } for pid=32440 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(1555152548.842:15392): avc: denied { map } for pid=32440 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(1555152548.842:15393): avc: denied { map } for pid=32440 comm="modprobe" path="/lib/x86_64-linux-gnu/ld-2.13.so" dev="sda1" ino=2668 scontext=system_u:system_r:kernel_t:s0 tcontext=system_u:object_r:file_t:s0 tclass=file permissive=1 audit: type=1400 audit(1555152548.852:15394): avc: denied { map } for pid=32440 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(1555152548.862:15395): avc: denied { map } for pid=32440 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(1555152548.902:15396): avc: denied { map } for pid=32453 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(1555152549.162:15397): avc: denied { map } for pid=32482 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(1555152549.162:15398): avc: denied { map } for pid=32483 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(1555152549.482:15399): avc: denied { map } for pid=32530 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(1555152549.562:15400): avc: denied { map } for pid=32539 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 kauditd_printk_skb: 310 callbacks suppressed audit: type=1400 audit(1555152554.052:15711): avc: denied { map } for pid=838 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(1555152554.092:15712): avc: denied { map } for pid=844 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(1555152554.262:15713): avc: denied { create } for pid=873 comm="syz-executor.1" scontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tcontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tclass=netlink_generic_socket permissive=1 audit: type=1400 audit(1555152554.292:15714): avc: denied { write } for pid=873 comm="syz-executor.1" scontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tcontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tclass=netlink_generic_socket permissive=1 audit: type=1400 audit(1555152554.322:15715): avc: denied { map } for pid=880 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(1555152554.322:15716): avc: denied { map } for pid=880 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(1555152554.372:15717): avc: denied { read } for pid=873 comm="syz-executor.1" scontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tcontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tclass=netlink_generic_socket permissive=1 audit: type=1400 audit(1555152554.372:15718): avc: denied { create } for pid=873 comm="syz-executor.1" scontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tcontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tclass=netlink_generic_socket permissive=1 audit: type=1400 audit(1555152554.372:15719): avc: denied { write } for pid=873 comm="syz-executor.1" scontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tcontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tclass=netlink_generic_socket permissive=1 audit: type=1400 audit(1555152554.382:15720): avc: denied { map } for pid=890 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