====================================================== WARNING: possible circular locking dependency detected 4.14.96+ #20 Not tainted ------------------------------------------------------ syz-executor2/28913 is trying to acquire lock: (&event->child_mutex){+.+.}, at: [] perf_event_for_each_child+0x82/0x150 kernel/events/core.c:4687 but task is already holding lock: (&cpuctx_mutex){+.+.}, at: [] 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-executor2/28913: #0: (&cpuctx_mutex){+.+.}, at: [] perf_event_ctx_lock_nested+0x14d/0x2c0 kernel/events/core.c:1240 stack backtrace: CPU: 1 PID: 28913 Comm: syz-executor2 Not tainted 4.14.96+ #20 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 SELinux: unrecognized netlink message: protocol=0 nlmsg_type=0 sclass=netlink_route_socket pig=28946 comm=syz-executor1 SELinux: unrecognized netlink message: protocol=0 nlmsg_type=0 sclass=netlink_route_socket pig=28946 comm=syz-executor1 SELinux: unrecognized netlink message: protocol=0 nlmsg_type=1040 sclass=netlink_route_socket pig=28958 comm=syz-executor4 SELinux: unrecognized netlink message: protocol=0 nlmsg_type=1040 sclass=netlink_route_socket pig=28964 comm=syz-executor4 netlink: 8 bytes leftover after parsing attributes in process `selinux@'. binder: BINDER_SET_CONTEXT_MGR already set binder: 28972:28982 ioctl 40046207 0 returned -16 netlink: 8 bytes leftover after parsing attributes in process `selinux@'. binder_alloc: 22753: binder_alloc_buf, no vma binder: 28972:28985 transaction failed 29189/-3, size 0-12288 line 3135 netlink: 8 bytes leftover after parsing attributes in process `syz-executor4'. binder_alloc: binder_alloc_mmap_handler: 28972 20001000-20004000 already mapped failed -16 binder: BINDER_SET_CONTEXT_MGR already set binder: 28972:28985 ioctl 40046207 0 returned -16 binder: undelivered TRANSACTION_ERROR: 29189 netlink: 8 bytes leftover after parsing attributes in process `syz-executor4'. kauditd_printk_skb: 364 callbacks suppressed audit: type=1400 audit(1039.207:33547): avc: denied { map } for pid=29000 comm="blkid" path="/sbin/blkid" dev="sda1" ino=16128 scontext=system_u:system_r:kernel_t:s0 tcontext=system_u:object_r:file_t:s0 tclass=file permissive=1 audit: type=1400 audit(1039.207:33548): avc: denied { map } for pid=29000 comm="blkid" path="/sbin/blkid" dev="sda1" ino=16128 scontext=system_u:system_r:kernel_t:s0 tcontext=system_u:object_r:file_t:s0 tclass=file permissive=1 SELinux: unrecognized netlink message: protocol=0 nlmsg_type=0 sclass=netlink_route_socket pig=29009 comm=syz-executor4 audit: type=1400 audit(1039.207:33549): avc: denied { map } for pid=29000 comm="blkid" 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 SELinux: unrecognized netlink message: protocol=0 nlmsg_type=0 sclass=netlink_route_socket pig=29020 comm=syz-executor4 audit: type=1400 audit(1039.207:33550): avc: denied { map } for pid=29000 comm="blkid" 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(1039.227:33551): avc: denied { map } for pid=29000 comm="blkid" 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(1039.237:33552): avc: denied { map } for pid=29002 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_lost=358 audit_rate_limit=0 audit_backlog_limit=64 audit: audit_backlog=65 > audit_backlog_limit=64 audit: backlog limit exceeded netlink: 8 bytes leftover after parsing attributes in process `syz-executor4'. netlink: 8 bytes leftover after parsing attributes in process `syz-executor4'. SELinux: unrecognized netlink message: protocol=0 nlmsg_type=47507 sclass=netlink_route_socket pig=29056 comm=syz-executor4 SELinux: unrecognized netlink message: protocol=0 nlmsg_type=47507 sclass=netlink_route_socket pig=29062 comm=syz-executor4 netlink: 8 bytes leftover after parsing attributes in process `syz-executor1'. netlink: 8 bytes leftover after parsing attributes in process `syz-executor1'. kauditd_printk_skb: 359 callbacks suppressed audit: type=1400 audit(1044.227:33901): avc: denied { map } for pid=29172 comm="blkid" path="/sbin/blkid" dev="sda1" ino=16128 scontext=system_u:system_r:kernel_t:s0 tcontext=system_u:object_r:file_t:s0 tclass=file permissive=1 audit: type=1400 audit(1044.227:33902): avc: denied { map } for pid=29172 comm="blkid" path="/sbin/blkid" dev="sda1" ino=16128 scontext=system_u:system_r:kernel_t:s0 tcontext=system_u:object_r:file_t:s0 tclass=file permissive=1 audit: type=1400 audit(1044.237:33903): avc: denied { map } for pid=29172 comm="blkid" 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(1044.237:33904): avc: denied { map } for pid=29172 comm="blkid" 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(1044.237:33905): avc: denied { map } for pid=29172 comm="blkid" 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(1044.237:33906): avc: denied { map } for pid=29172 comm="blkid" path="/lib/x86_64-linux-gnu/libblkid.so.1.1.0" dev="sda1" ino=2825 scontext=system_u:system_r:kernel_t:s0 tcontext=system_u:object_r:file_t:s0 tclass=file permissive=1 SELinux: unrecognized netlink message: protocol=0 nlmsg_type=0 sclass=netlink_route_socket pig=29182 comm=syz-executor4 audit: type=1400 audit(1044.237:33907): avc: denied { map } for pid=29172 comm="blkid" path="/lib/x86_64-linux-gnu/libblkid.so.1.1.0" dev="sda1" ino=2825 scontext=system_u:system_r:kernel_t:s0 tcontext=system_u:object_r:file_t:s0 tclass=file permissive=1 SELinux: unrecognized netlink message: protocol=0 nlmsg_type=0 sclass=netlink_route_socket pig=29191 comm=syz-executor4 audit: type=1400 audit(1044.267:33908): avc: denied { map } for pid=29172 comm="blkid" 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(1044.277:33909): avc: denied { map } for pid=29172 comm="blkid" 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(1044.287:33910): avc: denied { map } for pid=29172 comm="blkid" path="/lib/x86_64-linux-gnu/libuuid.so.1.3.0" dev="sda1" ino=2819 scontext=system_u:system_r:kernel_t:s0 tcontext=system_u:object_r:file_t:s0 tclass=file permissive=1