binder: 7473:7485 ioctl c0306201 20007000 returned -14 ====================================================== [ INFO: possible circular locking dependency detected ] 4.4.120-gd63fdf6 #28 Not tainted ------------------------------------------------------- syz-executor6/7487 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: -> #2 (ashmem_mutex){+.+.+.}: [] 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 -> #1 (&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 -> #0 (&sb->s_type->i_mutex_key#10){+.+.+.}: [] 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: &sb->s_type->i_mutex_key#10 --> &mm->mmap_sem --> ashmem_mutex 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-executor6/7487: #0: (ashmem_mutex){+.+.+.}, at: [] ashmem_llseek+0x56/0x1f0 drivers/staging/android/ashmem.c:330 stack backtrace: CPU: 1 PID: 7487 Comm: syz-executor6 Not tainted 4.4.120-gd63fdf6 #28 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 0000000000000000 9ccec0f6cb42f603 ffff8801d3c6fad8 ffffffff81d0408d ffffffff8519fe60 ffffffff851a9b50 ffffffff851be610 ffff8801d68eb8f8 ffff8801d68eb000 ffff8801d3c6fb20 ffffffff81233ba1 ffff8801d68eb8f8 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: 7473:7502 got reply transaction with no transaction stack binder: 7473:7502 transaction failed 29201/-71, size 0-0 line 2921 binder: BINDER_SET_CONTEXT_MGR already set binder: 7473:7516 ioctl 40046207 0 returned -16 binder: 7473:7502 ioctl c0306201 20007000 returned -14 binder: 7473:7509 got reply transaction with no transaction stack binder: 7473:7509 transaction failed 29201/-71, size 0-0 line 2921 binder: undelivered TRANSACTION_ERROR: 29201 binder: undelivered TRANSACTION_ERROR: 29201 syz-executor4 uses obsolete (PF_INET,SOCK_PACKET) audit: type=1400 audit(1521838914.809:19): avc: denied { call } for pid=7777 comm="syz-executor3" 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: 7777:7821 ioctl 40046207 0 returned -16 binder: undelivered TRANSACTION_COMPLETE binder: undelivered transaction 18, process died. capability: warning: `syz-executor0' uses deprecated v2 capabilities in a way that may be insecure sock: process `syz-executor6' is using obsolete setsockopt SO_BSDCOMPAT TCP: request_sock_TCPv6: Possible SYN flooding on port 20002. Sending cookies. Check SNMP counters. binder: 7982:7989 BC_CLEAR_DEATH_NOTIFICATION invalid ref 0 binder: 7982:7989 Acquire 1 refcount change on invalid ref 0 ret -22 binder: 7982:7989 Release 1 refcount change on invalid ref 1 ret -22 binder: 7982:7989 got transaction to invalid handle binder: 7982:8004 BC_CLEAR_DEATH_NOTIFICATION invalid ref 0 binder: 7982:7989 transaction failed 29201/-22, size 32-16 line 3005 binder: 7982:8004 Acquire 1 refcount change on invalid ref 0 ret -22 binder: 7982:8004 Release 1 refcount change on invalid ref 1 ret -22 binder: 7982:8004 got transaction to invalid handle binder: 7982:8004 transaction failed 29201/-22, size 32-16 line 3005 binder: undelivered TRANSACTION_ERROR: 29201 binder: undelivered TRANSACTION_ERROR: 29201 TCP: request_sock_TCPv6: Possible SYN flooding on port 20002. Sending cookies. Check SNMP counters. binder: 8119:8131 ERROR: BC_REGISTER_LOOPER called after BC_ENTER_LOOPER binder: 8119:8149 ERROR: BC_REGISTER_LOOPER called after BC_ENTER_LOOPER binder: 8147:8158 unknown command 16793600 binder: 8147:8158 ioctl c0306201 204edfd0 returned -22 binder: 8147:8158 unknown command 0 binder: 8147:8158 ioctl c0306201 20007000 returned -22 binder: 8147:8158 got reply transaction with no transaction stack binder: 8147:8158 transaction failed 29201/-71, size 32-0 line 2921 binder: 8147:8158 ioctl c018620b 20000100 returned -14 binder: 8147:8158 ioctl c018620b 20000240 returned -14 binder: 8147:8158 ioctl c0306201 20000400 returned -14 binder: undelivered TRANSACTION_ERROR: 29201 binder: 8147:8161 unknown command 16793600 binder: 8147:8161 ioctl c0306201 204edfd0 returned -22 binder: 8147:8161 got reply transaction with no transaction stack binder: 8147:8158 unknown command 0 binder: 8147:8158 ioctl c0306201 20007000 returned -22 binder: 8147:8158 ioctl c018620b 20000100 returned -14 binder: 8147:8163 ioctl c018620b 20000240 returned -14 binder: 8147:8158 ioctl c0306201 20000400 returned -14 binder: 8147:8161 transaction failed 29201/-71, size 32-0 line 2921 binder: undelivered TRANSACTION_ERROR: 29201 audit: type=1400 audit(1521838916.179:20): avc: denied { ioctl } for pid=8164 comm="syz-executor5" path="socket:[18938]" dev="sockfs" ino=18938 ioctlcmd=8934 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(1521838916.349:21): avc: denied { setattr } for pid=8245 comm="syz-executor3" name="clear_refs" dev="proc" ino=19001 scontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tcontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tclass=file permissive=1 netlink: 4 bytes leftover after parsing attributes in process `syz-executor5'. audit: type=1400 audit(1521838916.459:22): avc: denied { getattr } for pid=8280 comm="syz-executor5" path="socket:[18037]" dev="sockfs" ino=18037 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 netlink: 4 bytes leftover after parsing attributes in process `syz-executor5'. sock: sock_set_timeout: `syz-executor2' (pid 8530) tries to set negative timeout sock: sock_set_timeout: `syz-executor2' (pid 8530) tries to set negative timeout netlink: 104 bytes leftover after parsing attributes in process `syz-executor4'. audit: type=1326 audit(1521838917.679:23): auid=4294967295 uid=0 gid=0 ses=4294967295 subj=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 pid=8550 comm="syz-executor5" exe="/root/syz-executor5" sig=9 arch=c000003e syscall=202 compat=0 ip=0x454239 code=0x0 audit: type=1326 audit(1521838917.799:24): auid=4294967295 uid=0 gid=0 ses=4294967295 subj=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 pid=8550 comm="syz-executor5" exe="/root/syz-executor5" sig=9 arch=c000003e syscall=202 compat=0 ip=0x454239 code=0x0 audit: type=1400 audit(1521838918.389:25): avc: denied { getopt } for pid=8630 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 audit: type=1400 audit(1521838918.849:26): avc: denied { bind } for pid=8774 comm="syz-executor2" 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 netlink: 24 bytes leftover after parsing attributes in process `syz-executor7'. netlink: 24 bytes leftover after parsing attributes in process `syz-executor7'. audit: type=1400 audit(1521838922.219:27): avc: denied { setopt } for pid=8998 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_generic_socket permissive=1 audit: type=1400 audit(1521838922.259:28): avc: denied { create } for pid=9025 comm="syz-executor2" 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 FAULT_FLAG_ALLOW_RETRY missing 30 CPU: 1 PID: 9218 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 56df3faccfc2dcd0 ffff8800a6597970 ffffffff81d0408d ffff8800b5778480 1ffff10014cb2f3b ffff8800a6597af8 0000000000000000 0000000000000000 ffff8800a6597b20 ffffffff81607305 ffffffff81237410 Call Trace: [] __dump_stack lib/dump_stack.c:15 [inline] [] dump_stack+0xc1/0x124 lib/dump_stack.c:51 [] handle_userfault+0x715/0xf50 fs/userfaultfd.c:316 [] do_anonymous_page mm/memory.c:2731 [inline] [] handle_pte_fault mm/memory.c:3295 [inline] [] __handle_mm_fault mm/memory.c:3426 [inline] [] handle_mm_fault+0x2938/0x3190 mm/memory.c:3455 [] __do_page_fault+0x35b/0xa00 arch/x86/mm/fault.c:1245 [] do_page_fault+0x27/0x30 arch/x86/mm/fault.c:1308 [] page_fault+0x28/0x30 arch/x86/entry/entry_64.S:1033 [] entry_SYSCALL_64_fastpath+0x1c/0x98 audit: type=1401 audit(1521838923.429:29): op=setxattr invalid_context="" audit: type=1401 audit(1521838923.469:30): op=setxattr invalid_context=""