====================================================== [ INFO: possible circular locking dependency detected ] 4.9.86-gb324a70 #58 Not tainted ------------------------------------------------------- syz-executor2/8712 is trying to acquire lock: netlink: 3 bytes leftover after parsing attributes in process `syz-executor3'. netlink: 3 bytes leftover after parsing attributes in process `syz-executor3'. netlink: 3 bytes leftover after parsing attributes in process `syz-executor3'. netlink: 3 bytes leftover after parsing attributes in process `syz-executor3'. (&sb->s_type->i_mutex_key#10){++++++} but task is already holding lock: (ashmem_mutex){+.+.+.}, at: [] ashmem_llseek+0x56/0x1f0 drivers/staging/android/ashmem.c:343 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #2 (ashmem_mutex){+.+.+.}: __mutex_lock_common kernel/locking/mutex.c:521 [inline] mutex_lock_nested+0xbb/0x870 kernel/locking/mutex.c:621 ashmem_mmap+0x53/0x400 drivers/staging/android/ashmem.c:379 mmap_region+0x7dd/0xfd0 mm/mmap.c:1694 do_mmap+0x57b/0xbe0 mm/mmap.c:1473 do_mmap_pgoff include/linux/mm.h:2032 [inline] vm_mmap_pgoff+0x16b/0x1b0 mm/util.c:329 SYSC_mmap_pgoff mm/mmap.c:1523 [inline] SyS_mmap_pgoff+0x33f/0x560 mm/mmap.c:1481 do_syscall_32_irqs_on arch/x86/entry/common.c:325 [inline] do_fast_syscall_32+0x2f5/0x870 arch/x86/entry/common.c:387 entry_SYSENTER_compat+0x90/0xa2 arch/x86/entry/entry_64_compat.S:137 -> #1 (&mm->mmap_sem){++++++}: __might_fault+0x14a/0x1d0 mm/memory.c:4014 copy_to_user arch/x86/include/asm/uaccess.h:727 [inline] filldir+0x1aa/0x340 fs/readdir.c:195 dir_emit_dot include/linux/fs.h:3223 [inline] dir_emit_dots include/linux/fs.h:3234 [inline] dcache_readdir+0x12d/0x5e0 fs/libfs.c:191 iterate_dir+0x4a6/0x5d0 fs/readdir.c:50 SYSC_getdents fs/readdir.c:230 [inline] SyS_getdents+0x14a/0x2a0 fs/readdir.c:211 do_syscall_64+0x1a4/0x490 arch/x86/entry/common.c:282 entry_SYSCALL_64_after_swapgs+0x5d/0xdb -> #0 (&sb->s_type->i_mutex_key#10){++++++}: lock_acquire+0x12e/0x410 kernel/locking/lockdep.c:3756 down_write+0x41/0xa0 kernel/locking/rwsem.c:52 inode_lock include/linux/fs.h:747 [inline] shmem_file_llseek+0xef/0x240 mm/shmem.c:2403 vfs_llseek+0xa2/0xd0 fs/read_write.c:298 ashmem_llseek+0xe7/0x1f0 drivers/staging/android/ashmem.c:355 vfs_llseek fs/read_write.c:298 [inline] SYSC_lseek fs/read_write.c:311 [inline] SyS_lseek fs/read_write.c:302 [inline] C_SYSC_lseek fs/read_write.c:323 [inline] compat_SyS_lseek+0xeb/0x170 fs/read_write.c:321 do_syscall_32_irqs_on arch/x86/entry/common.c:325 [inline] do_fast_syscall_32+0x2f5/0x870 arch/x86/entry/common.c:387 entry_SYSENTER_compat+0x90/0xa2 arch/x86/entry/entry_64_compat.S:137 other info that might help us debug this: Chain exists of: &sb->s_type->i_mutex_key#10 --> &mm->mmap_sem --> ashmem_mutex CPU0 CPU1 ---- ---- lock( ashmem_mutex); &mm->mmap_sem); ashmem_mutex); &sb->s_type->i_mutex_key#10); *** DEADLOCK *** 1 lock held by syz-executor2/8712: #0: (ashmem_mutex){+.+.+.}, at: [] ashmem_llseek+0x56/0x1f0 drivers/staging/android/ashmem.c:343 stack backtrace: CPU: 0 PID: 8712 Comm: syz-executor2 Not tainted 4.9.86-gb324a70 #58 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 ffff8801b3bffb28 ffffffff81d956f9 ffffffff853a5db0 ffffffff853af3e0 ffffffff853c5490 ffff8801b58d50d8 ffff8801b58d4800 ffff8801b3bffb70 ffffffff812387f1 ffff8801b58d50d8 00000000b58d50b0 ffff8801b58d50d8Call Trace: [] __dump_stack lib/dump_stack.c:15 [inline] [] dump_stack+0xc1/0x128 lib/dump_stack.c:51 [] print_circular_bug+0x271/0x310 kernel/locking/lockdep.c:1202 [] check_prev_add kernel/locking/lockdep.c:1828 [inline] [] check_prevs_add kernel/locking/lockdep.c:1938 [inline] [] validate_chain kernel/locking/lockdep.c:2265 [inline] [] __lock_acquire+0x2bf9/0x3640 kernel/locking/lockdep.c:3345 [] lock_acquire+0x12e/0x410 kernel/locking/lockdep.c:3756 [] down_write+0x41/0xa0 kernel/locking/rwsem.c:52 [] inode_lock include/linux/fs.h:747 [inline] [] shmem_file_llseek+0xef/0x240 mm/shmem.c:2403 [] vfs_llseek+0xa2/0xd0 fs/read_write.c:298 [] ashmem_llseek+0xe7/0x1f0 drivers/staging/android/ashmem.c:355 [] vfs_llseek fs/read_write.c:298 [inline] [] SYSC_lseek fs/read_write.c:311 [inline] [] SyS_lseek fs/read_write.c:302 [inline] [] C_SYSC_lseek fs/read_write.c:323 [inline] [] compat_SyS_lseek+0xeb/0x170 fs/read_write.c:321 [] do_syscall_32_irqs_on arch/x86/entry/common.c:325 [inline] [] do_fast_syscall_32+0x2f5/0x870 arch/x86/entry/common.c:387 [] entry_SYSENTER_compat+0x90/0xa2 arch/x86/entry/entry_64_compat.S:137 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(1520276866.643:36): avc: denied { write } for pid=8770 comm="syz-executor2" path="socket:[21134]" dev="sockfs" ino=21134 scontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tcontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tclass=netlink_connector_socket permissive=1 binder: 8843:8844 transaction failed 29189/-22, size 40-8 line 3004 binder: 8843:8844 ioctl c0106434 20000000 returned -22 binder: 8843:8844 ioctl c0106434 20000040 returned -22 binder: BINDER_SET_CONTEXT_MGR already set binder: 8843:8844 ioctl 40046207 0 returned -16 binder_alloc: 8843: binder_alloc_buf, no vma binder: 8843:8857 ioctl c0106434 20000000 returned -22 binder: 8843:8852 ioctl c0106434 20000040 returned -22 binder: BINDER_SET_CONTEXT_MGR already set binder: 8843:8857 ioctl 40046207 0 returned -16 binder: 8843:8844 transaction failed 29189/-3, size 40-8 line 3127 netlink: 8 bytes leftover after parsing attributes in process `syz-executor2'. netlink: 8 bytes leftover after parsing attributes in process `syz-executor2'. binder: 8956:8962 got new transaction with bad transaction stack, transaction 41 has target 8956:0 binder: 8956:8962 transaction failed 29201/-71, size 137438969856-137438986240 line 3031 binder: BINDER_SET_CONTEXT_MGR already set binder: 8956:8964 ioctl 40046207 0 returned -16 binder: 8956:8964 got transaction to invalid handle binder_alloc: 8956: binder_alloc_buf, no vma binder: 8956:8962 transaction failed 29189/-3, size 40-8 line 3127 binder: 8956:8964 transaction failed 29201/-22, size 137438969856-137438986240 line 3004 binder: undelivered TRANSACTION_ERROR: 29189 binder: undelivered TRANSACTION_ERROR: 29201 binder: release 8956:8962 transaction 41 out, still active binder: unexpected work type, 4, not freed binder: undelivered TRANSACTION_COMPLETE binder: undelivered TRANSACTION_ERROR: 29201 binder: send failed reply for transaction 41, target dead Can not set IPV6_FL_F_REFLECT if flowlabel_consistency sysctl is enable Can not set IPV6_FL_F_REFLECT if flowlabel_consistency sysctl is enable audit: type=1400 audit(1520276867.713:37): avc: denied { write } for pid=9081 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_generic_socket permissive=1 audit: type=1400 audit(1520276867.743:38): avc: denied { execute } for pid=9097 comm="syz-executor4" path="pipe:[21561]" dev="pipefs" ino=21561 scontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tcontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tclass=fifo_file permissive=1 SELinux: unrecognized netlink message: protocol=0 nlmsg_type=51988 sclass=netlink_route_socket pig=9123 comm=syz-executor2 SELinux: unrecognized netlink message: protocol=0 nlmsg_type=51988 sclass=netlink_route_socket pig=9135 comm=syz-executor2 binder: 9142:9145 got transaction with invalid offsets ptr binder: 9142:9145 transaction failed 29201/-14, size 40-8 line 3155 binder: BINDER_SET_CONTEXT_MGR already set binder: 9142:9160 ioctl 40046207 0 returned -16 binder: 9163:9168 Acquire 1 refcount change on invalid ref 0 ret -22 binder: 9163:9168 BC_REQUEST_DEATH_NOTIFICATION invalid ref 1 binder_alloc: 9142: binder_alloc_buf, no vma binder: 9142:9145 transaction failed 29189/-3, size 40-8 line 3127 binder: 9142:9173 Release 1 refcount change on invalid ref 1 ret -22 binder_alloc: 9142: binder_alloc_buf, no vma binder: 9142:9173 transaction failed 29189/-3, size 0-0 line 3127 binder: 9163:9184 Acquire 1 refcount change on invalid ref 0 ret -22 binder: 9163:9181 BC_REQUEST_DEATH_NOTIFICATION invalid ref 1 binder: undelivered TRANSACTION_ERROR: 29189 binder: undelivered TRANSACTION_ERROR: 29189 binder: undelivered TRANSACTION_ERROR: 29201 BUG: using __this_cpu_read() in preemptible [00000000] code: syz-executor2/9343 caller is __this_cpu_preempt_check+0x1c/0x20 lib/smp_processor_id.c:62 CPU: 0 PID: 9343 Comm: syz-executor2 Not tainted 4.9.86-gb324a70 #58 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 ffff8801b0dff668 ffffffff81d956f9 0000000000000000 ffffffff83c19000 ffffffff83f45e20 ffff8801c5978000 0000000000000003 ffff8801b0dff6a8 ffffffff81dfccf4 ffff8801b0dff6c0 ffffffff83f45e20 dffffc0000000000 Call Trace: [] __dump_stack lib/dump_stack.c:15 [inline] [] dump_stack+0xc1/0x128 lib/dump_stack.c:51 [] check_preemption_disabled+0x1d4/0x200 lib/smp_processor_id.c:46 [] __this_cpu_preempt_check+0x1c/0x20 lib/smp_processor_id.c:62 [] ipcomp_alloc_tfms net/xfrm/xfrm_ipcomp.c:286 [inline] [] ipcomp_init_state+0x188/0x930 net/xfrm/xfrm_ipcomp.c:363 [] ipcomp4_init_state+0xb0/0x7d0 net/ipv4/ipcomp.c:137 [] __xfrm_init_state+0x3e7/0xb30 net/xfrm/xfrm_state.c:2096 [] xfrm_init_state+0x1a/0x20 net/xfrm/xfrm_state.c:2122 [] pfkey_msg2xfrm_state net/key/af_key.c:1289 [inline] [] pfkey_add+0x1fb9/0x3470 net/key/af_key.c:1506 [] pfkey_process+0x68b/0x750 net/key/af_key.c:2834 [] pfkey_sendmsg+0x3a9/0x760 net/key/af_key.c:3678 [] sock_sendmsg_nosec net/socket.c:635 [inline] [] sock_sendmsg+0xca/0x110 net/socket.c:645 [] ___sys_sendmsg+0x6d1/0x7e0 net/socket.c:1969 [] __sys_sendmsg+0xd6/0x190 net/socket.c:2003 [] C_SYSC_sendmsg net/compat.c:734 [inline] [] compat_SyS_sendmsg+0x2a/0x40 net/compat.c:732 [] do_syscall_32_irqs_on arch/x86/entry/common.c:325 [inline] [] do_fast_syscall_32+0x2f5/0x870 arch/x86/entry/common.c:387 [] entry_SYSENTER_compat+0x90/0xa2 arch/x86/entry/entry_64_compat.S:137 audit: type=1400 audit(1520276869.173:39): avc: denied { setopt } for pid=9522 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 audit: type=1400 audit(1520276869.763:40): avc: denied { net_bind_service } for pid=9586 comm="syz-executor2" capability=10 scontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tcontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tclass=cap_userns permissive=1 sock: sock_set_timeout: `syz-executor2' (pid 9784) tries to set negative timeout sock: sock_set_timeout: `syz-executor2' (pid 9784) tries to set negative timeout device lo entered promiscuous mode device lo left promiscuous mode SELinux: unrecognized netlink message: protocol=9 nlmsg_type=90 sclass=netlink_audit_socket pig=10014 comm=syz-executor1 SELinux: unrecognized netlink message: protocol=9 nlmsg_type=90 sclass=netlink_audit_socket pig=10014 comm=syz-executor1