====================================================== [ INFO: possible circular locking dependency detected ] 4.4.120-gd63fdf6 #29 Not tainted ------------------------------------------------------- syz-executor5/5266 is trying to acquire lock: (&mm->mmap_sem){++++++}, at: [ 39.228754] audit: type=1400 audit(1521912613.273:8): avc: denied { create } for pid=5267 comm="syz-executor4" scontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tcontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tclass=netlink_netfilter_socket permissive=1 [] __might_fault+0xe4/0x1d0 mm/memory.c:3809 but task is already holding lock: (ashmem_mutex){+.+.+.}, at: [] ashmem_pin_unpin drivers/staging/android/ashmem.c:701 [inline] (ashmem_mutex){+.+.+.}, at: [] ashmem_ioctl+0x367/0xfa0 drivers/staging/android/ashmem.c:778 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: [] lock_acquire+0x15e/0x460 kernel/locking/lockdep.c:3592 [] __mutex_lock_common kernel/locking/mutex.c:521 [inline] [] mutex_lock_nested+0xbb/0x850 kernel/locking/mutex.c:621 [] ashmem_mmap+0x53/0x400 drivers/staging/android/ashmem.c:366 [] mmap_region+0x94f/0x1250 mm/mmap.c:1664 [] do_mmap+0x4fd/0x9d0 mm/mmap.c:1441 [] do_mmap_pgoff include/linux/mm.h:1915 [inline] [] vm_mmap_pgoff+0x16e/0x1c0 mm/util.c:296 [] SYSC_mmap_pgoff mm/mmap.c:1491 [inline] [] SyS_mmap_pgoff+0x33f/0x560 mm/mmap.c:1449 [] do_syscall_32_irqs_on arch/x86/entry/common.c:392 [inline] [] do_fast_syscall_32+0x321/0x8a0 arch/x86/entry/common.c:459 [] sysenter_flags_fixed+0xd/0x17 [] check_prev_add kernel/locking/lockdep.c:1853 [inline] [] check_prevs_add kernel/locking/lockdep.c:1958 [inline] [] validate_chain kernel/locking/lockdep.c:2144 [inline] [] __lock_acquire+0x371f/0x4b50 kernel/locking/lockdep.c:3213 [] lock_acquire+0x15e/0x460 kernel/locking/lockdep.c:3592 [] __might_fault+0x14a/0x1d0 mm/memory.c:3810 [] copy_from_user arch/x86/include/asm/uaccess.h:724 [inline] [] ashmem_pin_unpin drivers/staging/android/ashmem.c:706 [inline] [] ashmem_ioctl+0x3b4/0xfa0 drivers/staging/android/ashmem.c:778 [] compat_ashmem_ioctl+0x3e/0x50 drivers/staging/android/ashmem.c:809 [] C_SYSC_ioctl fs/compat_ioctl.c:1592 [inline] [] compat_SyS_ioctl+0x28a/0x2540 fs/compat_ioctl.c:1544 [] do_syscall_32_irqs_on arch/x86/entry/common.c:392 [inline] [] do_fast_syscall_32+0x321/0x8a0 arch/x86/entry/common.c:459 [] sysenter_flags_fixed+0xd/0x17 other info that might help us debug this: Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(ashmem_mutex); lock(&mm->mmap_sem); lock(ashmem_mutex); lock(&mm->mmap_sem); *** DEADLOCK *** 1 lock held by syz-executor5/5266: #0: (ashmem_mutex){+.+.+.}, at: [] ashmem_pin_unpin drivers/staging/android/ashmem.c:701 [inline] #0: (ashmem_mutex){+.+.+.}, at: [] ashmem_ioctl+0x367/0xfa0 drivers/staging/android/ashmem.c:778 stack backtrace: CPU: 0 PID: 5266 Comm: syz-executor5 Not tainted 4.4.120-gd63fdf6 #29 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 0000000000000000 ca0ec9d2ce945988 ffff8801d662f8a8 ffffffff81d0408d ffffffff8519fcb0 ffffffff8519fcb0 ffffffff851be460 ffff8801c67c88f8 ffff8801c67c8000 ffff8801d662f8f0 ffffffff81233ba1 ffff8801c67c88f8 Call Trace: [] __dump_stack lib/dump_stack.c:15 [inline] [] dump_stack+0xc1/0x124 lib/dump_stack.c:51 [] print_circular_bug+0x271/0x310 kernel/locking/lockdep.c:1226 [] check_prev_add kernel/locking/lockdep.c:1853 [inline] [] check_prevs_add kernel/locking/lockdep.c:1958 [inline] [] validate_chain kernel/locking/lockdep.c:2144 [inline] [] __lock_acquire+0x371f/0x4b50 kernel/locking/lockdep.c:3213 [] lock_acquire+0x15e/0x460 kernel/locking/lockdep.c:3592 [] __might_fault+0x14a/0x1d0 mm/memory.c:3810 [] copy_from_user arch/x86/include/asm/uaccess.h:724 [inline] [] ashmem_pin_unpin drivers/staging/android/ashmem.c:706 [inline] [] ashmem_ioctl+0x3b4/0xfa0 drivers/staging/android/ashmem.c:778 [] compat_ashmem_ioctl+0x3e/0x50 drivers/staging/android/ashmem.c:809 [] C_SYSC_ioctl fs/compat_ioctl.c:1592 [inline] [] compat_SyS_ioctl+0x28a/0x2540 fs/compat_ioctl.c:1544 [] do_syscall_32_irqs_on arch/x86/entry/common.c:392 [inline] [] do_fast_syscall_32+0x321/0x8a0 arch/x86/entry/common.c:459 [] sysenter_flags_fixed+0xd/0x17 netlink: 148 bytes leftover after parsing attributes in process `syz-executor6'. capability: warning: `syz-executor7' uses deprecated v2 capabilities in a way that may be insecure audit: type=1326 audit(1521912614.013:9): auid=4294967295 uid=0 gid=0 ses=4294967295 subj=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 pid=5337 comm="syz-executor7" exe="/root/syz-executor7" sig=31 arch=40000003 syscall=240 compat=1 ip=0xf773aba9 code=0x0 audit: type=1400 audit(1521912614.773:10): avc: denied { write } for pid=5461 comm="syz-executor7" scontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tcontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tclass=netlink_netfilter_socket permissive=1 netlink: 12 bytes leftover after parsing attributes in process `syz-executor7'. netlink: 12 bytes leftover after parsing attributes in process `syz-executor7'. audit: type=1400 audit(1521912614.863:11): avc: denied { set_context_mgr } for pid=5479 comm="syz-executor3" scontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tcontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tclass=binder permissive=1 audit: type=1400 audit(1521912614.893:12): avc: denied { call } for pid=5481 comm="syz-executor1" scontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tcontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tclass=binder permissive=1 binder: 5479:5487 BC_DEAD_BINDER_DONE 00000000ba000003 not found binder_alloc: 5479: binder_alloc_buf, no vma binder: 5481:5489 transaction failed 29189/-3, size 0-0 line 3128 binder: 5479:5487 unknown command 536907575 binder: 5479:5487 ioctl c0306201 20008fd0 returned -22 binder: 5481:5499 transaction failed 29189/-22, size 0-0 line 3005 binder: 5479:5497 BC_DEAD_BINDER_DONE 00000000ba000003 not found binder: undelivered TRANSACTION_ERROR: 29189 binder: undelivered TRANSACTION_ERROR: 29189 SELinux: unrecognized netlink message: protocol=0 nlmsg_type=0 sclass=netlink_route_socket syz-executor2 uses obsolete (PF_INET,SOCK_PACKET) audit: type=1400 audit(1521912615.163:13): avc: denied { create } for pid=5550 comm="syz-executor3" scontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tcontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tclass=netlink_crypto_socket permissive=1 SELinux: unrecognized netlink message: protocol=0 nlmsg_type=0 sclass=netlink_route_socket audit: type=1400 audit(1521912615.333:14): avc: denied { getopt } for pid=5580 comm="syz-executor1" scontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tcontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tclass=netlink_netfilter_socket permissive=1 capability: warning: `syz-executor6' uses 32-bit capabilities (legacy support in use) Empty option to dns_resolver key SELinux: policydb string length 1962941448 does not match expected length 8 Empty option to dns_resolver key SELinux: policydb string length 1962941448 does not match expected length 8 audit: type=1400 audit(1521912615.703:15): avc: denied { create } for pid=5674 comm="syz-executor5" scontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tcontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tclass=netlink_fib_lookup_socket permissive=1 netlink: 11 bytes leftover after parsing attributes in process `syz-executor0'. netlink: 11 bytes leftover after parsing attributes in process `syz-executor0'. SELinux: unrecognized netlink message: protocol=4 nlmsg_type=29 sclass=netlink_tcpdiag_socket audit_printk_skb: 3 callbacks suppressed audit: type=1400 audit(1521912618.133:17): avc: denied { ioctl } for pid=6271 comm="syz-executor3" path="socket:[15749]" dev="sockfs" ino=15749 ioctlcmd=5345 scontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tcontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tclass=netlink_netfilter_socket permissive=1 binder: BINDER_SET_CONTEXT_MGR already set binder: 6317:6319 ioctl 40046207 0 returned -16 binder_alloc: 6357: binder_alloc_buf, no vma audit: type=1400 audit(1521912618.423:18): avc: denied { create } for pid=6329 comm="syz-executor7" scontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tcontext=system_u:object_r:unlabeled_t:s0 tclass=key permissive=1 binder: 6357:6362 transaction failed 29189/-3, size 0-0 line 3128 binder: send failed reply for transaction 9 to 6357:6362 binder_alloc: binder_alloc_mmap_handler: 6357 20000000-20002000 already mapped failed -16 binder: BINDER_SET_CONTEXT_MGR already set binder: 6357:6362 ioctl 40046207 0 returned -16 binder_alloc: 6357: binder_alloc_buf, no vma binder: 6357:6362 transaction failed 29189/-3, size 0-0 line 3128 binder: 6357:6370 got reply transaction with no transaction stack binder: 6357:6370 transaction failed 29201/-71, size 0-0 line 2921 binder: undelivered TRANSACTION_ERROR: 29201 binder: undelivered TRANSACTION_ERROR: 29189 binder: undelivered TRANSACTION_ERROR: 29190 binder: undelivered TRANSACTION_COMPLETE binder: undelivered TRANSACTION_ERROR: 29189 SELinux: unknown mount option SELinux: unrecognized netlink message: protocol=0 nlmsg_type=0 sclass=netlink_route_socket SELinux: unrecognized netlink message: protocol=0 nlmsg_type=0 sclass=netlink_route_socket binder: 6649:6650 transaction failed 29189/-22, size 40-8 line 3005 binder: undelivered TRANSACTION_ERROR: 29189 TCP: request_sock_TCPv6: Possible SYN flooding on port 20002. Sending cookies. Check SNMP counters. IPv6: Can't replace route, no match found IPVS: length: 413 != 24 IPv6: Can't replace route, no match found binder: BINDER_SET_CONTEXT_MGR already set binder: 7058:7069 ioctl 40046207 0 returned -16 binder: 7058:7069 ioctl c0306201 20007000 returned -14 binder_alloc: 7059: binder_alloc_buf size 281470681776128 failed, no address space binder_alloc: allocated: 0 (num: 0 largest: 0), free: 16384 (num: 1 largest: 16384) binder: 7059:7078 transaction failed 29201/-28, size 0-0 line 3128 binder: BINDER_SET_CONTEXT_MGR already set binder: 7059:7088 ioctl 40046207 0 returned -16 SELinux: unrecognized netlink message: protocol=0 nlmsg_type=0 sclass=netlink_route_socket binder_alloc: 7059: binder_alloc_buf, no vma binder: 7059:7092 transaction failed 29189/-3, size 0-0 line 3128 binder: 7059:7088 BC_FREE_BUFFER u0000000020ffa000 no match SELinux: unrecognized netlink message: protocol=0 nlmsg_type=1041 sclass=netlink_route_socket SELinux: unrecognized netlink message: protocol=0 nlmsg_type=0 sclass=netlink_route_socket binder: undelivered TRANSACTION_ERROR: 29189 binder: undelivered TRANSACTION_ERROR: 29201 SELinux: unrecognized netlink message: protocol=0 nlmsg_type=1041 sclass=netlink_route_socket binder: 7058:7105 ioctl c0306201 20007000 returned -14 binder_alloc: binder_alloc_mmap_handler: 7058 20000000-20001000 already mapped failed -16 netlink: 2 bytes leftover after parsing attributes in process `syz-executor1'. netlink: 2 bytes leftover after parsing attributes in process `syz-executor1'. audit: type=1400 audit(1521912622.483:19): avc: denied { transfer } for pid=7336 comm="syz-executor7" scontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tcontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tclass=binder permissive=1 binder: 7336:7337 ioctl 541b 20000200 returned -22 binder: 7336:7337 unknown command 1074555663 binder: 7336:7337 ioctl c0306201 20000100 returned -22 binder: BINDER_SET_CONTEXT_MGR already set binder: 7336:7343 ioctl 40046207 0 returned -16 binder_alloc: 7336: binder_alloc_buf, no vma binder: 7336:7337 transaction failed 29189/-3, size 40-8 line 3128 binder: 7336:7343 ioctl 541b 20000200 returned -22 binder: undelivered TRANSACTION_ERROR: 29189 binder: release 7336:7337 transaction 19 out, still active binder: unexpected work type, 4, not freed binder: undelivered TRANSACTION_COMPLETE binder: send failed reply for transaction 19, target dead SELinux: policydb magic number 0xf97d1a0c does not match expected magic number 0xf97cff8c SELinux: policydb magic number 0xf97d1a0c does not match expected magic number 0xf97cff8c audit: type=1400 audit(1521912622.763:20): avc: denied { bind } for pid=7400 comm="syz-executor7" 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(1521912622.763:21): avc: denied { write } for pid=7391 comm="syz-executor6" scontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tcontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tclass=netlink_fib_lookup_socket permissive=1 SELinux: policydb magic number 0xf97d1a0c does not match expected magic number 0xf97cff8c