====================================================== [ INFO: possible circular locking dependency detected ] 4.4.118-g5f7f76a #24 Not tainted ------------------------------------------------------- syz-executor3/20882 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/20882: #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: 20882 Comm: syz-executor3 Not tainted 4.4.118-g5f7f76a #24 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 0000000000000000 2b94abc8d9efc27c ffff8801d974f9b8 ffffffff81d0402d ffffffff851a0010 ffffffff851a0010 ffffffff851beb20 ffff8800ac9508f8 ffff8800ac950000 ffff8801d974fa00 ffffffff81233ba1 ffff8800ac9508f8 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 binder: send failed reply for transaction 50 to 21016:21038 binder: BINDER_SET_CONTEXT_MGR already set binder: 21016:21038 ioctl 40046207 0 returned -16 qtaguid: iface_stat: iface_check_stats_reset_and_adjust(tunl0): iface reset its stats unexpectedly binder_alloc: 21016: binder_alloc_buf, no vma IPv4: Oversized IP packet from 127.0.0.1 binder: 21016:21038 transaction failed 29189/-3, size 0-0 line 3128 binder: undelivered TRANSACTION_ERROR: 29189 binder: undelivered TRANSACTION_COMPLETE binder: undelivered TRANSACTION_ERROR: 29189 binder: send failed reply for transaction 53 to 21063:21079 binder: undelivered TRANSACTION_COMPLETE binder: undelivered TRANSACTION_ERROR: 29189 IPv4: Oversized IP packet from 127.0.0.1 IPv4: Oversized IP packet from 172.20.6.16 IPv4: Oversized IP packet from 172.20.6.16 binder: send failed reply for transaction 55 to 21104:21122 binder: undelivered TRANSACTION_COMPLETE binder: undelivered TRANSACTION_ERROR: 29189 IPv4: Oversized IP packet from 127.0.0.1 binder: send failed reply for transaction 57 to 21126:21142 binder: undelivered TRANSACTION_COMPLETE binder: undelivered TRANSACTION_ERROR: 29189 IPv4: Oversized IP packet from 127.0.0.1 binder: send failed reply for transaction 59 to 21154:21172 binder: undelivered TRANSACTION_COMPLETE binder: undelivered TRANSACTION_ERROR: 29189 IPv4: Oversized IP packet from 127.0.0.1 binder: send failed reply for transaction 61 to 21183:21204 binder: undelivered TRANSACTION_COMPLETE binder: undelivered TRANSACTION_ERROR: 29189 IPv4: Oversized IP packet from 127.0.0.1 binder_alloc: 21220: binder_alloc_buf, no vma binder: 21220:21235 transaction failed 29189/-3, size 0-0 line 3128 binder: undelivered TRANSACTION_ERROR: 29189 binder_alloc: 21258: binder_alloc_buf, no vma binder: 21258:21269 transaction failed 29189/-3, size 0-0 line 3128 binder: undelivered TRANSACTION_ERROR: 29189 binder_alloc: 21283: binder_alloc_buf, no vma binder: 21283:21300 transaction failed 29189/-3, size 0-0 line 3128 binder: undelivered TRANSACTION_ERROR: 29189 binder: release 21323:21325 transaction 69 out, still active binder: undelivered TRANSACTION_COMPLETE binder: send failed reply for transaction 69, target dead binder: BINDER_SET_CONTEXT_MGR already set binder: 21357:21360 ioctl 40046207 0 returned -16 binder: release 21338:21341 transaction 71 out, still active binder: undelivered TRANSACTION_COMPLETE binder: send failed reply for transaction 71, target dead IPv4: Oversized IP packet from 127.0.0.1 binder: 21357:21360 transaction failed 29189/-22, size 0-0 line 3005 binder: undelivered TRANSACTION_ERROR: 29189 binder: release 21376:21380 transaction 74 out, still active binder: undelivered TRANSACTION_COMPLETE binder: send failed reply for transaction 74, target dead binder: 21396:21398 transaction failed 29189/-22, size 0-0 line 3005 binder: undelivered TRANSACTION_ERROR: 29189 IPv4: Oversized IP packet from 127.0.0.1 binder: 21419:21420 transaction failed 29189/-22, size 0-0 line 3005 binder: undelivered TRANSACTION_ERROR: 29189 IPv4: Oversized IP packet from 127.0.0.1 binder: 21440:21442 transaction failed 29189/-22, size 0-0 line 3005 binder: undelivered TRANSACTION_ERROR: 29189 binder: release 21453:21457 transaction 79 out, still active binder: undelivered TRANSACTION_COMPLETE binder: send failed reply for transaction 79, target dead 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: 21516:21525 transaction failed 29189/-22, size 0-0 line 3005 binder: undelivered TRANSACTION_ERROR: 29189 binder: 21536:21541 transaction failed 29189/-22, size 0-0 line 3005 binder: undelivered TRANSACTION_ERROR: 29189 IPv4: Oversized IP packet from 127.0.0.1