====================================================== [ INFO: possible circular locking dependency detected ] 4.4.120-gd63fdf6 #28 Not tainted ------------------------------------------------------- syz-executor3/6948 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-executor3/6948: #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: 6948 Comm: syz-executor3 Not tainted 4.4.120-gd63fdf6 #28 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 0000000000000000 5dc923b4fe6d62e1 ffff8801d6dbf9b8 ffffffff81d0408d ffffffff8519fe60 ffffffff8519fe60 ffffffff851be970 ffff8800b97368f8 ffff8800b9736000 ffff8801d6dbfa00 ffffffff81233ba1 ffff8800b97368f8 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_printk_skb: 15 callbacks suppressed audit: type=1400 audit(1520554309.116:19): avc: denied { getopt } for pid=7105 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=netlink_netfilter_socket permissive=1 audit: type=1400 audit(1520554309.496:20): avc: denied { create } for pid=7175 comm="syz-executor6" scontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tcontext=system_u:object_r:unlabeled_t:s0 tclass=key permissive=1 netlink: 8 bytes leftover after parsing attributes in process `syz-executor5'. netlink: 8 bytes leftover after parsing attributes in process `syz-executor5'. netlink: 8 bytes leftover after parsing attributes in process `syz-executor5'. netlink: 8 bytes leftover after parsing attributes in process `syz-executor5'. netlink: 8 bytes leftover after parsing attributes in process `syz-executor5'. netlink: 8 bytes leftover after parsing attributes in process `syz-executor5'. SELinux: unrecognized netlink message: protocol=0 nlmsg_type=0 sclass=netlink_route_socket kasan: CONFIG_KASAN_INLINE enabled kasan: GPF could be caused by NULL-ptr deref or user memory accessgeneral protection fault: 0000 [#1] PREEMPT SMP KASAN Dumping ftrace buffer: (ftrace buffer empty) Modules linked in: CPU: 0 PID: 7310 Comm: syz-executor6 Not tainted 4.4.120-gd63fdf6 #28 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 audit: type=1400 audit(1520554310.016:21): avc: denied { set_context_mgr } for pid=7314 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: 7314 invalid dec weak, ref 9 desc 0 s 1 w 0 binder: BINDER_SET_CONTEXT_MGR already set binder: 7314:7320 ioctl 40046207 0 returned -16 task: ffff8800b9588000 task.stack: ffff8800b99d0000 RIP: 0010:[] [ 52.562124] audit: type=1400 audit(1520554310.076:22): avc: denied { create } for pid=7326 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_netfilter_socket permissive=1 audit: type=1400 audit(1520554310.076:23): avc: denied { write } for pid=7326 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_netfilter_socket permissive=1 audit: type=1400 audit(1520554310.076:24): avc: denied { ioctl } for pid=7326 comm="syz-executor5" path="socket:[17682]" dev="sockfs" ino=17682 ioctlcmd=54d7 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(1520554310.086:25): avc: denied { create } for pid=7326 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_netfilter_socket permissive=1 audit: type=1400 audit(1520554310.086:26): avc: denied { write } for pid=7326 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_netfilter_socket permissive=1 audit: type=1400 audit(1520554310.086:27): avc: denied { ioctl } for pid=7326 comm="syz-executor5" path="socket:[17688]" dev="sockfs" ino=17688 ioctlcmd=54d7 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 [] __xfrm_policy_check2 include/net/xfrm.h:1070 [inline] [] xfrm_policy_check include/net/xfrm.h:1076 [inline] [] xfrm4_policy_check include/net/xfrm.h:1081 [inline] [] udp_queue_rcv_skb+0x191/0x1560 net/ipv4/udp.c:1517 RSP: 0018:ffff8800b99d7928 EFLAGS: 00010206 RAX: dffffc0000000000 RBX: ffff8800a8f40000 RCX: ffffffff831aa228 RDX: 000000000000000c RSI: ffffc90003ad0000 RDI: 0000000000000060 RBP: ffff8800b99d7968 R08: 0000000000000000 R09: 0000000000000001 R10: 0000000000000000 R11: 1ffff1001733aef6 R12: ffff8800b9b53140 R13: 0000000000000001 R14: 0000000000000000 R15: ffff8800b9b53198 FS: 00007f0bd7ae8700(0000) GS:ffff8801db200000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 0000000000a3eb48 CR3: 00000001d6222000 CR4: 0000000000160670 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Stack: ffff8800a8f40088 ffff880000000001 ffff8800a8f40088 dffffc0000000000 ffff8800a8f40000 0000000000000000 ffffed00151e8086 ffff8800b9b53140 ffff8800b99d79d8 ffffffff82df8cb6 ffff8800a8f40188 ffff8800a8f40190 Call Trace: [] sk_backlog_rcv include/net/sock.h:871 [inline] [] __release_sock net/core/sock.c:2023 [inline] [] release_sock+0x176/0x510 net/core/sock.c:2473 [] udp_sendmsg+0x15c4/0x1c30 net/ipv4/udp.c:1105 [] inet_sendmsg+0x2bc/0x4c0 net/ipv4/af_inet.c:755 [] sock_sendmsg_nosec net/socket.c:625 [inline] [] sock_sendmsg+0xca/0x110 net/socket.c:635 [] SYSC_sendto+0x2c8/0x340 net/socket.c:1665 [] SyS_sendto+0x40/0x50 net/socket.c:1633 [] entry_SYSCALL_64_fastpath+0x1c/0x98 Code: 74 24 58 41 f6 c6 01 0f 85 7f 07 00 00 e8 28 6b 1b fe 49 83 e6 fe 48 b8 00 00 00 00 00 fc ff df 49 8d 7e 60 48 89 fa 48 c1 ea 03 <0f> b6 04 02 84 c0 74 08 3c 01 0f 8e 9f 0b 00 00 41 f6 46 60 04 RIP [] __xfrm_policy_check2 include/net/xfrm.h:1070 [inline] RIP [] xfrm_policy_check include/net/xfrm.h:1076 [inline] RIP [] xfrm4_policy_check include/net/xfrm.h:1081 [inline] RIP [] udp_queue_rcv_skb+0x191/0x1560 net/ipv4/udp.c:1517 RSP ---[ end trace 6fd3d33e7a070d42 ]---