[ 37.868510] audit: type=1800 audit(1549319762.393:27): pid=7614 uid=0 auid=4294967295 ses=4294967295 subj=_ op=collect_data cause=failed(directio) comm="startpar" name="restorecond" dev="sda1" ino=2436 res=0 [ 37.895007] audit: type=1800 audit(1549319762.403:28): pid=7614 uid=0 auid=4294967295 ses=4294967295 subj=_ 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. [ 38.629973] audit: type=1800 audit(1549319763.193:29): pid=7614 uid=0 auid=4294967295 ses=4294967295 subj=_ op=collect_data cause=failed(directio) comm="startpar" name="rc.local" dev="sda1" ino=2432 res=0 [ 38.648540] audit: type=1800 audit(1549319763.193:30): pid=7614 uid=0 auid=4294967295 ses=4294967295 subj=_ 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.0.251' (ECDSA) to the list of known hosts. executing program syzkaller login: [ 49.955697] [ 49.957362] ====================================================== [ 49.963662] WARNING: possible circular locking dependency detected [ 49.969969] 5.0.0-rc5 #60 Not tainted [ 49.973755] ------------------------------------------------------ [ 49.980089] syz-executor391/7769 is trying to acquire lock: [ 49.985783] 00000000584d5344 (&mm->mmap_sem){++++}, at: __do_page_fault+0x9c2/0xd60 [ 49.993576] [ 49.993576] but task is already holding lock: [ 49.999546] 0000000005663cf7 (&sb->s_type->i_mutex_key#11){+.+.}, at: generic_file_write_iter+0xdf/0x610 [ 50.009163] [ 50.009163] which lock already depends on the new lock. [ 50.009163] [ 50.017497] [ 50.017497] the existing dependency chain (in reverse order) is: [ 50.025102] [ 50.025102] -> #2 (&sb->s_type->i_mutex_key#11){+.+.}: [ 50.031854] down_write+0x38/0x90 [ 50.035813] shmem_fallocate+0x15a/0xc60 [ 50.040376] ashmem_shrink_scan+0x1d7/0x4f0 [ 50.045200] ashmem_ioctl+0x2f0/0x11a0 [ 50.049593] do_vfs_ioctl+0xd6e/0x1390 [ 50.053983] ksys_ioctl+0xab/0xd0 [ 50.057978] __x64_sys_ioctl+0x73/0xb0 [ 50.062375] do_syscall_64+0x103/0x610 [ 50.066765] entry_SYSCALL_64_after_hwframe+0x49/0xbe [ 50.072450] [ 50.072450] -> #1 (ashmem_mutex){+.+.}: [ 50.077894] __mutex_lock+0xf7/0x1310 [ 50.082198] mutex_lock_nested+0x16/0x20 [ 50.086762] ashmem_mmap+0x55/0x520 [ 50.090892] mmap_region+0xc37/0x1760 [ 50.095214] do_mmap+0x8e2/0x1080 [ 50.099174] vm_mmap_pgoff+0x1c5/0x230 [ 50.103564] ksys_mmap_pgoff+0x4aa/0x630 [ 50.108143] __x64_sys_mmap+0xe9/0x1b0 [ 50.112719] do_syscall_64+0x103/0x610 [ 50.117419] entry_SYSCALL_64_after_hwframe+0x49/0xbe [ 50.123293] [ 50.123293] -> #0 (&mm->mmap_sem){++++}: [ 50.128845] lock_acquire+0x16f/0x3f0 [ 50.133154] down_read+0x3b/0x90 [ 50.137034] __do_page_fault+0x9c2/0xd60 [ 50.141601] do_page_fault+0x71/0x581 [ 50.146002] page_fault+0x1e/0x30 [ 50.149965] iov_iter_fault_in_readable+0x1ba/0x450 [ 50.155483] generic_perform_write+0x195/0x530 [ 50.160571] __generic_file_write_iter+0x25e/0x630 [ 50.166017] generic_file_write_iter+0x360/0x610 [ 50.171282] __vfs_write+0x613/0x8e0 [ 50.175508] vfs_write+0x20c/0x580 [ 50.179558] ksys_write+0xea/0x1f0 [ 50.183613] __x64_sys_write+0x73/0xb0 [ 50.188010] do_syscall_64+0x103/0x610 [ 50.192405] entry_SYSCALL_64_after_hwframe+0x49/0xbe [ 50.198103] [ 50.198103] other info that might help us debug this: [ 50.198103] [ 50.206227] Chain exists of: [ 50.206227] &mm->mmap_sem --> ashmem_mutex --> &sb->s_type->i_mutex_key#11 [ 50.206227] [ 50.217746] Possible unsafe locking scenario: [ 50.217746] [ 50.223782] CPU0 CPU1 [ 50.228426] ---- ---- [ 50.233073] lock(&sb->s_type->i_mutex_key#11); [ 50.237814] lock(ashmem_mutex); [ 50.243787] lock(&sb->s_type->i_mutex_key#11); [ 50.251053] lock(&mm->mmap_sem); [ 50.254570] [ 50.254570] *** DEADLOCK *** [ 50.254570] [ 50.260703] 2 locks held by syz-executor391/7769: [ 50.265519] #0: 00000000b6585f73 (sb_writers#5){.+.+}, at: vfs_write+0x429/0x580 [ 50.273138] #1: 0000000005663cf7 (&sb->s_type->i_mutex_key#11){+.+.}, at: generic_file_write_iter+0xdf/0x610 [ 50.283186] [ 50.283186] stack backtrace: [ 50.287665] CPU: 0 PID: 7769 Comm: syz-executor391 Not tainted 5.0.0-rc5 #60 [ 50.294947] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 50.304282] Call Trace: [ 50.306855] dump_stack+0x172/0x1f0 [ 50.310464] print_circular_bug.isra.0.cold+0x1cc/0x28f [ 50.315805] __lock_acquire+0x2f00/0x4700 [ 50.319935] ? mark_held_locks+0x100/0x100 [ 50.324155] ? mark_held_locks+0x100/0x100 [ 50.328372] ? __lock_is_held+0xb6/0x140 [ 50.332425] lock_acquire+0x16f/0x3f0 [ 50.336212] ? __do_page_fault+0x9c2/0xd60 [ 50.340439] down_read+0x3b/0x90 [ 50.343790] ? __do_page_fault+0x9c2/0xd60 [ 50.348024] __do_page_fault+0x9c2/0xd60 [ 50.352074] do_page_fault+0x71/0x581 [ 50.355879] page_fault+0x1e/0x30 [ 50.359316] RIP: 0010:iov_iter_fault_in_readable+0x1ba/0x450 [ 50.365099] Code: 4c 39 f3 76 17 eb 3b e8 e4 29 47 fe 48 81 c3 00 10 00 00 48 39 9d 68 ff ff ff 72 2d e8 cf 29 47 fe 0f 1f 00 0f ae e8 45 31 f6 <8a> 13 0f 1f 00 31 ff 44 89 f6 41 88 57 d0 e8 33 2b 47 fe 45 85 f6 [ 50.384010] RSP: 0018:ffff88808c5479b8 EFLAGS: 00010246 [ 50.389387] RAX: ffff8880906ee2c0 RBX: 0000000020f13000 RCX: ffffffff8328b126 [ 50.396670] RDX: 0000000000000000 RSI: ffffffff8328b151 RDI: 0000000000000005 [ 50.403948] RBP: ffff88808c547a58 R08: ffff8880906ee2c0 R09: fffff94000414557 [ 50.411221] R10: fffff94000414556 R11: ffffea00020a2ab7 R12: 0000000000001000 [ 50.418910] R13: 0000000000001000 R14: 0000000000000000 R15: ffff88808c547a30 [ 50.426191] ? iov_iter_fault_in_readable+0x186/0x450 [ 50.431372] ? iov_iter_fault_in_readable+0x1b1/0x450 [ 50.437861] ? iov_iter_fault_in_readable+0x1b1/0x450 [ 50.443044] ? copy_page_from_iter+0x750/0x750 [ 50.447627] generic_perform_write+0x195/0x530 [ 50.452200] ? page_endio+0x780/0x780 [ 50.455988] ? current_time+0x140/0x140 [ 50.459974] ? lock_acquire+0x16f/0x3f0 [ 50.463945] __generic_file_write_iter+0x25e/0x630 [ 50.468864] ? __sanitizer_cov_trace_cmp8+0x18/0x20 [ 50.473869] generic_file_write_iter+0x360/0x610 [ 50.478619] ? __generic_file_write_iter+0x630/0x630 [ 50.483728] ? __fget+0x340/0x540 [ 50.487187] ? __sanitizer_cov_trace_const_cmp8+0x18/0x20 [ 50.492714] ? iov_iter_init+0xea/0x220 [ 50.496677] __vfs_write+0x613/0x8e0 [ 50.500373] ? kernel_read+0x120/0x120 [ 50.504245] ? rcu_read_lock_sched_held+0x110/0x130 [ 50.509275] ? rcu_sync_lockdep_assert+0x73/0xb0 [ 50.514046] ? __sanitizer_cov_trace_const_cmp4+0x16/0x20 [ 50.519575] ? __sb_start_write+0x1ac/0x360 [ 50.523882] vfs_write+0x20c/0x580 [ 50.527402] ksys_write+0xea/0x1f0 [ 50.530942] ? __ia32_sys_read+0xb0/0xb0 [ 50.535009] ? do_syscall_64+0x26/0x610 [ 50.538970] ? entry_SYSCALL_64_after_hwframe+0x49/0xbe [ 50.544332] ? do_syscall_64+0x26/0x610 [ 50.548293] __x64_sys_write+0x73/0xb0 [ 50.552182] do_syscall_64+0x103/0x610 [ 50.556057] entry_SYSCALL_64_after_hwframe+0x49/0xbe [ 50.561230] RIP: 0033:0x445829 [ 50.564416] Code: e8 6c b6 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 12 fc ff c3 66 2e 0f 1f 84 00 00 00 00 [ 50.583310] RSP: 002b:00007fc62754eda8 EFLAGS: 00000246 ORIG_RAX: 0000000000000001 [ 50.591039] RAX: ffffffffffffffda RBX: 00000000006dac28 RCX: 0000000000445829 [ 50.598314] RDX: 00000000ffffff76 RSI: 0000000020000000 RDI: 0000000000000004 [ 50.605580] RBP: 00000000006dac20