audit: type=1400 audit(1520887876.042:61): avc: denied { create } for pid=9845 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_crypto_socket permissive=1 ====================================================== [ INFO: possible circular locking dependency detected ] 4.4.120-gd63fdf6 #28 Not tainted audit: type=1400 audit(1520887876.092:62): avc: denied { set_context_mgr } for pid=9851 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 binder: 9851:9865 unknown command 1074029327 binder: 9851:9865 ioctl c0306201 20007000 returned -22 ------------------------------------------------------- syz-executor1/9864 is trying to acquire lock: (&mm->mmap_sem){++++++}, at: [ 66.619501] audit: type=1400 audit(1520887876.132:63): avc: denied { set_context_mgr } for pid=9851 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 binder: 9851:9876 unknown command 1074029327 binder: 9851:9876 ioctl c0306201 20007000 returned -22 [] __might_fault+0xe4/0x1d0 mm/memory.c:3809 but task is already holding lock: audit: type=1400 audit(1520887876.192:64): avc: denied { dyntransition } for pid=9883 comm="syz-executor6" scontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tcontext=unconfined_u:system_r:insmod_t:s0-s0:c0,c1 tclass=process permissive=1 (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 [] SYSC_mmap arch/x86/kernel/sys_x86_64.c:95 [inline] [] SyS_mmap+0x16/0x20 arch/x86/kernel/sys_x86_64.c:86 [] entry_SYSCALL_64_fastpath+0x1c/0x98 [] 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 [] vfs_ioctl fs/ioctl.c:43 [inline] [] do_vfs_ioctl+0x7aa/0xee0 fs/ioctl.c:607 [] SYSC_ioctl fs/ioctl.c:622 [inline] [] SyS_ioctl+0x8f/0xc0 fs/ioctl.c:613 [] entry_SYSCALL_64_fastpath+0x1c/0x98 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-executor1/9864: #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: 1 PID: 9864 Comm: syz-executor1 Not tainted 4.4.120-gd63fdf6 #28 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 0000000000000000 537f5027cf3d41ee ffff8801d14d79b8 ffffffff81d0408d ffffffff851a0010 ffffffff851a0010 ffffffff851be610 ffff8800a90788f8 ffff8800a9078000 ffff8801d14d7a00 ffffffff81233ba1 ffff8800a90788f8 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 [] vfs_ioctl fs/ioctl.c:43 [inline] [] do_vfs_ioctl+0x7aa/0xee0 fs/ioctl.c:607 [] SYSC_ioctl fs/ioctl.c:622 [inline] [] SyS_ioctl+0x8f/0xc0 fs/ioctl.c:613 [] entry_SYSCALL_64_fastpath+0x1c/0x98 netlink: 4964 bytes leftover after parsing attributes in process `syz-executor7'. netlink: 4964 bytes leftover after parsing attributes in process `syz-executor7'. audit: type=1400 audit(1520887876.962:65): avc: denied { create } for pid=9949 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_generic_socket permissive=1 capability: warning: `syz-executor7' uses deprecated v2 capabilities in a way that may be insecure audit: type=1400 audit(1520887877.172:66): avc: denied { set_context_mgr } for pid=10003 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=binder permissive=1 binder: 10003:10005 BC_CLEAR_DEATH_NOTIFICATION death notification cookie mismatch 00000000000075cb != 0000000000000000 binder: 10184:10186 Release 1 refcount change on invalid ref 1 ret -22 binder: 10184:10186 got reply transaction with no transaction stack binder: 10184:10186 transaction failed 29201/-71, size 24-32 line 2921 binder: 10184:10186 Release 1 refcount change on invalid ref 1 ret -22 binder: BINDER_SET_CONTEXT_MGR already set binder: 10184:10186 got reply transaction with no transaction stack binder: 10184:10213 ioctl 40046207 0 returned -16 binder: 10184:10186 transaction failed 29201/-71, size 24-32 line 2921 binder: undelivered TRANSACTION_ERROR: 29201 binder: undelivered TRANSACTION_ERROR: 29201 pktgen: kernel_thread() failed for cpu 1 pktgen: Cannot create thread for cpu 1 (-4) IPVS: Creating netns size=2552 id=9 pktgen: kernel_thread() failed for cpu 0 pktgen: Cannot create thread for cpu 0 (-4) pktgen: kernel_thread() failed for cpu 1 pktgen: Cannot create thread for cpu 1 (-4) pktgen: Initialization failed for all threads A link change request failed with some changes committed already. Interface syz_tun may have been left with an inconsistent configuration, please check. A link change request failed with some changes committed already. Interface syz_tun may have been left with an inconsistent configuration, please check. binder: 10572:10579 transaction failed 29189/-22, size 0-0 line 3005 binder: 10572:10579 transaction failed 29189/-22, size 0-0 line 3005 binder: undelivered TRANSACTION_ERROR: 29189 binder: undelivered TRANSACTION_ERROR: 29189 audit_printk_skb: 69 callbacks suppressed audit: type=1400 audit(1520887879.952:90): avc: denied { set_context_mgr } for pid=10605 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=binder permissive=1 binder: 10605:10627 BC_INCREFS_DONE u0000000000000000 no match binder: BINDER_SET_CONTEXT_MGR already set audit: type=1400 audit(1520887880.072:91): avc: denied { call } for pid=10605 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=binder permissive=1 binder_alloc: 10605: binder_alloc_buf, no vma binder: 10605:10631 transaction failed 29189/-3, size 40-8 line 3128 binder: 10605:10644 ioctl 40046207 0 returned -16 binder: 10605:10627 transaction failed 29189/-22, size 40-8 line 3005 IPVS: Creating netns size=2552 id=10 binder: 10605:10610 BC_INCREFS_DONE u0000000000000000 no match audit: type=1400 audit(1520887881.122:92): avc: denied { set_context_mgr } for pid=10861 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=binder permissive=1 binder: 10861:10871 transaction failed 29189/-22, size 0-0 line 3005 netlink: 268 bytes leftover after parsing attributes in process `syz-executor4'. binder_alloc: binder_alloc_mmap_handler: 10861 20000000-20002000 already mapped failed -16 binder: 10884:10887 ioctl 4b4a 200000c0 returned -22 binder: 10884:10890 ioctl 4b4a 200000c0 returned -22 binder: BINDER_SET_CONTEXT_MGR already set binder: 10861:10863 ioctl 40046207 0 returned -16 binder: 10861:10863 unknown command 0 binder: 10861:10871 transaction failed 29189/-22, size 0-0 line 3005 binder: 10861:10863 ioctl c0306201 2000a000 returned -22 binder: undelivered TRANSACTION_ERROR: 29189 binder: undelivered TRANSACTION_ERROR: 29189 audit: type=1400 audit(1520887881.382:93): avc: denied { create } for pid=10909 comm="syz-executor0" 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(1520887881.422:94): avc: denied { ioctl } for pid=10909 comm="syz-executor0" path="socket:[24133]" dev="sockfs" ino=24133 ioctlcmd=8903 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 IPv4: Oversized IP packet from 127.0.0.1 audit: type=1400 audit(1520887881.482:95): avc: denied { create } for pid=10909 comm="syz-executor0" 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(1520887881.482:96): avc: denied { ioctl } for pid=10909 comm="syz-executor0" path="socket:[24142]" dev="sockfs" ino=24142 ioctlcmd=8903 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(1520887881.562:97): avc: denied { create } for pid=10957 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 audit: type=1400 audit(1520887881.622:98): avc: denied { setattr } for pid=10957 comm="syz-executor1" name="NETLINK" dev="sockfs" ino=23383 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 audit: type=1400 audit(1520887881.662:99): avc: denied { create } for pid=10957 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 binder: 11068:11077 Release 1 refcount change on invalid ref 3 ret -22 binder: 11068:11077 got transaction to invalid handle binder: 11068:11087 unknown command 681879455 binder: 11068:11087 ioctl c0306201 20008fd0 returned -22 binder: 11068:11103 BC_CLEAR_DEATH_NOTIFICATION death notification not active binder: 11068:11077 transaction failed 29201/-22, size 0-56 line 3005 binder: BINDER_SET_CONTEXT_MGR already set binder: 11068:11103 ioctl 40046207 0 returned -16 binder: 11068:11103 Release 1 refcount change on invalid ref 3 ret -22 binder: 11068:11103 got transaction to invalid handle binder: 11068:11103 transaction failed 29201/-22, size 0-56 line 3005 binder: 11068:11110 unknown command 681879455 binder: 11068:11110 ioctl c0306201 20008fd0 returned -22 binder: 11068:11103 BC_CLEAR_DEATH_NOTIFICATION death notification not active IPVS: Creating netns size=2552 id=11 IPVS: Creating netns size=2552 id=12 binder: 11473:11495 transaction failed 29189/-22, size 40-8 line 3005 binder: 11473:11481 BC_INCREFS_DONE node 44 has no pending increfs request binder: BINDER_SET_CONTEXT_MGR already set binder: 11473:11503 BC_INCREFS_DONE u0000000000000000 no match binder: 11473:11481 ioctl 40046207 0 returned -16 binder: release 11473:11495 transaction 45 out, still active binder: send failed reply for transaction 45, target dead binder: 11557:11560 transaction failed 29201/-28, size 0-0 line 3128 binder: BINDER_SET_CONTEXT_MGR already set binder: 11557:11560 ioctl 40046207 0 returned -16 binder: 11557:11580 transaction failed 29201/-28, size 0-0 line 3128 binder: BINDER_SET_CONTEXT_MGR already set binder: 11577:11590 ioctl 40046207 0 returned -16 binder: undelivered TRANSACTION_ERROR: 29201 binder: undelivered TRANSACTION_ERROR: 29201 binder: 11577:11598 transaction failed 29189/-22, size 0-0 line 3005 binder_alloc: binder_alloc_mmap_handler: 11577 20000000-20002000 already mapped failed -16 binder: 11577:11590 unknown command 0 binder_alloc: 11577: binder_alloc_buf, no vma binder: 11577:11603 transaction failed 29189/-3, size 0-0 line 3128 binder: 11577:11590 ioctl c0306201 2000a000 returned -22 device syz_tun entered promiscuous mode binder: undelivered TRANSACTION_ERROR: 29189 binder: undelivered TRANSACTION_ERROR: 29189 device syz_tun left promiscuous mode netlink: 12 bytes leftover after parsing attributes in process `syz-executor1'. TCP: request_sock_TCPv6: Possible SYN flooding on port 20002. Sending cookies. Check SNMP counters. netlink: 12 bytes leftover after parsing attributes in process `syz-executor0'. binder: 11737:11742 unknown command 336072208 binder: 11737:11742 ioctl c0306201 20000000 returned -22 binder: 11737:11742 unknown command 336072208 binder: 11737:11742 ioctl c0306201 20000000 returned -22 audit_printk_skb: 54 callbacks suppressed netlink: 12 bytes leftover after parsing attributes in process `syz-executor4'. netlink: 12 bytes leftover after parsing attributes in process `syz-executor4'. audit: type=1400 audit(1520887885.602:118): avc: denied { create } for pid=11753 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_iscsi_socket permissive=1 audit: type=1400 audit(1520887885.662:119): avc: denied { create } for pid=11753 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_iscsi_socket permissive=1 audit: type=1400 audit(1520887885.662:120): avc: denied { set_context_mgr } for pid=11773 comm="syz-executor0" 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: 11773:11776 BC_REQUEST_DEATH_NOTIFICATION death notification already set binder: BINDER_SET_CONTEXT_MGR already set binder: 11773:11776 ioctl 40046207 0 returned -16