====================================================== [ INFO: possible circular locking dependency detected ] 4.4.120-gd63fdf6 #29 Not tainted ------------------------------------------------------- syz-executor6/11601 is trying to acquire lock: (&mm->mmap_sem){++++++}[ 80.235894] l2tp_core: tunl 2: sockfd_lookup(fd=20) returned -9 , at: [ 80.244331] l2tp_core: tunl 2: sockfd_lookup(fd=23) returned -9 [] __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-executor6/11601: #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: 11601 Comm: syz-executor6 Not tainted 4.4.120-gd63fdf6 #29 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 0000000000000000 2d38e7f7560867f4 ffff8801d327f8a8 ffffffff81d0408d ffffffff851a0010 ffffffff851a0010 ffffffff851becd0 ffff8800b5ce68f8 ffff8800b5ce6000 ffff8801d327f8f0 ffffffff81233ba1 ffff8800b5ce68f8 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 SELinux: unrecognized netlink message: protocol=4 nlmsg_type=770 sclass=netlink_tcpdiag_socket binder: 11631:11636 ioctl 5609 20000000 returned -22 TCP: request_sock_TCP: Possible SYN flooding on port 20002. Sending cookies. Check SNMP counters. binder: release 11627:11630 transaction 96 in, still active binder: send failed reply for transaction 96 to 11627:11638 binder: BINDER_SET_CONTEXT_MGR already set binder: 11627:11638 ioctl 40046207 0 returned -16 binder: 11627:11630 ioctl c0306201 20004000 returned -14 binder: 11631:11636 ioctl 5609 20000000 returned -22 SELinux: unrecognized netlink message: protocol=4 nlmsg_type=770 sclass=netlink_tcpdiag_socket binder_alloc: 11627: binder_alloc_buf, no vma binder: 11627:11638 transaction failed 29189/-3, size 0-0 line 3128 binder: undelivered TRANSACTION_ERROR: 29189 binder: undelivered TRANSACTION_COMPLETE binder: undelivered TRANSACTION_ERROR: 29189 SELinux: unrecognized netlink message: protocol=0 nlmsg_type=0 sclass=netlink_route_socket audit: type=1401 audit(1521349989.895:66): op=fscreate invalid_context=FA audit: type=1401 audit(1521349989.915:67): op=fscreate invalid_context=FA binder: BINDER_SET_CONTEXT_MGR already set binder: 11806:11812 ioctl 40046207 0 returned -16 binder: 11806:11812 unknown command 0 binder: 11806:11812 ioctl c0306201 20007000 returned -22 netlink: 4 bytes leftover after parsing attributes in process `syz-executor7'. netlink: 4 bytes leftover after parsing attributes in process `syz-executor7'. device bridge0 entered promiscuous mode binder: 12140:12146 ERROR: BC_REGISTER_LOOPER called without request binder: 12140:12153 unknown command 0 binder: 12140:12153 ioctl c0306201 2000a000 returned -22 binder: BINDER_SET_CONTEXT_MGR already set binder: 12140:12153 ioctl 40046207 0 returned -16 binder: 12140:12146 ERROR: BC_REGISTER_LOOPER called without request binder: release 12140:12146 transaction 103 in, still active binder: send failed reply for transaction 103 to 12140:12153 binder: undelivered TRANSACTION_COMPLETE binder: undelivered TRANSACTION_ERROR: 29189 SELinux: unrecognized netlink message: protocol=0 nlmsg_type=56080 sclass=netlink_route_socket SELinux: unrecognized netlink message: protocol=0 nlmsg_type=56080 sclass=netlink_route_socket audit: type=1400 audit(1521349991.935:68): avc: denied { create } for pid=12248 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_fib_lookup_socket permissive=1 binder: 12250:12254 ioctl 7 20001200 returned -22 binder: 12250:12254 ioctl 7 20001200 returned -22 binder: 12296:12299 unknown command 36345995 SELinux: unrecognized netlink message: protocol=0 nlmsg_type=28082 sclass=netlink_route_socket binder: 12296:12299 ioctl c0306201 20008fd0 returned -22 binder_alloc: binder_alloc_mmap_handler: 12296 20000000-20002000 already mapped failed -16 binder: BINDER_SET_CONTEXT_MGR already set binder: 12296:12308 ioctl 40046207 0 returned -16 binder: 12296:12299 unknown command 36345995 binder: 12296:12299 ioctl c0306201 20008fd0 returned -22 binder_alloc: 12296: binder_alloc_buf, no vma binder: 12296:12308 transaction failed 29189/-3, size 0-0 line 3128 SELinux: unrecognized netlink message: protocol=0 nlmsg_type=28082 sclass=netlink_route_socket binder: release 12296:12299 transaction 105 out, still active binder: undelivered TRANSACTION_COMPLETE binder: send failed reply for transaction 105, target dead binder: undelivered TRANSACTION_ERROR: 29189 sock: process `syz-executor3' is using obsolete setsockopt SO_BSDCOMPAT SELinux: unrecognized netlink message: protocol=0 nlmsg_type=4 sclass=netlink_route_socket SELinux: unrecognized netlink message: protocol=0 nlmsg_type=4 sclass=netlink_route_socket netlink: 3 bytes leftover after parsing attributes in process `syz-executor4'. netlink: 3 bytes leftover after parsing attributes in process `syz-executor4'. binder: 12680:12687 ioctl c018620b 20000040 returned -14 binder: 12680:12696 ioctl c018620b 20000040 returned -14 binder: 12719:12738 unknown command 1212703505 binder: 12719:12738 ioctl c0306201 20007000 returned -22 binder: 12719:12739 ioctl c0306201 20004000 returned -14 binder: BINDER_SET_CONTEXT_MGR already set binder: 12719:12738 ioctl 40046207 0 returned -16 binder_alloc: binder_alloc_mmap_handler: 12719 20000000-20001000 already mapped failed -16 binder: 12719:12740 unknown command 1212703505 binder: 12719:12740 ioctl c0306201 20007000 returned -22 BUG: using __this_cpu_read() in preemptible [00000000] code: syz-executor6/12770 caller is __this_cpu_preempt_check+0x1c/0x20 lib/smp_processor_id.c:62 CPU: 0 PID: 12770 Comm: syz-executor6 Not tainted 4.4.120-gd63fdf6 #29 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 0000000000000000 3d5b7eeb018870b6 ffff8801c2137648 ffffffff81d0408d 0000000000000000 ffffffff839fe5a0 ffffffff83d0be20 ffff8800ac3eb000 0000000000000003 ffff8801c2137688 ffffffff81d63fe4 ffff8801c21376a0 Call Trace: [] __dump_stack lib/dump_stack.c:15 [inline] [] dump_stack+0xc1/0x124 lib/dump_stack.c:51 [] check_preemption_disabled+0x1d4/0x200 lib/smp_processor_id.c:46 [] __this_cpu_preempt_check+0x1c/0x20 lib/smp_processor_id.c:62 [] ipcomp_alloc_tfms net/xfrm/xfrm_ipcomp.c:286 [inline] [] ipcomp_init_state+0x188/0x980 net/xfrm/xfrm_ipcomp.c:363 [] ipcomp4_init_state+0xb0/0x7d0 net/ipv4/ipcomp.c:137 [] __xfrm_init_state+0x3e7/0xb30 net/xfrm/xfrm_state.c:2058 [] xfrm_init_state+0x1a/0x20 net/xfrm/xfrm_state.c:2084 [] pfkey_msg2xfrm_state net/key/af_key.c:1289 [inline] [] pfkey_add+0x1fbb/0x3490 net/key/af_key.c:1506 [] pfkey_process+0x68b/0x750 net/key/af_key.c:2834 [] pfkey_sendmsg+0x3a9/0x760 net/key/af_key.c:3678 [] sock_sendmsg_nosec net/socket.c:625 [inline] [] sock_sendmsg+0xca/0x110 net/socket.c:635 [] ___sys_sendmsg+0x6c1/0x7c0 net/socket.c:1962 [] __sys_sendmsg+0xd3/0x190 net/socket.c:1996 [] C_SYSC_sendmsg net/compat.c:720 [inline] [] compat_SyS_sendmsg+0x2a/0x40 net/compat.c:718 [] 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 BUG: using __this_cpu_read() in preemptible [00000000] code: syz-executor6/12770 caller is __this_cpu_preempt_check+0x1c/0x20 lib/smp_processor_id.c:62 CPU: 0 PID: 12770 Comm: syz-executor6 Not tainted 4.4.120-gd63fdf6 #29 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 0000000000000000 3d5b7eeb018870b6 ffff8801c2137648 ffffffff81d0408d 0000000000000000 ffffffff839fe5a0 ffffffff83d0be20 ffff8800ac3eb000 0000000000000003 ffff8801c2137688 ffffffff81d63fe4 ffff8801c21376a0 Call Trace: [] __dump_stack lib/dump_stack.c:15 [inline] [] dump_stack+0xc1/0x124 lib/dump_stack.c:51 [] check_preemption_disabled+0x1d4/0x200 lib/smp_processor_id.c:46 [] __this_cpu_preempt_check+0x1c/0x20 lib/smp_processor_id.c:62 [] ipcomp_alloc_tfms net/xfrm/xfrm_ipcomp.c:286 [inline] [] ipcomp_init_state+0x188/0x980 net/xfrm/xfrm_ipcomp.c:363 [] ipcomp4_init_state+0xb0/0x7d0 net/ipv4/ipcomp.c:137 [] __xfrm_init_state+0x3e7/0xb30 net/xfrm/xfrm_state.c:2058 [] xfrm_init_state+0x1a/0x20 net/xfrm/xfrm_state.c:2084 [] pfkey_msg2xfrm_state net/key/af_key.c:1289 [inline] [] pfkey_add+0x1fbb/0x3490 net/key/af_key.c:1506 [] pfkey_process+0x68b/0x750 net/key/af_key.c:2834 [] pfkey_sendmsg+0x3a9/0x760 net/key/af_key.c:3678 [] sock_sendmsg_nosec net/socket.c:625 [inline] [] sock_sendmsg+0xca/0x110 net/socket.c:635 [] ___sys_sendmsg+0x6c1/0x7c0 net/socket.c:1962 [] __sys_sendmsg+0xd3/0x190 net/socket.c:1996 [] C_SYSC_sendmsg net/compat.c:720 [inline] [] compat_SyS_sendmsg+0x2a/0x40 net/compat.c:718 [] 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 TCP: request_sock_TCPv6: Possible SYN flooding on port 20002. Sending cookies. Check SNMP counters. audit: type=1400 audit(1521349995.415:69): avc: denied { transfer } for pid=13025 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 netlink: 3 bytes leftover after parsing attributes in process `syz-executor6'. netlink: 3 bytes leftover after parsing attributes in process `syz-executor6'. binder: 13025:13046 BC_INCREFS_DONE u00000000204edf8a node 110 cookie mismatch 0000000000000000 != 0000000000000001 binder_alloc: binder_alloc_mmap_handler: 13025 20000000-20002000 already mapped failed -16 binder: BINDER_SET_CONTEXT_MGR already set binder: 13025:13046 ioctl 40046207 0 returned -16 binder_alloc: 13025: binder_alloc_buf, no vma binder: 13025:13069 transaction failed 29189/-3, size 40-8 line 3128 binder: release 13025:13029 transaction 109 out, still active binder: unexpected work type, 4, not freed binder: undelivered TRANSACTION_COMPLETE binder: send failed reply for transaction 109, target dead SELinux: unrecognized netlink message: protocol=0 nlmsg_type=0 sclass=netlink_route_socket IPv4: Oversized IP packet from 127.0.0.1 netlink: 8 bytes leftover after parsing attributes in process `syz-executor4'. netlink: 8 bytes leftover after parsing attributes in process `syz-executor4'. binder: 13459:13460 BC_FREE_BUFFER u000000002000c000 matched unreturned buffer binder: BINDER_SET_CONTEXT_MGR already set binder: 13459:13460 ioctl 40046207 0 returned -16 binder_alloc: 13459: binder_alloc_buf, no vma binder: 13459:13461 transaction failed 29189/-3, size 0-0 line 3128 binder: 13459:13462 BC_FREE_BUFFER u000000002000c000 no match binder: undelivered TRANSACTION_ERROR: 29189 binder: release 13459:13460 transaction 114 out, still active device syz_tun entered promiscuous mode binder: 13467:13476 ioctl 4b49 20000100 returned -22 binder: undelivered TRANSACTION_COMPLETE binder: send failed reply for transaction 114, target dead device syz_tun left promiscuous mode SELinux: unrecognized netlink message: protocol=0 nlmsg_type=260 sclass=netlink_route_socket SELinux: unrecognized netlink message: protocol=0 nlmsg_type=260 sclass=netlink_route_socket binder: send failed reply for transaction 117 to 13634:13640 binder_alloc: 13634: binder_alloc_buf, no vma binder: 13634:13640 transaction failed 29189/-3, size 40-8 line 3128 binder: 13634:13640 BC_INCREFS_DONE u0000000000000000 no match binder: undelivered TRANSACTION_ERROR: 29189 SELinux: unrecognized netlink message: protocol=0 nlmsg_type=19856 sclass=netlink_route_socket SELinux: unrecognized netlink message: protocol=0 nlmsg_type=19856 sclass=netlink_route_socket netlink: 11 bytes leftover after parsing attributes in process `syz-executor2'. netlink: 11 bytes leftover after parsing attributes in process `syz-executor2'.