[....] Starting file context maintaining daemon: restorecond[?25l[?1c7[ ok 8[?25h[?0c. [....] Starting OpenBSD Secure Shell server: sshd[?25l[?1c7[ ok 8[?25h[?0c. Debian GNU/Linux 7 syzkaller ttyS0 syzkaller login: [ 22.287665] random: sshd: uninitialized urandom read (32 bytes read) [ 22.731094] audit: type=1400 audit(1544424689.188:6): avc: denied { map } for pid=1767 comm="bash" path="/bin/bash" dev="sda1" ino=1457 scontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tcontext=system_u:object_r:file_t:s0 tclass=file permissive=1 [ 22.765075] random: sshd: uninitialized urandom read (32 bytes read) [ 23.245092] random: sshd: uninitialized urandom read (32 bytes read) [ 23.402841] random: sshd: uninitialized urandom read (32 bytes read) Warning: Permanently added '10.128.0.82' (ECDSA) to the list of known hosts. [ 29.113329] random: sshd: uninitialized urandom read (32 bytes read) executing program executing program executing program executing program executing program executing program [ 29.199740] audit: type=1400 audit(1544424695.648:7): avc: denied { map } for pid=1779 comm="syz-executor193" path="/root/syz-executor193986029" dev="sda1" ino=16481 scontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tcontext=unconfined_u:object_r:user_home_t:s0 tclass=file permissive=1 [ 29.256118] audit: type=1400 audit(1544424695.648:8): avc: denied { map } for pid=1787 comm="syz-executor193" path="/dev/ashmem" dev="devtmpfs" ino=1082 scontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tcontext=system_u:object_r:device_t:s0 tclass=chr_file permissive=1 [ 29.282101] [ 29.283747] ====================================================== [ 29.290185] WARNING: possible circular locking dependency detected [ 29.296489] 4.14.87+ #19 Not tainted [ 29.300198] ------------------------------------------------------ executing program executing program executing program executing program [ 29.306552] syz-executor193/1792 is trying to acquire lock: [ 29.312236] (&mm->mmap_sem){++++}, at: [] __do_page_fault+0x868/0xb60 [ 29.320455] [ 29.320455] but task is already holding lock: [ 29.326392] (&sb->s_type->i_mutex_key#10){+.+.}, at: [] generic_file_write_iter+0x99/0x650 [ 29.336417] [ 29.336417] which lock already depends on the new lock. [ 29.336417] [ 29.344700] [ 29.344700] the existing dependency chain (in reverse order) is: [ 29.352296] executing program executing program executing program executing program [ 29.352296] -> #2 (&sb->s_type->i_mutex_key#10){+.+.}: [ 29.359048] down_write+0x34/0x90 [ 29.363017] shmem_fallocate+0x149/0xb20 [ 29.367585] ashmem_shrink_scan+0x1b6/0x4e0 [ 29.372429] ashmem_ioctl+0x2cc/0xe20 [ 29.376737] do_vfs_ioctl+0x1a0/0x1030 [ 29.381129] SyS_ioctl+0x7e/0xb0 [ 29.385002] do_syscall_64+0x19b/0x4b0 [ 29.389404] entry_SYSCALL_64_after_hwframe+0x42/0xb7 [ 29.395100] [ 29.395100] -> #1 (ashmem_mutex){+.+.}: [ 29.400549] __mutex_lock+0xf5/0x1480 executing program executing program [ 29.404876] ashmem_mmap+0x4c/0x430 [ 29.409018] mmap_region+0x836/0xfb0 [ 29.413256] do_mmap+0x551/0xb80 [ 29.417132] vm_mmap_pgoff+0x180/0x1d0 [ 29.421558] SyS_mmap_pgoff+0xf8/0x1a0 [ 29.426027] do_syscall_64+0x19b/0x4b0 [ 29.430423] entry_SYSCALL_64_after_hwframe+0x42/0xb7 [ 29.436116] [ 29.436116] -> #0 (&mm->mmap_sem){++++}: [ 29.441668] lock_acquire+0x10f/0x380 [ 29.445979] down_read+0x37/0xa0 [ 29.449868] __do_page_fault+0x868/0xb60 executing program executing program executing program [ 29.454441] page_fault+0x22/0x50 [ 29.458409] iov_iter_fault_in_readable+0x2b9/0x370 [ 29.463978] generic_perform_write+0x166/0x430 [ 29.469111] __generic_file_write_iter+0x345/0x540 [ 29.474549] generic_file_write_iter+0x36f/0x650 [ 29.479843] __vfs_write+0x417/0x5c0 [ 29.484076] vfs_write+0x17f/0x4d0 [ 29.488123] SyS_write+0xc2/0x1a0 [ 29.492097] do_syscall_64+0x19b/0x4b0 [ 29.496498] entry_SYSCALL_64_after_hwframe+0x42/0xb7 [ 29.502191] executing program executing program executing program [ 29.502191] other info that might help us debug this: [ 29.502191] [ 29.510325] Chain exists of: [ 29.510325] &mm->mmap_sem --> ashmem_mutex --> &sb->s_type->i_mutex_key#10 [ 29.510325] [ 29.521849] Possible unsafe locking scenario: [ 29.521849] [ 29.527892] CPU0 CPU1 [ 29.532544] ---- ---- [ 29.537194] lock(&sb->s_type->i_mutex_key#10); [ 29.541956] lock(ashmem_mutex); [ 29.547911] lock(&sb->s_type->i_mutex_key#10); executing program executing program [ 29.555168] lock(&mm->mmap_sem); [ 29.558706] [ 29.558706] *** DEADLOCK *** [ 29.558706] [ 29.564752] 2 locks held by syz-executor193/1792: [ 29.569577] #0: (sb_writers#6){.+.+}, at: [] vfs_write+0x3d7/0x4d0 [ 29.577648] #1: (&sb->s_type->i_mutex_key#10){+.+.}, at: [] generic_file_write_iter+0x99/0x650 [ 29.588131] [ 29.588131] stack backtrace: [ 29.592613] CPU: 0 PID: 1792 Comm: syz-executor193 Not tainted 4.14.87+ #19 [ 29.599725] Call Trace: [ 29.602305] dump_stack+0xb9/0x11b executing program executing program executing program [ 29.605850] print_circular_bug.isra.18.cold.43+0x2d3/0x40c [ 29.611545] ? save_trace+0xd6/0x250 [ 29.615766] __lock_acquire+0x2ff9/0x4320 [ 29.619902] ? kasan_unpoison_shadow+0x30/0x40 [ 29.624490] ? trace_hardirqs_on+0x10/0x10 [ 29.628715] ? __lock_acquire+0x619/0x4320 [ 29.632965] ? trace_hardirqs_on+0x10/0x10 [ 29.637189] ? cmp_ex_search+0x6f/0x90 [ 29.641076] ? bsearch+0x83/0xa0 [ 29.644554] lock_acquire+0x10f/0x380 [ 29.648354] ? __do_page_fault+0x868/0xb60 [ 29.652583] down_read+0x37/0xa0 executing program [ 29.655958] ? __do_page_fault+0x868/0xb60 [ 29.660187] __do_page_fault+0x868/0xb60 [ 29.664249] ? bad_area_access_error+0x330/0x330 [ 29.668997] ? trace_hardirqs_off_thunk+0x1a/0x1c [ 29.673845] page_fault+0x22/0x50 [ 29.677289] RIP: 0010:iov_iter_fault_in_readable+0x2b9/0x370 [ 29.683069] RSP: 0018:ffff8881cfcef9f8 EFLAGS: 00010297 [ 29.688423] RAX: 0000000000000000 RBX: 000000000000007f RCX: 0000000000001000 [ 29.695682] RDX: 0000000000000000 RSI: 0000000000001000 RDI: ffff8881cfcefcf8 executing program executing program [ 29.702939] RBP: 1ffff11039f9df40 R08: 0000000000001000 R09: ffffea00070dec80 [ 29.710196] R10: ffffffffbb2812d0 R11: ffff8881c37b2fff R12: 0000000000000000 [ 29.717463] R13: 000000002043a0bf R14: 0000000000001000 R15: ffff8881cfcefcf0 [ 29.724727] ? shmem_put_link+0xd0/0xd0 [ 29.728697] ? iov_iter_fault_in_readable+0x2b3/0x370 [ 29.733892] ? flex_array_free_parts+0xd0/0xd0 [ 29.738471] ? __set_page_dirty_no_writeback+0xa7/0x100 [ 29.743824] ? iov_iter_advance+0x1cf/0xc20 [ 29.748130] generic_perform_write+0x166/0x430 [ 29.752717] ? filemap_page_mkwrite+0x2d0/0x2d0 executing program executing program executing program [ 29.757376] ? file_update_time+0xbc/0x390 [ 29.761597] ? current_time+0xb0/0xb0 [ 29.765385] ? lock_acquire+0x10f/0x380 [ 29.769363] __generic_file_write_iter+0x345/0x540 [ 29.774284] generic_file_write_iter+0x36f/0x650 [ 29.779033] ? iov_iter_init+0xa8/0x1c0 [ 29.782997] __vfs_write+0x417/0x5c0 [ 29.787119] ? kernel_read+0x110/0x110 [ 29.791005] ? rcu_read_lock_sched_held+0x102/0x120 [ 29.796016] vfs_write+0x17f/0x4d0 [ 29.799551] SyS_write+0xc2/0x1a0 [ 29.803000] ? SyS_read+0x1a0/0x1a0 executing program executing program executing program [ 29.806621] ? SyS_memfd_create+0x2a8/0x310 [ 29.810948] ? kfree+0xf5/0x310 [ 29.814217] ? do_syscall_64+0x43/0x4b0 [ 29.818183] ? SyS_read+0x1a0/0x1a0 [ 29.821793] do_syscall_64+0x19b/0x4b0 [ 29.825673] entry_SYSCALL_64_after_hwframe+0x42/0xb7 [ 29.830845] RIP: 0033:0x446449 [ 29.834025] RSP: 002b:00007f9cc090ada8 EFLAGS: 00000297 ORIG_RAX: 0000000000000001 [ 29.841720] RAX: ffffffffffffffda RBX: 00000000006dbc28 RCX: 0000000000446449 [ 29.848998] RDX: 00000000ffffffe1 RSI: 00000000200000c0 RDI: 0000000000000004 executing program executing program executing program executing program executing program executing program [ 29.856261] RBP: 00000000006dbc20 R08: 0000000000000000 R09: 0000000000000000 [ 29.863535] R10: 0000000000000000 R11: 0000000000000297 R12: 00000000006dbc2c [ 29.870823] R13: 6873612f7665642f R14: 00007f9cc090b9c0 R15: 0000000000000000 executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program