====================================================== [ INFO: possible circular locking dependency detected ] 4.4.120-gd63fdf6 #28 Not tainted ------------------------------------------------------- syz-executor3/5784 is trying to acquire lock: (&sb->s_type->i_mutex_key#10){+.+.+.}, at: [] shmem_file_llseek+0xf1/0x240 mm/shmem.c:1816 but task is already holding lock: (ashmem_mutex){+.+.+.}, at: [] ashmem_llseek+0x56/0x1f0 drivers/staging/android/ashmem.c:330 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 binder: 5812:5813 transaction failed 29189/-22, size 40-8 line 3005 binder: 5812:5813 ioctl c0306201 20008000 returned -14 binder: 5812:5813 BC_INCREFS_DONE u0000000000000000 no match binder: 5812:5813 unknown command 0 binder: 5812:5813 ioctl c0306201 20a94fd0 returned -22 binder: 5812:5814 transaction failed 29189/-22, size 40-8 line 3005 binder: 5812:5814 ioctl c0306201 20008000 returned -14 binder: undelivered TRANSACTION_ERROR: 29189 binder: undelivered TRANSACTION_ERROR: 29189 [] 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 [] lock_acquire+0x15e/0x460 kernel/locking/lockdep.c:3592 [] __might_fault+0x14a/0x1d0 mm/memory.c:3810 [] copy_to_user arch/x86/include/asm/uaccess.h:760 [inline] [] filldir+0x162/0x2d0 fs/readdir.c:180 [] dir_emit_dot include/linux/fs.h:3070 [inline] [] dir_emit_dots include/linux/fs.h:3081 [inline] [] dcache_readdir+0x11e/0x7b0 fs/libfs.c:150 [] iterate_dir+0x1c8/0x420 fs/readdir.c:42 [] SYSC_getdents fs/readdir.c:215 [inline] [] SyS_getdents+0x14a/0x270 fs/readdir.c:196 [] 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 [] __mutex_lock_common kernel/locking/mutex.c:521 [inline] [] mutex_lock_nested+0xbb/0x850 kernel/locking/mutex.c:621 [] shmem_file_llseek+0xf1/0x240 mm/shmem.c:1816 [] vfs_llseek+0xa2/0xd0 fs/read_write.c:260 [] ashmem_llseek+0xe7/0x1f0 drivers/staging/android/ashmem.c:342 [] vfs_llseek fs/read_write.c:260 [inline] [] SYSC_lseek fs/read_write.c:285 [inline] [] SyS_lseek+0xeb/0x170 fs/read_write.c:276 [] entry_SYSCALL_64_fastpath+0x1c/0x98 other info that might help us debug this: Chain exists of: Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(ashmem_mutex); lock(&mm->mmap_sem); lock(ashmem_mutex); lock(&sb->s_type->i_mutex_key#10); *** DEADLOCK *** 1 lock held by syz-executor3/5784: #0: (ashmem_mutex){+.+.+.}, at: [] ashmem_llseek+0x56/0x1f0 drivers/staging/android/ashmem.c:330 stack backtrace: CPU: 1 PID: 5784 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 1fb6fd28f31494ab ffff8801d9477ad8 ffffffff81d0408d ffffffff8519fe60 ffffffff851a9d00 ffffffff851be7c0 ffff8800a65ba0f8 ffff8800a65b9800 ffff8801d9477b20 ffffffff81233ba1 ffff8800a65ba0f8 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 [] __mutex_lock_common kernel/locking/mutex.c:521 [inline] [] mutex_lock_nested+0xbb/0x850 kernel/locking/mutex.c:621 [] shmem_file_llseek+0xf1/0x240 mm/shmem.c:1816 [] vfs_llseek+0xa2/0xd0 fs/read_write.c:260 [] ashmem_llseek+0xe7/0x1f0 drivers/staging/android/ashmem.c:342 [] vfs_llseek fs/read_write.c:260 [inline] [] SYSC_lseek fs/read_write.c:285 [inline] [] SyS_lseek+0xeb/0x170 fs/read_write.c:276 [] entry_SYSCALL_64_fastpath+0x1c/0x98 audit: type=1400 audit(1521417240.302:12): avc: denied { set_context_mgr } for pid=5825 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: 5825:5868 ioctl 40046207 0 returned -16 binder: undelivered death notification, 0000000000000000 binder: undelivered death notification, 0000000000000000 IPv4: Oversized IP packet from 127.0.0.1 audit: type=1400 audit(1521417240.472:13): avc: denied { write } for pid=5889 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_generic_socket permissive=1 IPv4: Oversized IP packet from 127.0.0.1 TCP: request_sock_TCPv6: Possible SYN flooding on port 20002. Sending cookies. Check SNMP counters. binder_alloc: binder_alloc_mmap_handler: 5979 20000000-20002000 already mapped failed -16 binder: BINDER_SET_CONTEXT_MGR already set binder: 5979:5988 ioctl 40046207 0 returned -16 binder_alloc: 5979: binder_alloc_buf, no vma binder: 5979:5995 transaction failed 29189/-3, size 40-8 line 3128 binder: send failed reply for transaction 7 to 5979:5988 binder: undelivered TRANSACTION_ERROR: 29189 binder_alloc: binder_alloc_mmap_handler: 6062 20000000-20002000 already mapped failed -16 SELinux: unrecognized netlink message: protocol=6 nlmsg_type=63232 sclass=netlink_xfrm_socket SELinux: unrecognized netlink message: protocol=6 nlmsg_type=63232 sclass=netlink_xfrm_socket audit_printk_skb: 9 callbacks suppressed audit: type=1326 audit(1521417242.302:17): auid=4294967295 uid=0 gid=0 ses=4294967295 subj=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 pid=6404 comm="syz-executor0" exe="/root/syz-executor0" sig=31 arch=c000003e syscall=202 compat=0 ip=0x453e69 code=0x0 audit: type=1326 audit(1521417242.352:18): auid=4294967295 uid=0 gid=0 ses=4294967295 subj=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 pid=6404 comm="syz-executor0" exe="/root/syz-executor0" sig=31 arch=c000003e syscall=202 compat=0 ip=0x453e69 code=0x0 audit: type=1400 audit(1521417242.462:19): avc: denied { create } for pid=6443 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_fib_lookup_socket permissive=1 audit: type=1400 audit(1521417242.502:20): avc: denied { write } for pid=6443 comm="syz-executor5" path="socket:[14819]" dev="sockfs" ino=14819 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 audit: type=1400 audit(1521417242.522:21): avc: denied { read } for pid=6443 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_fib_lookup_socket permissive=1 binder: 6490:6491 BC_INCREFS_DONE node 11 has no pending increfs request binder_alloc: binder_alloc_mmap_handler: 6490 20000000-20002000 already mapped failed -16 binder: BINDER_SET_CONTEXT_MGR already set binder: 6490:6491 ioctl 40046207 0 returned -16 binder_alloc: 6490: binder_alloc_buf, no vma binder: 6490:6495 transaction failed 29189/-3, size 40-8 line 3128 binder: 6490:6501 BC_INCREFS_DONE u0000000000000000 no match binder: send failed reply for transaction 12 to 6490:6491 binder: undelivered TRANSACTION_ERROR: 29189 SELinux: unrecognized netlink message: protocol=4 nlmsg_type=771 sclass=netlink_tcpdiag_socket SELinux: unrecognized netlink message: protocol=4 nlmsg_type=771 sclass=netlink_tcpdiag_socket audit: type=1400 audit(1521417243.222:22): avc: denied { create } for pid=6558 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_connector_socket permissive=1 binder: 6638:6646 ioctl c0306201 20000140 returned -14 binder: 6638:6659 got reply transaction with bad transaction stack, transaction 17 has target 6638:0 binder: BINDER_SET_CONTEXT_MGR already set binder: 6638:6665 ioctl 40046207 0 returned -16 binder: 6638:6646 ioctl c0306201 20000140 returned -14 binder: 6638:6659 transaction failed 29201/-71, size 32-0 line 2936 binder: release 6638:6659 transaction 17 out, still active binder: undelivered TRANSACTION_COMPLETE binder: undelivered TRANSACTION_ERROR: 29201 binder: send failed reply for transaction 17, target dead binder: 6638:6662 transaction failed 29189/-22, size 0-0 line 3005 binder: undelivered TRANSACTION_ERROR: 29189 binder_alloc: 6696: binder_alloc_buf, no vma binder: 6696:6699 transaction failed 29189/-3, size 32-8 line 3128 binder: BINDER_SET_CONTEXT_MGR already set binder: 6696:6703 ioctl 40046207 0 returned -16 binder_alloc: 6696: binder_alloc_buf, no vma binder: 6696:6703 transaction failed 29189/-3, size 32-8 line 3128 binder: undelivered TRANSACTION_ERROR: 29189 binder: undelivered TRANSACTION_ERROR: 29189 SELinux: ebitmap: map size 0 does not match my size 64 (high bit was 0) SELinux: ebitmap: map size 0 does not match my size 64 (high bit was 0) keychord: invalid keycode count 0 SELinux: unrecognized netlink message: protocol=4 nlmsg_type=7879 sclass=netlink_tcpdiag_socket SELinux: unrecognized netlink message: protocol=4 nlmsg_type=7879 sclass=netlink_tcpdiag_socket keychord: invalid keycode count 0 binder: 6748:6764 BC_FREE_BUFFER u000000002000c000 no match binder: 6748:6764 ioctl c0306201 20004000 returned -14 binder: BINDER_SET_CONTEXT_MGR already set binder: 6748:6766 ioctl 40046207 0 returned -16 binder_alloc: binder_alloc_mmap_handler: 6748 2000c000-2000e000 already mapped failed -16 binder: 6748:6768 BC_FREE_BUFFER u000000002000c000 no match audit: type=1400 audit(1521417246.142:23): avc: denied { dyntransition } for pid=6773 comm="syz-executor2" scontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tcontext=unconfined_u:system_r:insmod_t:s0-s0:c0 tclass=process permissive=1 audit: type=1400 audit(1521417246.542:24): avc: denied { create } for pid=6886 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_iscsi_socket permissive=1 syz-executor0 (6892): /proc/6890/oom_adj is deprecated, please use /proc/6890/oom_score_adj instead. audit: type=1400 audit(1521417246.602:25): avc: denied { execute } for pid=6905 comm="syz-executor5" dev="pipefs" ino=16140 scontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tcontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tclass=fifo_file permissive=1 TCP: request_sock_TCPv6: Possible SYN flooding on port 20002. Sending cookies. Check SNMP counters. binder: 7003:7005 Release 1 refcount change on invalid ref 318767104 ret -22 binder: BINDER_SET_CONTEXT_MGR already set binder: 7288:7292 ioctl 40046207 0 returned -16 binder: 7454:7460 ioctl 5429 20000100 returned -22 binder: 7454:7470 ioctl 5429 20000100 returned -22 TCP: request_sock_TCPv6: Possible SYN flooding on port 20002. Sending cookies. Check SNMP counters. binder: 7485:7488 got transaction with invalid offset (0, min 0 max 0) or object. binder: 7485:7488 transaction failed 29201/-22, size 0-8 line 3191 binder: BINDER_SET_CONTEXT_MGR already set binder: 7485:7488 ioctl 40046207 0 returned -16 binder: undelivered TRANSACTION_ERROR: 29201 binder: BC_ACQUIRE_RESULT not supported binder: 7495:7505 ioctl c0306201 20214fd0 returned -22 netlink: 4 bytes leftover after parsing attributes in process `syz-executor4'. netlink: 4 bytes leftover after parsing attributes in process `syz-executor4'.