====================================================== [ INFO: possible circular locking dependency detected ] 4.4.120-gd63fdf6 #28 Not tainted ------------------------------------------------------- syz-executor6/11478 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 [] 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-executor6/11478: #0: (ashmem_mutex){+.+.+.}, at: [] ashmem_llseek+0x56/0x1f0 drivers/staging/android/ashmem.c:330 stack backtrace: CPU: 1 PID: 11478 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 8a74816e1a39fc15 ffff8801c5787ad8 ffffffff81d0408d ffffffff851a0010 ffffffff851a9b50 ffffffff851be460 ffff8801d4bf50f8 ffff8801d4bf4800 ffff8801c5787b20 ffffffff81233ba1 ffff8801d4bf50f8 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(1521656144.639:46): avc: denied { write } for pid=11544 comm="syz-executor0" name="task" dev="proc" ino=25872 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 audit: type=1400 audit(1521656144.649:47): avc: denied { setattr } for pid=11544 comm="syz-executor0" name="task" dev="proc" ino=25872 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 syz-executor5 (11571): /proc/11561/oom_adj is deprecated, please use /proc/11561/oom_score_adj instead. SELinux: unrecognized netlink message: protocol=0 nlmsg_type=51685 sclass=netlink_route_socket SELinux: unrecognized netlink message: protocol=0 nlmsg_type=51685 sclass=netlink_route_socket audit: type=1400 audit(1521656145.119:48): avc: denied { dyntransition } for pid=11629 comm="syz-executor0" 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 IPv4: Oversized IP packet from 127.0.0.1 audit: type=1400 audit(1521656145.319:49): avc: denied { write } for pid=11680 comm="syz-executor0" path="socket:[25243]" dev="sockfs" ino=25243 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 IPv4: Oversized IP packet from 127.0.0.1 audit: type=1400 audit(1521656145.669:50): avc: denied { read } for pid=11805 comm="syz-executor5" path="socket:[26139]" dev="sockfs" ino=26139 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(1521656145.709:51): avc: denied { getopt } for pid=11805 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_netfilter_socket permissive=1 netlink: 220 bytes leftover after parsing attributes in process `syz-executor3'. netlink: 220 bytes leftover after parsing attributes in process `syz-executor3'. audit: type=1326 audit(1521656145.959:52): auid=4294967295 uid=0 gid=0 ses=4294967295 subj=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 pid=11870 comm="syz-executor0" exe="/root/syz-executor0" sig=9 arch=c000003e syscall=202 compat=0 ip=0x453e69 code=0x0 audit: type=1326 audit(1521656146.029:53): auid=4294967295 uid=0 gid=0 ses=4294967295 subj=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 pid=11870 comm="syz-executor0" exe="/root/syz-executor0" sig=9 arch=c000003e syscall=202 compat=0 ip=0x453e69 code=0x0 IPv4: Oversized IP packet from 127.0.0.1 IPv4: Oversized IP packet from 127.0.0.1 SELinux: unrecognized netlink message: protocol=6 nlmsg_type=31475 sclass=netlink_xfrm_socket binder: 12166:12171 unknown command 287495 binder: 12166:12171 ioctl c0306201 200003c0 returned -22 SELinux: unrecognized netlink message: protocol=6 nlmsg_type=31475 sclass=netlink_xfrm_socket binder: 12246:12260 got reply transaction with no transaction stack binder: 12246:12260 transaction failed 29201/-71, size 0-0 line 2921 binder: 12284:12290 unknown command 157486250 binder: 12246:12296 got reply transaction with no transaction stack binder: 12284:12290 ioctl c0306201 209b4fd0 returned -22 binder: 12284:12290 Acquire 1 refcount change on invalid ref -314509312 ret -22 binder: 12284:12290 unknown command 16777215 binder: 12284:12290 ioctl c0306201 20000000 returned -22 binder: 12284:12290 unknown command 1227268994 binder: 12284:12290 ioctl c0306201 20008fd0 returned -22 binder: BINDER_SET_CONTEXT_MGR already set binder: 12284:12300 ioctl 40046207 0 returned -16 binder: 12284:12290 unknown command 157486250 binder: 12284:12290 ioctl c0306201 209b4fd0 returned -22 binder: 12284:12290 Acquire 1 refcount change on invalid ref -314509312 ret -22 binder: 12284:12290 unknown command 16777215 binder: 12284:12290 ioctl c0306201 20000000 returned -22 binder: 12284:12300 unknown command 1227268994 binder: 12284:12300 ioctl c0306201 20008fd0 returned -22 binder: 12246:12296 transaction failed 29201/-71, size 0-0 line 2921 binder: undelivered TRANSACTION_ERROR: 29201 binder: undelivered TRANSACTION_ERROR: 29201 IPv6: Can't replace route, no match found IPv6: Can't replace route, no match found binder: 12350:12351 unknown command 287493 binder: 12350:12351 ioctl c0306201 20000000 returned -22 binder: 12350:12351 unknown command 1337358695 binder: 12350:12351 ioctl c0306201 20008fd0 returned -22 binder: BINDER_SET_CONTEXT_MGR already set binder: 12350:12351 ioctl 40046207 0 returned -16 binder: 12350:12351 unknown command 287493 binder: 12350:12351 ioctl c0306201 20000000 returned -22 binder: 12350:12352 unknown command 1337358695 binder: 12350:12352 ioctl c0306201 20008fd0 returned -22 binder: 12509:12520 BC_FREE_BUFFER u0000000000000000 no match binder: BINDER_SET_CONTEXT_MGR already set binder: 12509:12527 ioctl 40046207 0 returned -16 binder_alloc: 12509: binder_alloc_buf, no vma binder: 12509:12527 transaction failed 29189/-3, size 0-0 line 3128 binder: 12509:12529 BC_FREE_BUFFER u0000000000000000 no match binder: release 12509:12510 transaction 49 out, still active binder: undelivered TRANSACTION_COMPLETE binder: send failed reply for transaction 49, target dead binder: 12578:12604 BC_FREE_BUFFER u0000000000000000 no match sg_write: data in/out 1969188161/24 bytes for SCSI command 0x30-- guessing data in; program syz-executor3 not setting count and/or reply_len properly binder: 12578:12604 ioctl 40304580 20000000 returned -22 sg_write: data in/out 1969188161/24 bytes for SCSI command 0x30-- guessing data in; program syz-executor3 not setting count and/or reply_len properly binder: BINDER_SET_CONTEXT_MGR already set binder: 12578:12623 ioctl 40046207 0 returned -16 binder_alloc: 12578: binder_alloc_buf, no vma binder: 12578:12604 transaction failed 29189/-3, size 0-0 line 3128 binder: 12578:12623 BC_FREE_BUFFER u0000000000000000 no match binder: 12578:12623 ioctl 40304580 20000000 returned -22 binder: release 12578:12590 transaction 52 out, still active binder: undelivered TRANSACTION_COMPLETE binder: send failed reply for transaction 52, target dead IPVS: Creating netns size=2552 id=9 audit: type=1400 audit(1521656149.039:54): avc: denied { create } for pid=12771 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 audit: type=1400 audit(1521656149.769:55): avc: denied { bind } for pid=12961 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 binder: 13197:13208 ioctl c0306201 20003fd0 returned -14 binder: 13197:13208 ioctl c0306201 20012000 returned -14 binder: 13197:13210 ioctl c0306201 2000dfd0 returned -14 binder: 13197:13210 ioctl c0306201 20003fd0 returned -14 binder: 13197:13205 ioctl c0306201 2000dfd0 returned -14 sock: process `syz-executor0' is using obsolete setsockopt SO_BSDCOMPAT audit: type=1400 audit(1521656151.459:56): avc: denied { getattr } for pid=13413 comm="syz-executor4" path="socket:[29300]" dev="sockfs" ino=29300 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(1521656152.009:57): avc: denied { ioctl } for pid=13549 comm="syz-executor4" path="socket:[29469]" dev="sockfs" ino=29469 ioctlcmd=2406 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 IPVS: Creating netns size=2552 id=10 IPVS: Creating netns size=2552 id=11 audit: type=1400 audit(1521656152.909:58): avc: denied { setopt } for pid=13821 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_netfilter_socket permissive=1