====================================================== WARNING: possible circular locking dependency detected 4.16.0-rc5+ #352 Not tainted ------------------------------------------------------ audit: type=1400 audit(1521002687.416:91): avc: denied { ipc_lock } for pid=9226 comm="syz-executor5" capability=14 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 syz-executor4/9219 is trying to acquire lock: (&sb->s_type->i_mutex_key#11){++++}, at: [<0000000074bb3a82>] inode_lock include/linux/fs.h:713 [inline] (&sb->s_type->i_mutex_key#11){++++}, at: [<0000000074bb3a82>] shmem_file_llseek+0xef/0x240 mm/shmem.c:2579 but task is already holding lock: (ashmem_mutex){+.+.}, at: [<00000000ac921ace>] ashmem_llseek+0x56/0x1f0 drivers/staging/android/ashmem.c:326 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:756 [inline] __mutex_lock+0x16f/0x1a80 kernel/locking/mutex.c:893 mutex_lock_nested+0x16/0x20 kernel/locking/mutex.c:908 ashmem_mmap+0x53/0x410 drivers/staging/android/ashmem.c:362 call_mmap include/linux/fs.h:1786 [inline] mmap_region+0xa99/0x15a0 mm/mmap.c:1705 do_mmap+0x6c0/0xe00 mm/mmap.c:1483 do_mmap_pgoff include/linux/mm.h:2223 [inline] vm_mmap_pgoff+0x1de/0x280 mm/util.c:355 SYSC_mmap_pgoff mm/mmap.c:1533 [inline] SyS_mmap_pgoff+0x462/0x5f0 mm/mmap.c:1491 SYSC_mmap arch/x86/kernel/sys_x86_64.c:100 [inline] SyS_mmap+0x16/0x20 arch/x86/kernel/sys_x86_64.c:91 do_syscall_64+0x281/0x940 arch/x86/entry/common.c:287 entry_SYSCALL_64_after_hwframe+0x42/0xb7 -> #1 (&mm->mmap_sem){++++}: __might_fault+0x13a/0x1d0 mm/memory.c:4571 _copy_to_user+0x2c/0xc0 lib/usercopy.c:25 copy_to_user include/linux/uaccess.h:155 [inline] filldir+0x1a7/0x320 fs/readdir.c:196 dir_emit_dot include/linux/fs.h:3370 [inline] dir_emit_dots include/linux/fs.h:3381 [inline] dcache_readdir+0x12d/0x5e0 fs/libfs.c:192 iterate_dir+0x1ca/0x530 fs/readdir.c:51 SYSC_getdents fs/readdir.c:231 [inline] SyS_getdents+0x225/0x450 fs/readdir.c:212 do_syscall_64+0x281/0x940 arch/x86/entry/common.c:287 entry_SYSCALL_64_after_hwframe+0x42/0xb7 -> #0 (&sb->s_type->i_mutex_key#11){++++}: lock_acquire+0x1d5/0x580 kernel/locking/lockdep.c:3920 down_write+0x87/0x120 kernel/locking/rwsem.c:70 inode_lock include/linux/fs.h:713 [inline] shmem_file_llseek+0xef/0x240 mm/shmem.c:2579 vfs_llseek+0xa2/0xd0 fs/read_write.c:300 ashmem_llseek+0xe7/0x1f0 drivers/staging/android/ashmem.c:338 vfs_llseek fs/read_write.c:300 [inline] SYSC_lseek fs/read_write.c:313 [inline] SyS_lseek+0xeb/0x170 fs/read_write.c:304 do_syscall_64+0x281/0x940 arch/x86/entry/common.c:287 entry_SYSCALL_64_after_hwframe+0x42/0xb7 other info that might help us debug this: Chain exists of: &sb->s_type->i_mutex_key#11 --> &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#11); *** DEADLOCK *** 1 lock held by syz-executor4/9219: #0: (ashmem_mutex){+.+.}, at: [<00000000ac921ace>] ashmem_llseek+0x56/0x1f0 drivers/staging/android/ashmem.c:326 stack backtrace: CPU: 0 PID: 9219 Comm: syz-executor4 Not tainted 4.16.0-rc5+ #352 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:17 [inline] dump_stack+0x194/0x24d lib/dump_stack.c:53 print_circular_bug.isra.38+0x2cd/0x2dc kernel/locking/lockdep.c:1223 check_prev_add kernel/locking/lockdep.c:1863 [inline] check_prevs_add kernel/locking/lockdep.c:1976 [inline] validate_chain kernel/locking/lockdep.c:2417 [inline] __lock_acquire+0x30a8/0x3e00 kernel/locking/lockdep.c:3431 lock_acquire+0x1d5/0x580 kernel/locking/lockdep.c:3920 down_write+0x87/0x120 kernel/locking/rwsem.c:70 inode_lock include/linux/fs.h:713 [inline] shmem_file_llseek+0xef/0x240 mm/shmem.c:2579 vfs_llseek+0xa2/0xd0 fs/read_write.c:300 ashmem_llseek+0xe7/0x1f0 drivers/staging/android/ashmem.c:338 vfs_llseek fs/read_write.c:300 [inline] SYSC_lseek fs/read_write.c:313 [inline] SyS_lseek+0xeb/0x170 fs/read_write.c:304 do_syscall_64+0x281/0x940 arch/x86/entry/common.c:287 entry_SYSCALL_64_after_hwframe+0x42/0xb7 RIP: 0033:0x453e69 RSP: 002b:00007f52907a3c68 EFLAGS: 00000246 ORIG_RAX: 0000000000000008 RAX: ffffffffffffffda RBX: 00007f52907a46d4 RCX: 0000000000453e69 RDX: 0000000000000004 RSI: 0000000001000000 RDI: 0000000000000016 RBP: 000000000072bea0 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 00000000ffffffff R13: 00000000000003da R14: 00000000006f5d10 R15: 0000000000000000 QAT: Invalid ioctl QAT: Invalid ioctl netlink: 144 bytes leftover after parsing attributes in process `syz-executor1'. openvswitch: netlink: Flow set message rejected, Key attribute missing. TCP: request_sock_TCPv6: Possible SYN flooding on port 20002. Sending cookies. Check SNMP counters. netlink: 144 bytes leftover after parsing attributes in process `syz-executor1'. openvswitch: netlink: Flow set message rejected, Key attribute missing. audit: type=1400 audit(1521002689.380:92): avc: denied { net_bind_service } for pid=1279 comm="xprtiod" capability=10 scontext=system_u:system_r:kernel_t:s0 tcontext=system_u:system_r:kernel_t:s0 tclass=cap_userns permissive=1 audit: type=1326 audit(1521002689.445:93): auid=4294967295 uid=0 gid=0 ses=4294967295 subj=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 pid=9323 comm="syz-executor0" exe="/root/syz-executor0" sig=31 arch=c000003e syscall=202 compat=0 ip=0x453e69 code=0x0 9pnet_virtio: no channels available for device ./file0 9pnet_virtio: no channels available for device ./file0 audit: type=1326 audit(1521002689.510:94): auid=4294967295 uid=0 gid=0 ses=4294967295 subj=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 pid=9323 comm="syz-executor0" exe="/root/syz-executor0" sig=31 arch=c000003e syscall=202 compat=0 ip=0x453e69 code=0x0 audit: type=1400 audit(1521002689.632:95): avc: denied { ioctl } for pid=9379 comm="syz-executor3" path="socket:[25753]" dev="sockfs" ino=25753 ioctlcmd=0x89e2 scontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tcontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tclass=sock_file permissive=1 audit: type=1400 audit(1521002689.769:96): avc: denied { setattr } for pid=9420 comm="syz-executor1" name="oom_score_adj" dev="proc" ino=25447 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 audit: type=1400 audit(1521002689.812:97): avc: denied { read } for pid=9399 comm="syz-executor5" scontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tcontext=system_u:object_r:unlabeled_t:s0 tclass=socket permissive=1 binder: BINDER_SET_CONTEXT_MGR already set binder: 9442:9445 ioctl 40046207 0 returned -16 binder_alloc: 9442: binder_alloc_buf, no vma binder: 9442:9445 transaction failed 29189/-3, size 0-0 line 2963 binder: undelivered TRANSACTION_ERROR: 29189 binder: send failed reply for transaction 23 to 9442:9444 binder: undelivered TRANSACTION_COMPLETE binder: undelivered TRANSACTION_ERROR: 29189 audit: type=1400 audit(1521002690.037:98): avc: denied { create } for pid=9481 comm="syz-executor4" scontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tcontext=system_u:object_r:unlabeled_t:s0 tclass=key permissive=1 mac80211_hwsim: wmediumd released netlink socket, switching to perfect channel medium binder: 9598:9604 Acquire 1 refcount change on invalid ref 0 ret -22 binder: 9598:9616 Acquire 1 refcount change on invalid ref 0 ret -22 sg_write: data in/out 63946373/8 bytes for SCSI command 0x0-- guessing data in; program syz-executor0 not setting count and/or reply_len properly audit: type=1400 audit(1521002690.516:99): avc: denied { read } for pid=9629 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 sg_write: data in/out 63946373/8 bytes for SCSI command 0x0-- guessing data in; program syz-executor0 not setting count and/or reply_len properly audit: type=1400 audit(1521002690.717:100): avc: denied { transfer } for pid=9686 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=binder permissive=1 binder: BINDER_SET_CONTEXT_MGR already set binder: 9686:9703 ioctl 40046207 0 returned -16 binder_alloc: 9686: binder_alloc_buf, no vma binder: 9686:9690 transaction failed 29189/-3, size 40-8 line 2963 binder: undelivered TRANSACTION_ERROR: 29189 binder: release 9686:9690 transaction 26 out, still active binder: unexpected work type, 4, not freed binder: undelivered TRANSACTION_COMPLETE binder: send failed reply for transaction 26, target dead netlink: 444 bytes leftover after parsing attributes in process `syz-executor1'. netlink: 444 bytes leftover after parsing attributes in process `syz-executor1'. SELinux: unrecognized netlink message: protocol=0 nlmsg_type=2336 sclass=netlink_route_socket pig=9808 comm=syz-executor1 SELinux: unrecognized netlink message: protocol=0 nlmsg_type=2336 sclass=netlink_route_socket pig=9813 comm=syz-executor1 TCP: request_sock_TCPv6: Possible SYN flooding on port 20002. Sending cookies. Check SNMP counters. audit: type=1400 audit(1521002691.242:101): avc: denied { bind } for pid=9867 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_generic_socket permissive=1 binder_alloc: 9949: binder_alloc_buf, no vma binder: 9949:9951 transaction failed 29189/-3, size 40-0 line 2963 binder: BINDER_SET_CONTEXT_MGR already set binder: 9949:9956 ioctl 40046207 0 returned -16 binder_alloc: 9949: binder_alloc_buf, no vma binder: 9949:9951 transaction failed 29189/-3, size 40-0 line 2963 binder: undelivered TRANSACTION_ERROR: 29189 binder: undelivered TRANSACTION_ERROR: 29189 binder: 10065 RLIMIT_NICE not set ebt_among: wrong size: 2208 against expected 12, rounded to 16 binder: 10065 RLIMIT_NICE not set binder: BINDER_SET_CONTEXT_MGR already set binder: 10061:10065 ioctl c0306201 20004000 returned -14 binder: 10061:10075 ioctl 40046207 0 returned -16 binder: release 10061:10065 transaction 34 in, still active binder: send failed reply for transaction 34 to 10061:10075 binder: undelivered TRANSACTION_COMPLETE binder: undelivered TRANSACTION_ERROR: 29189 binder: send failed reply for transaction 35 to 10061:10090 binder: undelivered TRANSACTION_COMPLETE binder: undelivered TRANSACTION_ERROR: 29189 dccp_invalid_packet: pskb_may_pull failed dccp_invalid_packet: pskb_may_pull failed ieee80211 phy2: Selected rate control algorithm 'minstrel_ht' ieee80211 phy3: Selected rate control algorithm 'minstrel_ht' ieee80211 phy4: Selected rate control algorithm 'minstrel_ht' binder_alloc: binder_alloc_mmap_handler: 10399 20000000-20002000 already mapped failed -16