====================================================== [ INFO: possible circular locking dependency detected ] 4.4.120-gd63fdf6 #28 Not tainted ------------------------------------------------------- syz-executor5/11644 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-executor5/11644: #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: 11644 Comm: syz-executor5 Not tainted 4.4.120-gd63fdf6 #28 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 0000000000000000 e5133f9341a76256 ffff8800b6f379b8 ffffffff81d0408d ffffffff851a0010 ffffffff851a0010 ffffffff851bdf50 ffff8800b6cb68f8 ffff8800b6cb6000 ffff8800b6f37a00 ffffffff81233ba1 ffff8800b6cb68f8 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: 12 callbacks suppressed audit: type=1400 audit(1520598067.229:91): avc: denied { set_context_mgr } for pid=11728 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: 11728:11757 BC_INCREFS_DONE u0000000000000000 no match binder: 11728:11763 ioctl c0306201 20000200 returned -14 audit: type=1400 audit(1520598067.359:92): avc: denied { call } for pid=11728 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: BINDER_SET_CONTEXT_MGR already set binder: 11728:11752 ioctl 40046207 0 returned -16 binder_alloc: binder_alloc_mmap_handler: 11728 20000000-20002000 already mapped failed -16 binder: BINDER_SET_CONTEXT_MGR already set binder: 11728:11752 ioctl 40046207 0 returned -16 audit: type=1400 audit(1520598067.399:93): avc: denied { call } for pid=11728 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_alloc: 11728: binder_alloc_buf, no vma binder: 11728:11752 transaction failed 29189/-3, size 40-8 line 3128 binder: 11728:11757 BC_INCREFS_DONE u0000000000000000 no match binder: BINDER_SET_CONTEXT_MGR already set binder: 11728:11752 ioctl 40046207 0 returned -16 binder_alloc: 11728: binder_alloc_buf, no vma binder: 11728:11746 transaction failed 29189/-3, size 40-8 line 3128 IPv6: NLM_F_CREATE should be specified when creating new route sock: sock_set_timeout: `syz-executor4' (pid 11788) tries to set negative timeout audit: type=1400 audit(1520598067.949:94): avc: denied { set_context_mgr } for pid=11782 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 sock: sock_set_timeout: `syz-executor4' (pid 11791) tries to set negative timeout netlink: 8 bytes leftover after parsing attributes in process `syz-executor4'. audit: type=1400 audit(1520598068.059:95): avc: denied { call } for pid=11782 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: BINDER_SET_CONTEXT_MGR already set binder: 11782:11818 ioctl 40046207 0 returned -16 binder: 11782:11789 BC_INCREFS_DONE u0000000000000000 no match binder: 11782:11789 ioctl c0306201 20000200 returned -14 netlink: 8 bytes leftover after parsing attributes in process `syz-executor4'. binder_alloc: 11782: binder_alloc_buf, no vma binder: 11782:11807 transaction failed 29189/-3, size 40-8 line 3128 netlink: 76 bytes leftover after parsing attributes in process `syz-executor2'. netlink: 76 bytes leftover after parsing attributes in process `syz-executor2'. netlink: 180 bytes leftover after parsing attributes in process `syz-executor3'. netlink: 180 bytes leftover after parsing attributes in process `syz-executor3'. audit: type=1400 audit(1520598070.089:96): avc: denied { create } for pid=12156 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_netfilter_socket permissive=1 audit: type=1400 audit(1520598070.129:97): avc: denied { create } for pid=12156 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_netfilter_socket permissive=1 IPVS: Creating netns size=2552 id=10 audit: type=1400 audit(1520598072.309:98): avc: denied { create } for pid=12390 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_crypto_socket permissive=1 netlink: 64 bytes leftover after parsing attributes in process `syz-executor1'. audit: type=1400 audit(1520598072.359:99): avc: denied { create } for pid=12390 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_crypto_socket permissive=1 netlink: 64 bytes leftover after parsing attributes in process `syz-executor1'. audit: type=1400 audit(1520598072.919:100): avc: denied { create } for pid=12452 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 audit: type=1400 audit(1520598073.029:101): avc: denied { create } for pid=12452 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=23739 sclass=netlink_route_socket SELinux: unrecognized netlink message: protocol=0 nlmsg_type=23739 sclass=netlink_route_socket audit: type=1400 audit(1520598074.989:102): avc: denied { set_context_mgr } for pid=12841 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 audit: type=1400 audit(1520598075.059:103): avc: denied { call } for pid=12841 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: BINDER_SET_CONTEXT_MGR already set binder: 12841:12858 ioctl 40046207 0 returned -16 audit: type=1400 audit(1520598075.149:104): avc: denied { call } for pid=12841 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_alloc: 12841: binder_alloc_buf, no vma binder: 12841:12848 transaction failed 29189/-3, size 0-0 line 3128 netlink: 72 bytes leftover after parsing attributes in process `syz-executor4'. netlink: 72 bytes leftover after parsing attributes in process `syz-executor4'. binder_alloc: 12841: binder_alloc_buf, no vma binder: 12841:12880 transaction failed 29189/-3, size 0-0 line 3128 binder: undelivered TRANSACTION_ERROR: 29189 binder: undelivered TRANSACTION_ERROR: 29189 binder: 12903:12909 unknown command 9722892 audit: type=1400 audit(1520598075.339:105): avc: denied { set_context_mgr } for pid=12903 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: 12903:12909 ioctl c0306201 20004000 returned -22 audit: type=1400 audit(1520598075.409:106): avc: denied { call } for pid=12903 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: 12903:12909 unknown command 9722892 binder: 12903:12917 ioctl 40046207 0 returned -16 audit: type=1400 audit(1520598075.469:107): avc: denied { call } for pid=12903 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: 12903:12909 ioctl c0306201 20004000 returned -22 binder_alloc: 12903: binder_alloc_buf, no vma binder: 12903:12928 transaction failed 29189/-3, size 0-0 line 3128 binder_alloc: 12903: binder_alloc_buf, no vma binder: 12903:12932 transaction failed 29189/-3, size 0-0 line 3128 binder: undelivered TRANSACTION_ERROR: 29189 binder: undelivered TRANSACTION_ERROR: 29189 audit: type=1326 audit(1520598075.679:108): auid=4294967295 uid=0 gid=0 ses=4294967295 subj=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 pid=12981 comm="syz-executor6" exe="/root/syz-executor6" sig=31 arch=c000003e syscall=202 compat=0 ip=0x453e69 code=0x0 audit: type=1326 audit(1520598075.759:109): auid=4294967295 uid=0 gid=0 ses=4294967295 subj=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 pid=12981 comm="syz-executor6" exe="/root/syz-executor6" sig=31 arch=c000003e syscall=202 compat=0 ip=0x453e69 code=0x0 netlink: 4 bytes leftover after parsing attributes in process `syz-executor2'. netlink: 4 bytes leftover after parsing attributes in process `syz-executor2'.