====================================================== [ INFO: possible circular locking dependency detected ] 4.4.120-gd63fdf6 #28 Not tainted ------------------------------------------------------- syz-executor7/5655 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-executor7/5655: #0: (ashmem_mutex){+.+.+.}, at: [] ashmem_llseek+0x56/0x1f0 drivers/staging/android/ashmem.c:330 stack backtrace: CPU: 1 PID: 5655 Comm: syz-executor7 Not tainted 4.4.120-gd63fdf6 #28 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 0000000000000000 5642af57dcd5b85e ffff8801c1e37ad8 ffffffff81d0408d ffffffff851a0010 ffffffff851a9b50 ffffffff851be460 ffff8801c1e1a0f8 ffff8801c1e19800 ffff8801c1e37b20 ffffffff81233ba1 ffff8801c1e1a0f8 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 IPv4: Oversized IP packet from 127.0.0.1 audit: type=1400 audit(1521572236.920:11): avc: denied { create } for pid=5730 comm="syz-executor1" scontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tcontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tclass=netlink_crypto_socket permissive=1 audit: type=1400 audit(1521572237.230:12): avc: denied { connect } for pid=5848 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 device bridge0 entered promiscuous mode audit: type=1400 audit(1521572237.440:13): avc: denied { write } for pid=5900 comm="syz-executor1" path="socket:[14565]" dev="sockfs" ino=14565 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(1521572237.610:14): avc: denied { write } for pid=5970 comm="syz-executor1" path="socket:[14630]" dev="sockfs" ino=14630 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 rfkill: input handler disabled netlink: 37 bytes leftover after parsing attributes in process `syz-executor1'. rfkill: input handler enabled netlink: 184 bytes leftover after parsing attributes in process `syz-executor0'. binder: 6154:6159 transaction failed 29189/-22, size 0-8 line 3005 binder: 6154:6169 transaction failed 29189/-22, size 0-8 line 3005 binder: undelivered TRANSACTION_ERROR: 29189 binder: undelivered TRANSACTION_ERROR: 29189 netlink: 72 bytes leftover after parsing attributes in process `syz-executor2'. DRBG: could not allocate digest TFM handle: hmac(sha256) DRBG: could not allocate digest TFM handle: hmac(sha256) binder: 6267:6268 unknown command -1251019956 binder: 6267:6268 ioctl c0306201 20008000 returned -22 binder: 6267:6268 BC_FREE_BUFFER u0000000000000000 no match binder: 6267:6268 got reply transaction with no transaction stack binder: 6267:6268 transaction failed 29201/-71, size 88-16 line 2921 binder: 6267:6268 BC_ACQUIRE_DONE node 3 has no pending acquire request binder: BINDER_SET_CONTEXT_MGR already set binder: 6267:6308 ioctl 40046207 0 returned -16 binder: 6267:6268 unknown command -1251019956 binder: 6267:6308 BC_FREE_BUFFER u0000000000000000 no match binder: 6267:6308 got reply transaction with no transaction stack binder: 6267:6308 transaction failed 29201/-71, size 88-16 line 2921 binder: 6267:6309 BC_ACQUIRE_DONE u0000000000000000 no match binder: 6267:6268 ioctl c0306201 20008000 returned -22 binder_alloc: binder_alloc_mmap_handler: 6398 20000000-20002000 already mapped failed -16 binder_alloc: binder_alloc_mmap_handler: 6398 20000000-20002000 already mapped failed -16 netlink: 28 bytes leftover after parsing attributes in process `syz-executor5'. netlink: 28 bytes leftover after parsing attributes in process `syz-executor5'. SELinux: unrecognized netlink message: protocol=0 nlmsg_type=28729 sclass=netlink_route_socket SELinux: unrecognized netlink message: protocol=0 nlmsg_type=28729 sclass=netlink_route_socket IPVS: Creating netns size=2552 id=9 audit_printk_skb: 15 callbacks suppressed audit: type=1400 audit(1521572242.350:20): avc: denied { ioctl } for pid=6949 comm="syz-executor4" path="socket:[16654]" dev="sockfs" ino=16654 ioctlcmd=8917 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 syz-executor2 uses obsolete (PF_INET,SOCK_PACKET) binder: 7084:7087 ioctl c0306201 2001bfd0 returned -14 binder: 7084:7087 ioctl c0306201 2001bfd0 returned -14 netlink: 3 bytes leftover after parsing attributes in process `syz-executor3'. netlink: 3 bytes leftover after parsing attributes in process `syz-executor3'. audit: type=1400 audit(1521572242.980:21): avc: denied { call } for pid=7132 comm="syz-executor1" 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_alloc: 7132: binder_alloc_buf size 17620936727824 failed, no address space binder_alloc: allocated: 0 (num: 0 largest: 0), free: 8192 (num: 1 largest: 8192) binder: 7132:7143 transaction failed 29201/-28, size 0-17609366249433 line 3128 binder: BINDER_SET_CONTEXT_MGR already set binder: 7132:7155 ioctl 40046207 0 returned -16 binder: undelivered TRANSACTION_ERROR: 29201 audit: type=1400 audit(1521572243.860:22): avc: denied { setattr } for pid=7339 comm="syz-executor0" name="fscreate" dev="proc" ino=17104 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 mmap: syz-executor2 (7351) uses deprecated remap_file_pages() syscall. See Documentation/vm/remap_file_pages.txt. binder: 7386:7389 ioctl c0306201 2000a000 returned -11 binder_alloc: binder_alloc_mmap_handler: 7386 20000000-20002000 already mapped failed -16 binder: BINDER_SET_CONTEXT_MGR already set binder: 7386:7389 ioctl 40046207 0 returned -16 binder_alloc: 7386: binder_alloc_buf, no vma binder: 7386:7397 transaction failed 29189/-3, size 0-0 line 3128 binder: 7386:7389 unknown command 0 binder: 7386:7389 ioctl c0306201 2000a000 returned -22 binder: send failed reply for transaction 9 to 7386:7389 binder: undelivered TRANSACTION_ERROR: 29189 audit: type=1401 audit(1521572244.150:23): op=fscreate invalid_context=B606229727A44CE83F608A8F32E530923A89FDBA08CBF64B35A42765D9A82A68A802AD193D0FC793BEE0EFC3DDBCEAF90E37DB4C6F4B19BC56780A03B709C3E037240B8B771F5A59AB23AF0D6597AF4F5CBA8AE6CF2731855206BBBB04DA175B6330A1A8D4707ECACFA57CE7241D20C701CDAECF86FA1E09CDC170767DD0981F5C6897D04B93B28FD199BCE61FE1A7C1419CEE8C53B8EB143AD0190B72C1C1C2F30B5E8C64666FF4A50B89BF7A2285404231F8F7E84F9F9F79DCAD3A57A500BDF524B90C9DD3C40F1BB8576FD2BA68BDC9CC20E1D6B913DE5FCE0CD6A0D0BEDD5074B35784025E81ADD1036216EA57C85C103505C5BC7C750F882F1B422A596D audit: type=1401 audit(1521572244.230:24): op=fscreate invalid_context=B606229727A44CE83F608A8F32E530923A89FDBA08CBF64B35A42765D9A82A68A802AD193D0FC793BEE0EFC3DDBCEAF90E37DB4C6F4B19BC56780A03B709C3E037240B8B771F5A59AB23AF0D6597AF4F5CBA8AE6CF2731855206BBBB04DA175B6330A1A8D4707ECACFA57CE7241D20C701CDAECF86FA1E09CDC170767DD0981F5C6897D04B93B28FD199BCE61FE1A7C1419CEE8C53B8EB143AD0190B72C1C1C2F30B5E8C64666FF4A50B89BF7A2285404231F8F7E84F9F9F79DCAD3A57A500BDF524B90C9DD3C40F1BB8576FD2BA68BDC9CC20E1D6B913DE5FCE0CD6A0D0BEDD5074B35784025E81ADD1036216EA57C85C103505C5BC7C750F882F1B422A596D device bridge0 entered promiscuous mode audit: type=1401 audit(1521572244.630:25): op=fscreate invalid_context=83499A17663AE18A1BEFEFABFC690B9C audit: type=1400 audit(1521572244.890:26): avc: denied { read } for pid=7677 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=netlink_netfilter_socket permissive=1 SELinux: unrecognized netlink message: protocol=0 nlmsg_type=53 sclass=netlink_route_socket netlink: 12 bytes leftover after parsing attributes in process `syz-executor1'. netlink: 12 bytes leftover after parsing attributes in process `syz-executor1'. SELinux: unrecognized netlink message: protocol=0 nlmsg_type=785 sclass=netlink_route_socket audit: type=1326 audit(1521572245.570:27): auid=4294967295 uid=0 gid=0 ses=4294967295 subj=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 pid=7907 comm="syz-executor3" exe="/root/syz-executor3" sig=31 arch=c000003e syscall=202 compat=0 ip=0x453e69 code=0x0 audit: type=1326 audit(1521572245.630:28): auid=4294967295 uid=0 gid=0 ses=4294967295 subj=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 pid=7907 comm="syz-executor3" exe="/root/syz-executor3" sig=31 arch=c000003e syscall=202 compat=0 ip=0x453e69 code=0x0