====================================================== [ INFO: possible circular locking dependency detected ] 4.4.120-gd63fdf6 #28 Not tainted ------------------------------------------------------- syz-executor2/13495 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-executor2/13495: #0: (ashmem_mutex){+.+.+.}, at: [] ashmem_llseek+0x56/0x1f0 drivers/staging/android/ashmem.c:330 stack backtrace: CPU: 1 PID: 13495 Comm: syz-executor2 Not tainted 4.4.120-gd63fdf6 #28 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 0000000000000000 d77603afc7da485a ffff8800bba47ad8 ffffffff81d0408d ffffffff8519fe60 ffffffff851a9d00 ffffffff851be610 ffff8800b43238f8 ffff8800b4323000 ffff8800bba47b20 ffffffff81233ba1 ffff8800b43238f8 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_printk_skb: 81 callbacks suppressed audit: type=1400 audit(1521513299.485:152): avc: denied { create } for pid=13615 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_netfilter_socket permissive=1 audit: type=1400 audit(1521513299.545:153): avc: denied { create } for pid=13615 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_netfilter_socket permissive=1 audit: type=1400 audit(1521513299.835:154): avc: denied { create } for pid=13687 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(1521513299.905:155): avc: denied { create } for pid=13687 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 skbuff: bad partial csum: csum=48/65516 len=572 audit: type=1400 audit(1521513300.175:156): avc: denied { set_context_mgr } for pid=13759 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 keychord: Insufficient bytes present for keycount 66 audit: type=1400 audit(1521513300.225:157): avc: denied { call } for pid=13759 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: 13759:13774 got transaction with invalid offsets ptr binder: 13759:13774 transaction failed 29201/-14, size 40-8 line 3156 binder: BINDER_SET_CONTEXT_MGR already set binder: 13759:13774 ioctl 40046207 0 returned -16 binder: undelivered TRANSACTION_ERROR: 29201 SELinux: policydb magic number 0x22ee7225 does not match expected magic number 0xf97cff8c keychord: Insufficient bytes present for keycount 66 SELinux: policydb magic number 0x22ee7225 does not match expected magic number 0xf97cff8c audit: type=1400 audit(1521513300.455:158): avc: denied { create } for pid=13830 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_crypto_socket permissive=1 SELinux: unrecognized netlink message: protocol=0 nlmsg_type=13 sclass=netlink_route_socket audit: type=1400 audit(1521513300.515:159): avc: denied { create } for pid=13830 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_crypto_socket permissive=1 IPv6: NLM_F_REPLACE set, but no existing node found! IPv6: NLM_F_REPLACE set, but no existing node found! audit: type=1400 audit(1521513300.825:160): avc: denied { create } for pid=13932 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_netfilter_socket permissive=1 audit: type=1400 audit(1521513300.875:161): avc: denied { write } for pid=13932 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_netfilter_socket permissive=1 netlink: 4 bytes leftover after parsing attributes in process `syz-executor7'. netlink: 4 bytes leftover after parsing attributes in process `syz-executor7'. IPv6: NLM_F_CREATE should be specified when creating new route binder: 14136:14142 ioctl 4c02 20000040 returned -22 netlink: 4 bytes leftover after parsing attributes in process `syz-executor2'. netlink: 4 bytes leftover after parsing attributes in process `syz-executor2'. binder: 14270:14271 got transaction to invalid handle binder: 14270:14271 transaction failed 29201/-22, size 0-0 line 3005 binder: 14270:14274 got transaction to invalid handle binder: 14270:14274 transaction failed 29201/-22, size 0-0 line 3005 binder: undelivered TRANSACTION_ERROR: 29201 binder: undelivered TRANSACTION_ERROR: 29201 binder_alloc: 14490: binder_alloc_buf, no vma binder: 14490:14500 transaction failed 29189/-3, size 0-0 line 3128 binder: 14490:14504 unknown command 0 binder_alloc: 14490: binder_alloc_buf, no vma binder: 14490:14511 transaction failed 29189/-3, size 0-0 line 3128 binder: BINDER_SET_CONTEXT_MGR already set binder: 14490:14500 ioctl 40046207 0 returned -16 binder: 14490:14504 ioctl c0306201 2000a000 returned -22 binder: undelivered TRANSACTION_ERROR: 29189 binder: undelivered TRANSACTION_ERROR: 29189 binder: 14518:14526 got new transaction with bad transaction stack, transaction 89 has target 14518:0 binder: BINDER_SET_CONTEXT_MGR already set binder: 14518:14538 ioctl 40046207 0 returned -16 binder_alloc: binder_alloc_mmap_handler: 14518 2000c000-2000e000 already mapped failed -16 binder: 14518:14526 transaction failed 29201/-71, size 0-0 line 3032 binder_alloc: 14518: binder_alloc_buf, no vma binder: 14518:14538 transaction failed 29189/-3, size 0-0 line 3128 binder: release 14518:14526 transaction 89 out, still active binder: undelivered TRANSACTION_COMPLETE binder: undelivered TRANSACTION_ERROR: 29201 binder: undelivered TRANSACTION_ERROR: 29189 binder: send failed reply for transaction 89, target dead binder_alloc: binder_alloc_mmap_handler: 14644 20000000-20002000 already mapped failed -16 audit_printk_skb: 118 callbacks suppressed audit: type=1400 audit(1521513304.595:201): avc: denied { create } for pid=14701 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 audit: type=1400 audit(1521513304.635:202): avc: denied { getopt } for pid=14701 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 audit: type=1400 audit(1521513304.665:203): avc: denied { getopt } for pid=14701 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 audit: type=1400 audit(1521513304.695:204): avc: denied { create } for pid=14701 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 audit: type=1400 audit(1521513304.725:205): avc: denied { write } for pid=14701 comm="syz-executor3" path="socket:[32295]" dev="sockfs" ino=32295 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(1521513304.725:206): avc: denied { write } for pid=14701 comm="syz-executor3" path="socket:[32295]" dev="sockfs" ino=32295 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(1521513304.725:207): avc: denied { getopt } for pid=14701 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 audit: type=1400 audit(1521513304.725:208): avc: denied { getopt } for pid=14701 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 audit: type=1400 audit(1521513304.835:209): avc: denied { write } for pid=14701 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 netlink: 3 bytes leftover after parsing attributes in process `syz-executor3'. SELinux: unrecognized netlink message: protocol=0 nlmsg_type=59220 sclass=netlink_route_socket SELinux: unrecognized netlink message: protocol=0 nlmsg_type=59220 sclass=netlink_route_socket BUG: using __this_cpu_read() in preemptible [00000000] code: syz-executor1/14749 caller is __this_cpu_preempt_check+0x1c/0x20 lib/smp_processor_id.c:62 CPU: 0 PID: 14749 Comm: syz-executor1 Not tainted 4.4.120-gd63fdf6 #28 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 0000000000000000 7fb176c8d7d8432b ffff8800a9f076c8 ffffffff81d0408d 0000000000000000 ffffffff839fe5a0 ffffffff83d0be20 ffff8800b9721800 0000000000000003[ 84.403935] kasan: CONFIG_KASAN_INLINE enabledkasan: GPF could be caused by NULL-ptr deref or user memory accessgeneral protection fault: 0000 [#1] PREEMPT SMP KASAN Dumping ftrace buffer: (ftrace buffer empty) Modules linked in: CPU: 1 PID: 14758 Comm: syz-executor7 Not tainted 4.4.120-gd63fdf6 #28 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 task: ffff8801d61e1800 task.stack: ffff8800bad68000 RIP: 0010:[] [] netlink_getsockbyportid net/netlink/af_netlink.c:1102 [inline] RIP: 0010:[] [] netlink_unicast+0x1c0/0x760 net/netlink/af_netlink.c:1287 RSP: 0018:ffff8800bad6f778 EFLAGS: 00010246 RAX: dffffc0000000048 RBX: dffffc0000000000 RCX: ffffffff82f89d89 RDX: 0000000000010000 RSI: ffffc90001c7c000 RDI: ffff8801da27c5d8 RBP: ffff8800bad6f838 R08: ffffed00172a8a94 R09: ffffed00172a8a94 R10: 0000000000000000 R11: ffffed00172a8a93 R12: 0000000000000000 R13: dffffc0000000000 R14: ffff8801da27c500 R15: dffffc0000000006 FS: 00007f5528699700(0000) GS:ffff8801db300000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 0000001b9bc21000 CR3: 00000000aaea2000 CR4: 0000000000160670 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Stack: 1ffff100175adef6 ffff8800b9544200 0000000000000240 0000000000000030 1ffff100175adef6 dffffc0000000048 000000000000051a 0000000041b58ab3 ffffffff84001503 ffffffff82f89bd0 ffff8801da27c500 0000000000000000 Call Trace: [] netlink_ack+0x231/0x4b0 net/netlink/af_netlink.c:2322 [] nfnetlink_rcv_batch net/netfilter/nfnetlink.c:319 [inline] [] nfnetlink_rcv+0xaa2/0x1070 net/netfilter/nfnetlink.c:477 [] netlink_unicast_kernel net/netlink/af_netlink.c:1267 [inline] [] netlink_unicast+0x522/0x760 net/netlink/af_netlink.c:1293 [] netlink_sendmsg+0x8e8/0xc50 net/netlink/af_netlink.c:1847 [] sock_sendmsg_nosec net/socket.c:625 [inline] [] sock_sendmsg+0xca/0x110 net/socket.c:635 [] ___sys_sendmsg+0x6c1/0x7c0 net/socket.c:1962 [] __sys_sendmsg+0xd3/0x190 net/socket.c:1996 [] SYSC_sendmsg net/socket.c:2007 [inline] [] SyS_sendmsg+0x2d/0x50 net/socket.c:2003 [] entry_SYSCALL_64_fastpath+0x1c/0x98 Code: e7 6f 3d fe 48 8d 55 98 4c 89 e1 4c 89 f6 48 89 df e8 95 f7 ff ff 83 f8 01 0f 85 e1 03 00 00 e8 c7 6f 3d fe 48 8b 85 68 ff ff ff <0f> b6 00 84 c0 74 08 3c 03 0f 8e 63 05 00 00 41 80 3f 00 41 0f RIP [] netlink_getsockbyportid net/netlink/af_netlink.c:1102 [inline] RIP [] netlink_unicast+0x1c0/0x760 net/netlink/af_netlink.c:1287 RSP ---[ end trace 47684ec55b8576b7 ]---