====================================================== [ INFO: possible circular locking dependency detected ] 4.4.120-gd63fdf6 #28 Not tainted ------------------------------------------------------- syz-executor5/6884 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 [] 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 SELinux: Invalid class 98 (&mm->mmap_sem){++++++}: [] 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-executor5/6884: #0: (ashmem_mutex){+.+.+.}, at: [] ashmem_llseek+0x56/0x1f0 drivers/staging/android/ashmem.c:330 stack backtrace: CPU: 1 PID: 6884 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 be69f8729d572f63 ffff8801d4ed7ad8 ffffffff81d0408d ffffffff851a0010 ffffffff851a9d00 ffffffff851be610 ffff8801d6fb20f8 ffff8801d6fb1800 ffff8801d4ed7b20 ffffffff81233ba1 ffff8801d6fb20f8 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 binder: 6922:6930 ioctl c0306201 20000380 returned -14 audit: type=1400 audit(1521929858.423:19): avc: denied { setattr } for pid=6922 comm="syz-executor1" path="/proc/353" dev="proc" ino=15206 scontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tcontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tclass=dir permissive=1 binder: 6922:6937 ioctl c0306201 20000380 returned -14 audit: type=1400 audit(1521929858.723:20): avc: denied { getopt } for pid=6980 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_generic_socket permissive=1 binder: 7026:7037 ioctl 40046205 fffffffffffffff8 returned -22 binder: 7088:7093 ioctl c0306201 20008000 returned -14 binder_alloc: binder_alloc_mmap_handler: 7088 20000000-20002000 already mapped failed -16 binder: 7088:7093 ioctl c0306201 20008000 returned -14 binder: 7147:7157 ioctl 40046205 6 returned -22 keychord: Insufficient bytes present for keycount 3 keychord: Insufficient bytes present for keycount 3 audit: type=1400 audit(1521929859.643:21): avc: denied { setopt } for pid=7232 comm="syz-executor7" 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 SELinux: unrecognized netlink message: protocol=0 nlmsg_type=48705 sclass=netlink_route_socket SELinux: unrecognized netlink message: protocol=0 nlmsg_type=48705 sclass=netlink_route_socket binder: 7691:7698 got transaction with invalid offsets ptr binder: 7691:7698 transaction failed 29201/-14, size 40-8 line 3156 binder: BINDER_SET_CONTEXT_MGR already set binder: 7691:7712 ioctl 40046207 0 returned -16 binder_alloc: 7691: binder_alloc_buf, no vma binder: 7691:7698 transaction failed 29189/-3, size 40-8 line 3128 binder: 7691:7712 ERROR: BC_REGISTER_LOOPER called without request binder: 7691:7712 BC_DEAD_BINDER_DONE 0000000000000001 not found binder: 7691:7712 IncRefs 0 refcount change on invalid ref 1 ret -22 binder: undelivered TRANSACTION_ERROR: 29189 binder: undelivered TRANSACTION_ERROR: 29201 audit: type=1326 audit(1521929861.613:22): auid=4294967295 uid=0 gid=0 ses=4294967295 subj=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 pid=7859 comm="syz-executor5" exe="/root/syz-executor5" sig=31 arch=c000003e syscall=202 compat=0 ip=0x454239 code=0x0 audit: type=1326 audit(1521929861.693:23): auid=4294967295 uid=0 gid=0 ses=4294967295 subj=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 pid=7859 comm="syz-executor5" exe="/root/syz-executor5" sig=31 arch=c000003e syscall=202 compat=0 ip=0x454239 code=0x0 skbuff: bad partial csum: csum=48/65516 len=572 netlink: 76 bytes leftover after parsing attributes in process `syz-executor0'. netlink: 76 bytes leftover after parsing attributes in process `syz-executor0'. SELinux: unrecognized netlink message: protocol=9 nlmsg_type=25 sclass=netlink_audit_socket audit: type=1400 audit(1521929862.913:24): avc: denied { create } for pid=8284 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_rdma_socket permissive=1 binder: release 8667:8671 transaction 19 out, still active binder: undelivered TRANSACTION_COMPLETE binder: 8667:8686 BC_FREE_BUFFER u0000000020dbd000 matched unreturned buffer binder: BINDER_SET_CONTEXT_MGR already set binder: 8667:8686 ioctl 40046207 0 returned -16 binder_alloc: 8667: binder_alloc_buf, no vma binder: 8667:8699 transaction failed 29189/-3, size 0-0 line 3128 binder: undelivered TRANSACTION_ERROR: 29189 binder: send failed reply for transaction 19, target dead binder: 8704:8713 ioctl 40046205 fffffffffffffff8 returned -22 binder: 8704:8723 ioctl 40046205 fffffffffffffff8 returned -22 tc_dump_action: action bad kind tc_dump_action: action bad kind binder: 8736:8739 DecRefs 0 refcount change on invalid ref 4 ret -22 binder: 8736:8739 BC_ACQUIRE_DONE u0000000000000000 no match binder: 8736:8739 got transaction to invalid handle binder: 8736:8739 transaction failed 29201/-22, size 0-40 line 3005 binder: 8736:8739 DecRefs 0 refcount change on invalid ref 4 ret -22 binder: 8736:8739 BC_ACQUIRE_DONE u0000000000000000 no match binder: 8736:8739 got transaction to invalid handle binder: 8736:8739 transaction failed 29201/-22, size 0-40 line 3005 binder: undelivered TRANSACTION_ERROR: 29201 binder: undelivered TRANSACTION_ERROR: 29201 audit: type=1400 audit(1521929864.823:25): avc: denied { read accept } for pid=8884 comm="syz-executor3" path="socket:[20246]" dev="sockfs" ino=20246 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(1521929864.873:26): avc: denied { accept } for pid=8897 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_generic_socket permissive=1 audit: type=1400 audit(1521929864.903:27): avc: denied { bind } for pid=8897 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_generic_socket permissive=1 IPv6: RTM_NEWROUTE with no NLM_F_CREATE or NLM_F_REPLACE IPv6: NLM_F_CREATE should be set when creating new route audit: type=1326 audit(1521929865.783:28): auid=4294967295 uid=0 gid=0 ses=4294967295 subj=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 pid=9082 comm="syz-executor2" exe="/root/syz-executor2" sig=31 arch=c000003e syscall=202 compat=0 ip=0x454239 code=0x0 audit: type=1326 audit(1521929865.803:29): auid=4294967295 uid=0 gid=0 ses=4294967295 subj=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 pid=9082 comm="syz-executor2" exe="/root/syz-executor2" sig=31 arch=c000003e syscall=202 compat=0 ip=0x454239 code=0x0 IPv6: RTM_NEWROUTE with no NLM_F_CREATE or NLM_F_REPLACE audit: type=1400 audit(1521929866.323:30): avc: denied { create } for pid=9134 comm="syz-executor1" scontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tcontext=system_u:object_r:traceroute_exec_t:s0 tclass=key permissive=1 IPv6: RTM_NEWROUTE with no NLM_F_CREATE or NLM_F_REPLACE IPv6: NLM_F_CREATE should be set when creating new route SELinux: unrecognized netlink message: protocol=0 nlmsg_type=24089 sclass=netlink_route_socket SELinux: unrecognized netlink message: protocol=0 nlmsg_type=187 sclass=netlink_route_socket SELinux: unrecognized netlink message: protocol=0 nlmsg_type=4117 sclass=netlink_route_socket TCP: request_sock_TCPv6: Possible SYN flooding on port 20002. Sending cookies. Check SNMP counters.