====================================================== [ INFO: possible circular locking dependency detected ] 4.4.120-gd63fdf6 #28 Not tainted ------------------------------------------------------- syz-executor1/5802 is trying to acquire lock: (&mm->mmap_sem){++++++}, at: [] __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 [] 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/5802: #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: 5802 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 1ddcfbc4adce645f ffff8800b5a879b8 ffffffff81d0408d ffffffff8519fe60 ffffffff8519fe60 ffffffff851be970 ffff8800afcde8f8 ffff8800afcde000 ffff8800b5a87a00 ffffffff81233ba1 ffff8800afcde8f8 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 audit: type=1400 audit(1520591130.874:12): avc: denied { set_context_mgr } for pid=5821 comm="syz-executor2" 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: BINDER_SET_CONTEXT_MGR already set binder: 5856:5858 ioctl 40046207 0 returned -16 audit: type=1400 audit(1520591130.954:13): avc: denied { call } for pid=5856 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: 5856:5858 transaction failed 29201/-28, size 0-0 line 3128 binder: 5821:5841 BC_DEAD_BINDER_DONE 000036d187660005 not found binder: 5821:5857 BC_DEAD_BINDER_DONE 000036d187660005 not found binder: BINDER_SET_CONTEXT_MGR already set binder: 5856:5869 ioctl 40046207 0 returned -16 binder: BINDER_SET_CONTEXT_MGR already set binder_alloc: 5856: binder_alloc_buf, no vma binder: 5856:5858 ioctl 40046207 0 returned -16 binder: 5856:5878 transaction failed 29189/-3, size 0-0 line 3128 binder: undelivered TRANSACTION_ERROR: 29189 binder: undelivered TRANSACTION_ERROR: 29201 TCP: request_sock_TCPv6: Possible SYN flooding on port 20002. Sending cookies. Check SNMP counters. SELinux: unrecognized netlink message: protocol=6 nlmsg_type=0 sclass=netlink_xfrm_socket SELinux: unrecognized netlink message: protocol=6 nlmsg_type=0 sclass=netlink_xfrm_socket IPv4: Oversized IP packet from 127.0.0.1 TCP: request_sock_TCPv6: Possible SYN flooding on port 20002. Sending cookies. Check SNMP counters. binder: 6125:6132 ioctl 4b3b 20000040 returned -22 netlink: 100 bytes leftover after parsing attributes in process `syz-executor2'. mmap: syz-executor0 (6191) uses deprecated remap_file_pages() syscall. See Documentation/vm/remap_file_pages.txt. capability: warning: `syz-executor4' uses 32-bit capabilities (legacy support in use) binder: BINDER_SET_CONTEXT_MGR already set binder: 6276:6283 ioctl 40046207 0 returned -16 binder_alloc: 6276: binder_alloc_buf, no vma binder: 6276:6289 transaction failed 29189/-3, size 0-0 line 3128 binder_alloc: 6276: binder_alloc_buf, no vma binder: 6276:6283 transaction failed 29189/-3, size 0-0 line 3128 binder: undelivered TRANSACTION_ERROR: 29189 binder: undelivered TRANSACTION_ERROR: 29189 binder: undelivered TRANSACTION_COMPLETE binder: undelivered TRANSACTION_COMPLETE binder: undelivered transaction 12, process died. binder: undelivered transaction 11, process died. binder: 6504:6511 transaction failed 29189/-22, size 0-0 line 3005 binder: undelivered TRANSACTION_ERROR: 29189 binder: 6586:6591 unknown command -512996866 binder: 6586:6591 ioctl c0306201 20007000 returned -22 binder: 6586:6596 BC_REQUEST_DEATH_NOTIFICATION invalid ref 4 binder: 6586:6591 BC_REQUEST_DEATH_NOTIFICATION invalid ref 0 binder: 6586:6591 got transaction to invalid handle binder: 6586:6591 transaction failed 29201/-22, size 88-8 line 3005 binder: 6586:6596 BC_DEAD_BINDER_DONE 0000000000000003 not found binder: 6586:6591 unknown command -512996866 binder: 6586:6607 BC_REQUEST_DEATH_NOTIFICATION invalid ref 4 binder: 6586:6591 ioctl c0306201 20007000 returned -22 binder: 6586:6607 got transaction to invalid handle binder: 6586:6591 BC_REQUEST_DEATH_NOTIFICATION invalid ref 0 binder: 6586:6607 transaction failed 29201/-22, size 88-8 line 3005 syz-executor3 uses obsolete (PF_INET,SOCK_PACKET) binder: 6586:6596 BC_DEAD_BINDER_DONE 0000000000000003 not found binder: 6706:6713 transaction failed 29189/-22, size 40-8 line 3005 binder: 6706:6720 transaction failed 29189/-22, size 40-8 line 3005 binder: undelivered TRANSACTION_ERROR: 29189 binder: undelivered TRANSACTION_ERROR: 29189 SELinux: avc: seqno 7 < latest_notif 8 keychord: invalid keycode count 0 keychord: invalid keycode count 0 SELinux: unrecognized netlink message: protocol=6 nlmsg_type=3418 sclass=netlink_xfrm_socket audit_printk_skb: 12 callbacks suppressed SELinux: unrecognized netlink message: protocol=6 nlmsg_type=3418 sclass=netlink_xfrm_socket audit: type=1400 audit(1520591134.944:18): avc: denied { create } for pid=6901 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 audit: type=1400 audit(1520591135.034:19): avc: denied { create } for pid=6901 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 audit: type=1400 audit(1520591135.274:20): avc: denied { create } for pid=6959 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 audit: type=1400 audit(1520591135.354:21): avc: denied { create } for pid=6959 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 TCP: request_sock_TCPv6: Possible SYN flooding on port 20002. Sending cookies. Check SNMP counters. audit: type=1400 audit(1520591136.024:22): avc: denied { create } for pid=7137 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 IPVS: Creating netns size=2552 id=9 audit: type=1400 audit(1520591136.094:23): avc: denied { create } for pid=7137 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 audit: type=1400 audit(1520591136.124:24): avc: denied { getattr } for pid=7137 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 audit: type=1400 audit(1520591136.124:25): avc: denied { ioctl } for pid=7137 comm="syz-executor3" path="socket:[15930]" dev="sockfs" ino=15930 ioctlcmd=8941 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 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 device lo entered promiscuous mode device lo left promiscuous mode device lo entered promiscuous mode device lo left promiscuous mode SELinux: unrecognized netlink message: protocol=4 nlmsg_type=16 sclass=netlink_tcpdiag_socket audit: type=1400 audit(1520591137.844:26): avc: denied { create } for pid=7465 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(1520591137.934:27): avc: denied { create } for pid=7465 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 TCP: request_sock_TCPv6: Possible SYN flooding on port 20002. Sending cookies. Check SNMP counters. SELinux: unrecognized netlink message: protocol=0 nlmsg_type=64 sclass=netlink_route_socket SELinux: unrecognized netlink message: protocol=0 nlmsg_type=64 sclass=netlink_route_socket SELinux: unknown mount option SELinux: unknown mount option audit_printk_skb: 18 callbacks suppressed audit: type=1400 audit(1520591140.174:34): avc: denied { create } for pid=7978 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(1520591140.224:35): avc: denied { ioctl } for pid=7978 comm="syz-executor1" path="socket:[17295]" dev="sockfs" ino=17295 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_netfilter_socket permissive=1 audit: type=1400 audit(1520591140.264:36): avc: denied { getopt } for pid=7978 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(1520591140.284:37): avc: denied { ioctl } for pid=7978 comm="syz-executor1" path="socket:[17295]" dev="sockfs" ino=17295 ioctlcmd=8904 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(1520591140.324:38): avc: denied { write } for pid=7978 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(1520591140.354:39): avc: denied { create } for pid=7978 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(1520591140.384:40): avc: denied { ioctl } for pid=7978 comm="syz-executor1" path="socket:[17314]" dev="sockfs" ino=17314 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_netfilter_socket permissive=1