====================================================== [ INFO: possible circular locking dependency detected ] 4.9.84-ga9d0273 #44 Not tainted ------------------------------------------------------- syz-executor5/9968 is trying to acquire lock: (&mm->mmap_sem){++++++}, at: [] __might_fault+0xe4/0x1d0 mm/memory.c:3993 but task is already holding lock: (ashmem_mutex){+.+.+.}, at: [] ashmem_pin_unpin drivers/staging/android/ashmem.c:714 [inline] (ashmem_mutex){+.+.+.}, at: [] ashmem_ioctl+0x371/0xfe0 drivers/staging/android/ashmem.c:791 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: lock_acquire+0x12e/0x410 kernel/locking/lockdep.c:3756 __mutex_lock_common kernel/locking/mutex.c:521 [inline] mutex_lock_nested+0xbb/0x870 kernel/locking/mutex.c:621 ashmem_mmap+0x53/0x400 drivers/staging/android/ashmem.c:379 mmap_region+0x7dd/0xfd0 mm/mmap.c:1694 do_mmap+0x57b/0xbe0 mm/mmap.c:1473 do_mmap_pgoff include/linux/mm.h:2019 [inline] vm_mmap_pgoff+0x16b/0x1b0 mm/util.c:329 SYSC_mmap_pgoff mm/mmap.c:1523 [inline] SyS_mmap_pgoff+0x33f/0x560 mm/mmap.c:1481 SYSC_mmap arch/x86/kernel/sys_x86_64.c:95 [inline] SyS_mmap+0x16/0x20 arch/x86/kernel/sys_x86_64.c:86 do_syscall_64+0x1a4/0x490 arch/x86/entry/common.c:282 entry_SYSCALL_64_after_swapgs+0x47/0xc5 check_prev_add kernel/locking/lockdep.c:1828 [inline] check_prevs_add kernel/locking/lockdep.c:1938 [inline] validate_chain kernel/locking/lockdep.c:2265 [inline] __lock_acquire+0x2bf9/0x3640 kernel/locking/lockdep.c:3345 lock_acquire+0x12e/0x410 kernel/locking/lockdep.c:3756 __might_fault+0x14a/0x1d0 mm/memory.c:3994 copy_from_user arch/x86/include/asm/uaccess.h:705 [inline] ashmem_pin_unpin drivers/staging/android/ashmem.c:719 [inline] ashmem_ioctl+0x3c0/0xfe0 drivers/staging/android/ashmem.c:791 vfs_ioctl fs/ioctl.c:43 [inline] do_vfs_ioctl+0x1aa/0x1140 fs/ioctl.c:679 SYSC_ioctl fs/ioctl.c:694 [inline] SyS_ioctl+0x8f/0xc0 fs/ioctl.c:685 do_syscall_64+0x1a4/0x490 arch/x86/entry/common.c:282 entry_SYSCALL_64_after_swapgs+0x47/0xc5 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/9968: #0: (ashmem_mutex){+.+.+.}, at: [] ashmem_pin_unpin drivers/staging/android/ashmem.c:714 [inline] #0: (ashmem_mutex){+.+.+.}, at: [] ashmem_ioctl+0x371/0xfe0 drivers/staging/android/ashmem.c:791 stack backtrace: CPU: 1 PID: 9968 Comm: syz-executor5 Not tainted 4.9.84-ga9d0273 #44 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 ffff8801d507f908 ffffffff81d956b9 ffffffff853a2e80 ffffffff853a2e80 ffffffff853c2f80 ffff8801d65968d8 ffff8801d6596000 ffff8801d507f950 ffffffff812387f1 ffff8801d65968d8 00000000d65968b0 ffff8801d65968d8 Call Trace: [] __dump_stack lib/dump_stack.c:15 [inline] [] dump_stack+0xc1/0x128 lib/dump_stack.c:51 [] print_circular_bug+0x271/0x310 kernel/locking/lockdep.c:1202 [] check_prev_add kernel/locking/lockdep.c:1828 [inline] [] check_prevs_add kernel/locking/lockdep.c:1938 [inline] [] validate_chain kernel/locking/lockdep.c:2265 [inline] [] __lock_acquire+0x2bf9/0x3640 kernel/locking/lockdep.c:3345 [] lock_acquire+0x12e/0x410 kernel/locking/lockdep.c:3756 [] __might_fault+0x14a/0x1d0 mm/memory.c:3994 [] copy_from_user arch/x86/include/asm/uaccess.h:705 [inline] [] ashmem_pin_unpin drivers/staging/android/ashmem.c:719 [inline] [] ashmem_ioctl+0x3c0/0xfe0 drivers/staging/android/ashmem.c:791 [] vfs_ioctl fs/ioctl.c:43 [inline] [] do_vfs_ioctl+0x1aa/0x1140 fs/ioctl.c:679 [] SYSC_ioctl fs/ioctl.c:694 [inline] [] SyS_ioctl+0x8f/0xc0 fs/ioctl.c:685 [] do_syscall_64+0x1a4/0x490 arch/x86/entry/common.c:282 [] entry_SYSCALL_64_after_swapgs+0x47/0xc5 audit: type=1400 audit(1519645928.621:39): avc: denied { read } for pid=10016 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=netlink_netfilter_socket permissive=1 tmpfs: Bad mount option tmpfs: Bad mount option IPVS: Creating netns size=2536 id=12 device eql entered promiscuous mode FAULT_FLAG_ALLOW_RETRY missing 30 CPU: 1 PID: 10353 Comm: syz-executor2 Not tainted 4.9.84-ga9d0273 #44 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 ffff8801cc837910 ffffffff81d956b9 ffff8801cc837bf0 0000000000000000 ffff8801cbba5010 ffff8801cc837ae0 ffff8801cbba4f00 ffff8801cc837b08 ffffffff816626da ffffffff838a6155 ffff8801cc837a60 00000001c0213067 Call Trace: [] __dump_stack lib/dump_stack.c:15 [inline] [] dump_stack+0xc1/0x128 lib/dump_stack.c:51 [] handle_userfault+0xa3a/0x1310 fs/userfaultfd.c:323 [] do_anonymous_page mm/memory.c:2747 [inline] [] handle_pte_fault mm/memory.c:3488 [inline] [] __handle_mm_fault mm/memory.c:3577 [inline] [] handle_mm_fault+0x1fd1/0x2530 mm/memory.c:3614 [] __do_page_fault+0x5c2/0xd40 arch/x86/mm/fault.c:1407 [] do_page_fault+0x27/0x30 arch/x86/mm/fault.c:1470 [] page_fault+0x28/0x30 arch/x86/entry/entry_64.S:939 [] do_syscall_64+0x1a4/0x490 arch/x86/entry/common.c:282 [] entry_SYSCALL_64_after_swapgs+0x47/0xc5 binder: 10368:10370 unknown command 1 binder: 10371:10373 ERROR: BC_REGISTER_LOOPER called after BC_ENTER_LOOPER binder: 10371:10379 ERROR: BC_REGISTER_LOOPER called without request binder: 10368:10370 ioctl c0306201 20098fd0 returned -22 binder: 10368:10386 got transaction with invalid handle, 0 binder: 10368:10386 transaction failed 29201/-22, size 24-8 line 3219 binder: BINDER_SET_CONTEXT_MGR already set binder: 10368:10386 ioctl 40046207 0 returned -16 binder_alloc: binder_alloc_mmap_handler: 10368 20000000-20001000 already mapped failed -16 binder_alloc: 10368: binder_alloc_buf, no vma binder: 10368:10400 transaction failed 29189/-3, size 24-8 line 3127 binder: undelivered TRANSACTION_ERROR: 29201 binder: undelivered TRANSACTION_ERROR: 29189 IPv4: Oversized IP packet from 127.0.0.1 IPv4: Oversized IP packet from 127.0.0.1 IPv4: Oversized IP packet from 127.0.0.1 binder: BINDER_SET_CONTEXT_MGR already set IPv4: Oversized IP packet from 127.0.0.1 binder: 10574:10575 ioctl 40046207 0 returned -16 IPv4: Oversized IP packet from 127.0.0.1 IPv4: Oversized IP packet from 127.0.0.1 IPv4: Oversized IP packet from 127.0.0.1 IPv4: Oversized IP packet from 127.0.0.1 netlink: 12 bytes leftover after parsing attributes in process `syz-executor0'. binder: 10741:10742 unknown command 0 netlink: 12 bytes leftover after parsing attributes in process `syz-executor0'. IPv4: Oversized IP packet from 127.0.0.1 binder: 10741:10742 ioctl c0306201 20000040 returned -22 binder: BINDER_SET_CONTEXT_MGR already set binder: 10741:10753 ioctl 40046207 0 returned -16 binder: 10741:10764 unknown command 0 binder: 10741:10764 ioctl c0306201 20000040 returned -22 IPv4: Oversized IP packet from 127.0.0.1 l2tp_core: tunl 59: closing all sessions... l2tp_core: tunl 59: closing all sessions... audit: type=1400 audit(1519645931.131:40): avc: denied { read } for pid=10836 comm="syz-executor6" path="socket:[26054]" dev="sockfs" ino=26054 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 l2tp_core: tunl 59: closing... l2tp_core: tunl 59: closing all sessions... l2tp_core: tunl 59: free... netlink: 12 bytes leftover after parsing attributes in process `syz-executor0'. netlink: 12 bytes leftover after parsing attributes in process `syz-executor0'. netlink: 12 bytes leftover after parsing attributes in process `syz-executor0'. netlink: 12 bytes leftover after parsing attributes in process `syz-executor0'. netlink: 12 bytes leftover after parsing attributes in process `syz-executor0'. netlink: 12 bytes leftover after parsing attributes in process `syz-executor0'. netlink: 12 bytes leftover after parsing attributes in process `syz-executor0'. audit: type=1400 audit(1519645932.131:41): avc: denied { create } for pid=11129 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_iscsi_socket permissive=1 SELinux: unrecognized netlink message: protocol=0 nlmsg_type=0 sclass=netlink_route_socket pig=11142 comm=syz-executor0 SELinux: unrecognized netlink message: protocol=0 nlmsg_type=0 sclass=netlink_route_socket pig=11170 comm=syz-executor0 device syz0 entered promiscuous mode binder: 11399:11404 transaction failed 29189/-22, size 0-0 line 3004 binder: 11399:11414 transaction failed 29189/-22, size 0-0 line 3004 nla_parse: 1 callbacks suppressed netlink: 12 bytes leftover after parsing attributes in process `syz-executor0'. netlink: 12 bytes leftover after parsing attributes in process `syz-executor0'. binder: undelivered TRANSACTION_ERROR: 29189 binder: undelivered TRANSACTION_ERROR: 29189 SELinux: unrecognized netlink message: protocol=0 nlmsg_type=33552 sclass=netlink_route_socket pig=11502 comm=syz-executor0 netlink: 200 bytes leftover after parsing attributes in process `syz-executor1'. netlink: 200 bytes leftover after parsing attributes in process `syz-executor1'. netlink: 8 bytes leftover after parsing attributes in process `syz-executor0'. netlink: 8 bytes leftover after parsing attributes in process `syz-executor0'. SELinux: unrecognized netlink message: protocol=0 nlmsg_type=2320 sclass=netlink_route_socket pig=11624 comm=syz-executor0 SELinux: unrecognized netlink message: protocol=0 nlmsg_type=2320 sclass=netlink_route_socket pig=11630 comm=syz-executor0 binder: 11697:11702 ERROR: BC_REGISTER_LOOPER called without request binder_alloc: 11697: binder_alloc_buf size 344541829808521256 failed, no address space netlink: 12 bytes leftover after parsing attributes in process `syz-executor0'. binder: 11697:11717 BC_INCREFS_DONE node 54 has no pending increfs request binder_alloc: allocated: 8 (num: 1 largest: 8), free: 8184 (num: 1 largest: 8184) binder: 11697:11702 transaction failed 29201/-28, size 32-8 line 3127 binder: send failed reply for transaction 55 to 11697:11717 binder: BINDER_SET_CONTEXT_MGR already set binder: 11697:11702 ioctl 40046207 0 returned -16 binder: 11697:11717 ERROR: BC_REGISTER_LOOPER called without request binder: 11697:11717 BC_INCREFS_DONE u0000000000000000 no match SELinux: unrecognized netlink message: protocol=0 nlmsg_type=57565 sclass=netlink_route_socket pig=11738 comm=syz-executor0 SELinux: unrecognized netlink message: protocol=0 nlmsg_type=57565 sclass=netlink_route_socket pig=11751 comm=syz-executor0 netlink: 12 bytes leftover after parsing attributes in process `syz-executor0'. SELinux: unrecognized netlink message: protocol=0 nlmsg_type=0 sclass=netlink_route_socket pig=12105 comm=syz-executor0 SELinux: unrecognized netlink message: protocol=0 nlmsg_type=0 sclass=netlink_route_socket pig=12105 comm=syz-executor0 net_ratelimit: 39 callbacks suppressed IPv4: Oversized IP packet from 127.0.0.1 netlink: 12 bytes leftover after parsing attributes in process `syz-executor0'. netlink: 12 bytes leftover after parsing attributes in process `syz-executor0'. IPv4: Oversized IP packet from 127.0.0.1 IPv4: Oversized IP packet from 127.0.0.1 IPv4: Oversized IP packet from 127.0.0.1 IPv4: Oversized IP packet from 127.0.0.1 SELinux: unrecognized netlink message: protocol=0 nlmsg_type=7 sclass=netlink_route_socket pig=12343 comm=syz-executor0 IPv4: Oversized IP packet from 127.0.0.1 IPv4: Oversized IP packet from 127.0.0.1 IPv4: Oversized IP packet from 127.0.0.1 IPv4: Oversized IP packet from 127.0.0.1 IPv4: Oversized IP packet from 127.0.0.1 device syz0 left promiscuous mode