audit: type=1400 audit(1521012066.434:100): avc: denied { map } for pid=16366 comm="syz-executor4" path="socket:[52956]" dev="sockfs" ino=52956 scontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tcontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tclass=packet_socket permissive=1 ====================================================== WARNING: possible circular locking dependency detected 4.16.0-rc5+ #352 Not tainted ------------------------------------------------------ syz-executor2/16388 is trying to acquire lock: (&sb->s_type->i_mutex_key#11){++++}, at: [<00000000135b6a2c>] inode_lock include/linux/fs.h:713 [inline] (&sb->s_type->i_mutex_key#11){++++}, at: [<00000000135b6a2c>] shmem_file_llseek+0xef/0x240 mm/shmem.c:2579 but task is already holding lock: (ashmem_mutex){+.+.}, at: [<0000000025bde4c7>] 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-executor2/16388: #0: (ashmem_mutex){+.+.}, at: [<0000000025bde4c7>] ashmem_llseek+0x56/0x1f0 drivers/staging/android/ashmem.c:326 stack backtrace: CPU: 0 PID: 16388 Comm: syz-executor2 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:00007f5d52581c68 EFLAGS: 00000246 ORIG_RAX: 0000000000000008 RAX: ffffffffffffffda RBX: 00007f5d525826d4 RCX: 0000000000453e69 RDX: 0000000800000003 RSI: 0000004000000000 RDI: 0000000000000013 RBP: 000000000072bea0 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 00000000ffffffff R13: 00000000000003da R14: 00000000006f5d10 R15: 0000000000000000 kernel msg: ebtables bug: please report to author: Wrong len argument kernel msg: ebtables bug: please report to author: Wrong len argument binder: 16575:16584 got transaction with invalid data ptr binder: 16575:16584 transaction failed 29201/-14, size 40-8 line 2982 binder: undelivered TRANSACTION_ERROR: 29201 binder: BINDER_SET_CONTEXT_MGR already set audit: type=1400 audit(1521012067.617:101): avc: denied { map } for pid=16600 comm="syz-executor1" path="/proc/929/schedstat" dev="proc" ino=54435 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 binder: 16575:16598 ioctl 40046207 0 returned -16 audit: type=1400 audit(1521012067.617:102): avc: denied { execute } for pid=16600 comm="syz-executor1" path="/proc/929/schedstat" dev="proc" ino=54435 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 binder_alloc: 16575: binder_alloc_buf, no vma binder: 16575:16584 transaction failed 29189/-3, size 40-8 line 2963 audit: type=1400 audit(1521012067.688:103): avc: denied { setattr } for pid=16600 comm="syz-executor1" path="/proc/929/schedstat" dev="proc" ino=54435 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 binder: undelivered TRANSACTION_ERROR: 29189 can: request_module (can-proto-0) failed. can: request_module (can-proto-0) failed. kernel msg: ebtables bug: please report to author: entries_size too small syz-executor7 (16847): /proc/16838/oom_adj is deprecated, please use /proc/16838/oom_score_adj instead. rfkill: input handler disabled rfkill: input handler enabled rfkill: input handler disabled rfkill: input handler enabled device lo entered promiscuous mode device lo left promiscuous mode QAT: Invalid ioctl QAT: Invalid ioctl device lo entered promiscuous mode device lo left promiscuous mode kernel msg: ebtables bug: please report to author: counter_offset != totalcnt kernel msg: ebtables bug: please report to author: counter_offset != totalcnt audit: type=1400 audit(1521012070.392:104): avc: denied { create } for pid=17529 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_scsitransport_socket permissive=1 sg_write: data in/out 1048540/92 bytes for SCSI command 0x0-- guessing data in; program syz-executor3 not setting count and/or reply_len properly sg_write: data in/out 1048540/92 bytes for SCSI command 0x0-- guessing data in; program syz-executor3 not setting count and/or reply_len properly TCP: request_sock_TCP: Possible SYN flooding on port 20002. Sending cookies. Check SNMP counters. bond0: option active_slave: mode dependency failed, not supported in mode balance-rr(0) bond0: option active_slave: mode dependency failed, not supported in mode balance-rr(0) FAULT_INJECTION: forcing a failure. name failslab, interval 1, probability 0, space 0, times 1 CPU: 1 PID: 17884 Comm: syz-executor7 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 fail_dump lib/fault-inject.c:51 [inline] should_fail+0x8c0/0xa40 lib/fault-inject.c:149 should_failslab+0xec/0x120 mm/failslab.c:32 slab_pre_alloc_hook mm/slab.h:422 [inline] slab_alloc mm/slab.c:3365 [inline] kmem_cache_alloc+0x47/0x760 mm/slab.c:3539 aio_get_req fs/aio.c:1033 [inline] io_submit_one fs/aio.c:1562 [inline] do_io_submit+0x356/0x1520 fs/aio.c:1682 SYSC_io_submit fs/aio.c:1707 [inline] SyS_io_submit+0x27/0x30 fs/aio.c:1704 do_syscall_64+0x281/0x940 arch/x86/entry/common.c:287 entry_SYSCALL_64_after_hwframe+0x42/0xb7 RIP: 0033:0x453e69 RSP: 002b:00007fc5e618dc68 EFLAGS: 00000246 ORIG_RAX: 00000000000000d1 RAX: ffffffffffffffda RBX: 00007fc5e618e6d4 RCX: 0000000000453e69 RDX: 0000000020356ff0 RSI: 0000000000000001 RDI: 00007fc5e616d000 RBP: 000000000072bea0 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000014 R13: 0000000000000186 R14: 00000000006f2530 R15: 0000000000000000 audit: type=1326 audit(1521012073.267:105): auid=4294967295 uid=0 gid=0 ses=4294967295 subj=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 pid=18043 comm="syz-executor5" exe="/root/syz-executor5" sig=31 arch=c000003e syscall=202 compat=0 ip=0x453e69 code=0x0 audit: type=1326 audit(1521012073.327:106): auid=4294967295 uid=0 gid=0 ses=4294967295 subj=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 pid=18043 comm="syz-executor5" exe="/root/syz-executor5" sig=31 arch=c000003e syscall=202 compat=0 ip=0x453e69 code=0x0 binder_alloc: binder_alloc_mmap_handler: 18162 20001000-20005000 already mapped failed -16 CUSE: DEVNAME unspecified binder: 18252:18254 got transaction with invalid data ptr binder: 18252:18254 transaction failed 29201/-14, size 40-0 line 2982 binder: BINDER_SET_CONTEXT_MGR already set binder: 18252:18262 ioctl 40046207 0 returned -16 binder: undelivered TRANSACTION_ERROR: 29201 QAT: Invalid ioctl QAT: Invalid ioctl audit: type=1400 audit(1521012074.075:107): avc: denied { map } for pid=18315 comm="syz-executor3" path="/dev/adsp0" dev="devtmpfs" ino=53247 scontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tcontext=unconfined_u:object_r:device_t:s0 tclass=file permissive=1 binder: 18383:18384 unknown command 1076912913 binder: 18383:18384 ioctl c0306201 2000afd0 returned -22 binder: 18383:18384 ioctl 40046205 7 returned -22 binder: 18383:18384 unknown command 1076912913 binder: 18383:18384 ioctl c0306201 2000afd0 returned -22 SELinux: unrecognized netlink message: protocol=0 nlmsg_type=10882 sclass=netlink_route_socket pig=18402 comm=syz-executor7 SELinux: unrecognized netlink message: protocol=0 nlmsg_type=10882 sclass=netlink_route_socket pig=18402 comm=syz-executor7 SELinux: unrecognized netlink message: protocol=0 nlmsg_type=0 sclass=netlink_route_socket pig=18513 comm=syz-executor5 SELinux: unrecognized netlink message: protocol=0 nlmsg_type=0 sclass=netlink_route_socket pig=18518 comm=syz-executor5