[ 35.389255] audit: type=1800 audit(1546544131.276:27): pid=7499 uid=0 auid=4294967295 ses=4294967295 subj==unconfined op=collect_data cause=failed(directio) comm="startpar" name="restorecond" dev="sda1" ino=2436 res=0 [ 35.417543] audit: type=1800 audit(1546544131.276:28): pid=7499 uid=0 auid=4294967295 ses=4294967295 subj==unconfined op=collect_data cause=failed(directio) comm="startpar" name="ssh" dev="sda1" ino=2417 res=0 [....] Starting periodic command scheduler: cron[?25l[?1c7[ ok 8[?25h[?0c. [....] Starting OpenBSD Secure Shell server: sshd[?25l[?1c7[ ok 8[?25h[?0c. [ 36.378812] audit: type=1800 audit(1546544132.316:29): pid=7499 uid=0 auid=4294967295 ses=4294967295 subj==unconfined op=collect_data cause=failed(directio) comm="startpar" name="rc.local" dev="sda1" ino=2432 res=0 [ 36.403853] audit: type=1800 audit(1546544132.316:30): pid=7499 uid=0 auid=4294967295 ses=4294967295 subj==unconfined op=collect_data cause=failed(directio) comm="startpar" name="rmnologin" dev="sda1" ino=2423 res=0 Debian GNU/Linux 7 syzkaller ttyS0 Warning: Permanently added '10.128.10.11' (ECDSA) to the list of known hosts. executing program executing program syzkaller login: [ 57.983883] [ 57.985640] ====================================================== [ 57.991936] WARNING: possible circular locking dependency detected [ 57.998229] 4.20.0+ #7 Not tainted [ 58.001742] ------------------------------------------------------ [ 58.008036] syz-executor673/7657 is trying to acquire lock: [ 58.013855] 000000003b5eb535 (&mm->mmap_sem){++++}, at: __do_page_fault+0x9c2/0xd60 [ 58.021647] [ 58.021647] but task is already holding lock: [ 58.027596] 00000000972faa88 (&sb->s_type->i_mutex_key#12){+.+.}, at: generic_file_write_iter+0xe5/0x6a0 [ 58.037211] [ 58.037211] which lock already depends on the new lock. [ 58.037211] [ 58.045514] [ 58.045514] the existing dependency chain (in reverse order) is: [ 58.053310] [ 58.053310] -> #2 (&sb->s_type->i_mutex_key#12){+.+.}: [ 58.060203] down_write+0x8a/0x130 [ 58.064247] shmem_fallocate+0x168/0x1200 [ 58.069188] ashmem_shrink_scan+0x239/0x630 [ 58.074011] ashmem_ioctl+0x38a/0x12c0 [ 58.078553] do_vfs_ioctl+0x107b/0x17d0 [ 58.083079] ksys_ioctl+0xab/0xd0 [ 58.087043] __x64_sys_ioctl+0x73/0xb0 [ 58.091434] do_syscall_64+0x1a3/0x800 [ 58.095830] entry_SYSCALL_64_after_hwframe+0x49/0xbe [ 58.101527] [ 58.101527] -> #1 (ashmem_mutex){+.+.}: [ 58.107231] __mutex_lock+0x12f/0x1670 [ 58.111628] mutex_lock_nested+0x16/0x20 [ 58.116193] ashmem_mmap+0x55/0x520 [ 58.120456] mmap_region+0xde5/0x1ca0 [ 58.124769] do_mmap+0xa09/0x1220 [ 58.128725] vm_mmap_pgoff+0x20b/0x2b0 [ 58.133128] ksys_mmap_pgoff+0x4f8/0x650 [ 58.137847] __x64_sys_mmap+0xe9/0x1b0 [ 58.142232] do_syscall_64+0x1a3/0x800 [ 58.146628] entry_SYSCALL_64_after_hwframe+0x49/0xbe [ 58.152332] [ 58.152332] -> #0 (&mm->mmap_sem){++++}: [ 58.157859] lock_acquire+0x1db/0x570 [ 58.162163] down_read+0x8d/0x120 [ 58.166117] __do_page_fault+0x9c2/0xd60 [ 58.170676] do_page_fault+0xe6/0x7d8 [ 58.175048] page_fault+0x1e/0x30 [ 58.179016] iov_iter_fault_in_readable+0x377/0x450 [ 58.184551] generic_perform_write+0x202/0x6b0 [ 58.189890] __generic_file_write_iter+0x25e/0x630 [ 58.195325] generic_file_write_iter+0x34e/0x6a0 [ 58.200772] __vfs_write+0x764/0xb40 [ 58.204993] vfs_write+0x20c/0x580 [ 58.209038] ksys_write+0x105/0x260 [ 58.213186] __x64_sys_write+0x73/0xb0 [ 58.217735] do_syscall_64+0x1a3/0x800 [ 58.222134] entry_SYSCALL_64_after_hwframe+0x49/0xbe [ 58.227818] [ 58.227818] other info that might help us debug this: [ 58.227818] [ 58.235935] Chain exists of: [ 58.235935] &mm->mmap_sem --> ashmem_mutex --> &sb->s_type->i_mutex_key#12 [ 58.235935] [ 58.247447] Possible unsafe locking scenario: [ 58.247447] [ 58.253484] CPU0 CPU1 [ 58.258130] ---- ---- [ 58.262774] lock(&sb->s_type->i_mutex_key#12); [ 58.267508] lock(ashmem_mutex); [ 58.273588] lock(&sb->s_type->i_mutex_key#12); [ 58.280842] lock(&mm->mmap_sem); [ 58.284359] [ 58.284359] *** DEADLOCK *** [ 58.284359] [ 58.290392] 2 locks held by syz-executor673/7657: [ 58.295261] #0: 00000000da3eb5bf (sb_writers#5){.+.+}, at: vfs_write+0x429/0x580 [ 58.302898] #1: 00000000972faa88 (&sb->s_type->i_mutex_key#12){+.+.}, at: generic_file_write_iter+0xe5/0x6a0 [ 58.313146] [ 58.313146] stack backtrace: [ 58.317632] CPU: 0 PID: 7657 Comm: syz-executor673 Not tainted 4.20.0+ #7 [ 58.324546] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 58.333879] Call Trace: [ 58.336606] dump_stack+0x1db/0x2d0 [ 58.340734] ? dump_stack_print_info.cold+0x20/0x20 [ 58.345738] ? print_stack_trace+0x77/0xb0 [ 58.349963] ? vprintk_func+0x86/0x189 [ 58.354121] print_circular_bug.isra.0.cold+0x1cc/0x28f [ 58.359473] __lock_acquire+0x3014/0x4a30 [ 58.363603] ? mark_held_locks+0x100/0x100 [ 58.367823] ? shmem_getpage_gfp+0x197e/0x4b70 [ 58.372489] ? trace_hardirqs_off_caller+0x300/0x300 [ 58.377586] ? do_raw_spin_trylock+0x270/0x270 [ 58.382252] ? shmem_getpage_gfp+0x26fb/0x4b70 [ 58.387084] ? __lock_is_held+0xb6/0x140 [ 58.391137] lock_acquire+0x1db/0x570 [ 58.395193] ? __do_page_fault+0x9c2/0xd60 [ 58.399406] ? ___might_sleep+0x1e7/0x310 [ 58.403549] ? lock_release+0xc40/0xc40 [ 58.407659] ? __sanitizer_cov_trace_cmp8+0x18/0x20 [ 58.412674] ? cmp_ex_search+0x8c/0xb0 [ 58.416559] down_read+0x8d/0x120 [ 58.420015] ? __do_page_fault+0x9c2/0xd60 [ 58.424242] ? __down_interruptible+0x740/0x740 [ 58.428895] ? do_writepages+0x1a0/0x1a0 [ 58.433011] ? set_page_dirty+0x5dd/0xfc0 [ 58.437311] __do_page_fault+0x9c2/0xd60 [ 58.441356] do_page_fault+0xe6/0x7d8 [ 58.445142] ? unlock_page+0x2b1/0x4a0 [ 58.449017] ? vmalloc_sync_all+0x30/0x30 [ 58.453149] ? balance_dirty_pages_ratelimited+0x1b0/0x2370 [ 58.458846] ? __bpf_trace_preemptirq_template+0x30/0x30 [ 58.464297] ? trace_hardirqs_off_thunk+0x1a/0x1c [ 58.469124] page_fault+0x1e/0x30 [ 58.472565] RIP: 0010:iov_iter_fault_in_readable+0x377/0x450 [ 58.478344] Code: 89 f6 41 88 57 e0 e8 38 d8 f3 fd 45 85 f6 74 c1 e9 70 fe ff ff e8 a9 d6 f3 fd 0f 1f 00 0f ae e8 44 89 f0 48 8b 8d 68 ff ff ff <8a> 11 89 c3 0f 1f 00 41 88 57 d0 31 ff 89 de e8 05 d8 f3 fd 85 db [ 58.497326] RSP: 0018:ffff8880888d78a8 EFLAGS: 00010293 [ 58.502681] RAX: 0000000000000000 RBX: 0000000000000000 RCX: 0000000020e90c3f [ 58.509938] RDX: 0000000000000000 RSI: ffffffff838dbfc7 RDI: 0000000000000007 [ 58.517427] RBP: ffff8880888d7948 R08: ffff88808e4b0640 R09: fffff9400041f2ef [ 58.524685] R10: fffff9400041f2ee R11: ffffea00020f9777 R12: 0000000000001000 [ 58.531936] R13: 0000000000001000 R14: 0000000000000000 R15: ffff8880888d7920 [ 58.539204] ? iov_iter_fault_in_readable+0x367/0x450 [ 58.544382] ? iov_iter_fault_in_readable+0x367/0x450 [ 58.549564] ? copy_page_from_iter+0x900/0x900 [ 58.554124] ? shmem_write_begin+0x105/0x1e0 [ 58.558544] ? shmem_write_begin+0x10f/0x1e0 [ 58.563080] generic_perform_write+0x202/0x6b0 [ 58.567653] ? add_page_wait_queue+0x480/0x480 [ 58.572230] ? current_time+0x1b0/0x1b0 [ 58.576188] ? __sanitizer_cov_trace_cmp8+0x18/0x20 [ 58.581183] ? generic_write_check_limits+0x291/0x380 [ 58.586352] __generic_file_write_iter+0x25e/0x630 [ 58.591398] ? __fget+0x499/0x710 [ 58.594845] generic_file_write_iter+0x34e/0x6a0 [ 58.599592] ? __generic_file_write_iter+0x630/0x630 [ 58.604841] ? kfree+0xcf/0x230 [ 58.608108] ? entry_SYSCALL_64_after_hwframe+0x49/0xbe [ 58.613456] ? __sanitizer_cov_trace_const_cmp8+0x18/0x20 [ 58.618977] ? iov_iter_init+0xea/0x220 [ 58.622941] __vfs_write+0x764/0xb40 [ 58.626655] ? kernel_read+0x120/0x120 [ 58.630538] ? rcu_read_lock_sched_held+0x110/0x130 [ 58.635542] ? rcu_sync_lockdep_assert+0x73/0xb0 [ 58.640326] ? __sanitizer_cov_trace_const_cmp4+0x16/0x20 [ 58.646065] ? __sb_start_write+0x1ac/0x360 [ 58.650367] vfs_write+0x20c/0x580 [ 58.653891] ksys_write+0x105/0x260 [ 58.657506] ? __ia32_sys_read+0xb0/0xb0 [ 58.661652] ? do_futex+0x2910/0x2910 [ 58.665440] ? trace_hardirqs_off_caller+0x300/0x300 [ 58.670536] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 58.675276] __x64_sys_write+0x73/0xb0 [ 58.679145] do_syscall_64+0x1a3/0x800 [ 58.683012] ? syscall_return_slowpath+0x5f0/0x5f0 [ 58.687923] ? prepare_exit_to_usermode+0x232/0x3b0 [ 58.692923] ? trace_hardirqs_off_thunk+0x1a/0x1c [ 58.697923] entry_SYSCALL_64_after_hwframe+0x49/0xbe [ 58.703099] RIP: 0033:0x446359 [ 58.706286] Code: e8 2c b3 02 00 48 83 c4 18 c3 0f 1f 80 00 00 00 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 0f 83 2b 09 fc ff c3 66 2e 0f 1f 84 00 00 00 00 [ 58.725192] RSP: 002b:00007f676804eda8 EFLAGS: 00000297 ORIG_RAX: 0000000000000001 executing program [ 58.732882] RAX: ffffffffffffffda RBX: 00000000006dac28 RCX: 0000000000446359 [ 58.740132] RDX: 00000000fffffe43 RSI: 0000000020000c40 RDI: 0000000000000004 [ 58.747385] RBP: 00000000006dac20 R08: 0000000000000000 R09: 0000000000000000 [ 58.754634] R10: 0000000000000000 R11: 0000000000000297 R12: 00000000006dac2c [ 58.761885] R13: 3ed592df9946286b R14: dfdd4f11168a8b2b R15: 00000000006dad2c executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program