[....] Starting enhanced syslogd: rsyslogd[?25l[?1c7[ ok 8[?25h[?0c. [....] Starting periodic command scheduler: cron[?25l[?1c7[ ok 8[?25h[?0c. [....] Starting OpenBSD Secure Shell server: sshd[?25l[?1c7[ ok 8[?25h[?0c. [ 27.012102] kauditd_printk_skb: 7 callbacks suppressed [ 27.012114] audit: type=1800 audit(1540898919.603:29): pid=5514 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 [ 27.039334] audit: type=1800 audit(1540898919.603:30): pid=5514 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 syzkaller login: [ 43.460163] sshd (5655) used greatest stack depth: 15744 bytes left Warning: Permanently added '10.128.10.35' (ECDSA) to the list of known hosts. executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program [ 50.009801] ================================================================== [ 50.017344] BUG: KASAN: use-after-free in vb2_mmap+0x65f/0x6e0 [ 50.023305] Read of size 8 at addr ffff8801bae63300 by task syz-executor369/5683 [ 50.030852] [ 50.032478] CPU: 1 PID: 5683 Comm: syz-executor369 Not tainted 4.19.0+ #310 [ 50.039565] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 50.048943] Call Trace: [ 50.051520] dump_stack+0x244/0x39d [ 50.055147] ? dump_stack_print_info.cold.1+0x20/0x20 [ 50.060339] ? printk+0xa7/0xcf [ 50.063605] ? kmsg_dump_rewind_nolock+0xe4/0xe4 [ 50.068353] print_address_description.cold.7+0x9/0x1ff [ 50.073724] kasan_report.cold.8+0x242/0x309 [ 50.078121] ? vb2_mmap+0x65f/0x6e0 [ 50.081740] __asan_report_load8_noabort+0x14/0x20 [ 50.086655] vb2_mmap+0x65f/0x6e0 [ 50.090124] ? vb2_poll+0x1d0/0x1d0 [ 50.093753] vb2_fop_mmap+0x4b/0x70 [ 50.097372] v4l2_mmap+0x153/0x200 [ 50.100907] mmap_region+0xe85/0x1cd0 [ 50.104727] ? __x64_sys_brk+0x8b0/0x8b0 [ 50.108788] ? zap_class+0x640/0x640 [ 50.112516] ? mpx_unmapped_area_check+0xd8/0x108 [ 50.117355] ? arch_get_unmapped_area+0x750/0x750 [ 50.122224] ? lock_acquire+0x1ed/0x520 [ 50.126192] ? __sanitizer_cov_trace_cmp8+0x18/0x20 [ 50.131213] ? cap_mmap_addr+0x52/0x130 [ 50.135191] ? __sanitizer_cov_trace_const_cmp4+0x16/0x20 [ 50.140729] ? security_mmap_addr+0x80/0xa0 [ 50.145067] ? __sanitizer_cov_trace_const_cmp8+0x18/0x20 [ 50.150605] ? get_unmapped_area+0x292/0x3b0 [ 50.155019] do_mmap+0xa22/0x1230 [ 50.158490] ? mmap_region+0x1cd0/0x1cd0 [ 50.162555] ? vm_mmap_pgoff+0x1b5/0x2c0 [ 50.166632] ? down_read_killable+0x150/0x150 [ 50.171134] ? security_mmap_file+0x174/0x1b0 [ 50.175641] vm_mmap_pgoff+0x213/0x2c0 [ 50.179550] ? vma_is_stack_for_current+0xd0/0xd0 [ 50.184383] ? __sanitizer_cov_trace_const_cmp4+0x16/0x20 [ 50.189916] ? security_file_permission+0x1c2/0x220 [ 50.194983] ksys_mmap_pgoff+0x4da/0x660 [ 50.199045] ? do_syscall_64+0x9a/0x820 [ 50.203020] ? find_mergeable_anon_vma+0xd0/0xd0 [ 50.207804] ? trace_hardirqs_on+0xbd/0x310 [ 50.212131] ? __ia32_sys_read+0xb0/0xb0 [ 50.216183] ? entry_SYSCALL_64_after_hwframe+0x49/0xbe [ 50.221552] ? trace_hardirqs_off_caller+0x310/0x310 [ 50.226655] __x64_sys_mmap+0xe9/0x1b0 [ 50.230545] do_syscall_64+0x1b9/0x820 [ 50.234418] ? entry_SYSCALL_64_after_hwframe+0x3e/0xbe [ 50.239772] ? syscall_return_slowpath+0x5e0/0x5e0 [ 50.244693] ? trace_hardirqs_off_thunk+0x1a/0x1c [ 50.249522] ? trace_hardirqs_on_caller+0x310/0x310 [ 50.254531] ? prepare_exit_to_usermode+0x3b0/0x3b0 [ 50.259556] ? prepare_exit_to_usermode+0x291/0x3b0 [ 50.264577] ? trace_hardirqs_off_thunk+0x1a/0x1c [ 50.269415] entry_SYSCALL_64_after_hwframe+0x49/0xbe [ 50.274596] RIP: 0033:0x444ba9 [ 50.277783] Code: e8 ac e8 ff ff 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 ce fb ff c3 66 2e 0f 1f 84 00 00 00 00 [ 50.296679] RSP: 002b:00007ffd29178138 EFLAGS: 00000216 ORIG_RAX: 0000000000000009 [ 50.304387] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 0000000000444ba9 [ 50.311647] RDX: 0000000002000002 RSI: 0000000000001000 RDI: 0000000020fff000 [ 50.318904] RBP: 0000000000000000 R08: 0000000000000003 R09: 0000000000000000 [ 50.326220] R10: 0000000000000013 R11: 0000000000000216 R12: 000000000000c30e [ 50.333487] R13: 0000000000401ef0 R14: 0000000000000000 R15: 0000000000000000 [ 50.340775] [ 50.342421] Allocated by task 5684: [ 50.346068] save_stack+0x43/0xd0 [ 50.349508] kasan_kmalloc+0xc7/0xe0 [ 50.353207] __kmalloc+0x15b/0x760 [ 50.356732] __vb2_queue_alloc+0xf7/0xf20 [ 50.360896] vb2_core_reqbufs+0x971/0x1040 [ 50.365119] __vb2_init_fileio+0x344/0xc90 [ 50.369341] __vb2_perform_fileio+0xcfb/0x1210 [ 50.373930] vb2_write+0x38/0x50 [ 50.377281] vb2_fop_write+0x20a/0x400 [ 50.381190] v4l2_write+0x168/0x220 [ 50.384801] __vfs_write+0x119/0x9f0 [ 50.388508] vfs_write+0x1fc/0x560 [ 50.392033] ksys_write+0x101/0x260 [ 50.395643] __x64_sys_write+0x73/0xb0 [ 50.399522] do_syscall_64+0x1b9/0x820 [ 50.403439] entry_SYSCALL_64_after_hwframe+0x49/0xbe [ 50.408788] [ 50.410404] Freed by task 5684: [ 50.413711] save_stack+0x43/0xd0 [ 50.417177] __kasan_slab_free+0x102/0x150 [ 50.421415] kasan_slab_free+0xe/0x10 [ 50.425207] kfree+0xcf/0x230 [ 50.428313] __vb2_queue_free+0x5e2/0xa30 [ 50.432454] vb2_core_reqbufs+0x2da/0x1040 [ 50.436690] __vb2_cleanup_fileio+0xf0/0x160 [ 50.441091] vb2_core_queue_release+0x1e/0x80 [ 50.445609] _vb2_fop_release+0x1d2/0x2b0 [ 50.449763] vb2_fop_release+0x77/0xc0 [ 50.453641] vivid_fop_release+0x18e/0x440 [ 50.457883] v4l2_release+0xfb/0x1a0 [ 50.461595] __fput+0x385/0xa30 [ 50.464879] ____fput+0x15/0x20 [ 50.468191] task_work_run+0x1e8/0x2a0 [ 50.472073] exit_to_usermode_loop+0x318/0x380 [ 50.476679] do_syscall_64+0x6be/0x820 [ 50.480569] entry_SYSCALL_64_after_hwframe+0x49/0xbe [ 50.485736] [ 50.487366] The buggy address belongs to the object at ffff8801bae63300 [ 50.487366] which belongs to the cache kmalloc-512 of size 512 [ 50.500022] The buggy address is located 0 bytes inside of [ 50.500022] 512-byte region [ffff8801bae63300, ffff8801bae63500) [ 50.511720] The buggy address belongs to the page: [ 50.516634] page:ffffea0006eb98c0 count:1 mapcount:0 mapping:ffff8801da800940 index:0xffff8801bae63580 [ 50.526067] flags: 0x2fffc0000000200(slab) [ 50.530306] raw: 02fffc0000000200 ffffea0006f288c8 ffffea0006f35248 ffff8801da800940 [ 50.538172] raw: ffff8801bae63580 ffff8801bae63080 0000000100000005 0000000000000000 [ 50.546032] page dumped because: kasan: bad access detected [ 50.551721] [ 50.553341] Memory state around the buggy address: [ 50.558273] ffff8801bae63200: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 50.565624] ffff8801bae63280: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 50.572982] >ffff8801bae63300: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 50.580328] ^ [ 50.583698] ffff8801bae63380: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 50.591055] ffff8801bae63400: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 50.598404] ================================================================== [ 50.605759] Disabling lock debugging due to kernel taint [ 50.612073] Kernel panic - not syncing: panic_on_warn set ... [ 50.612073] [ 50.620043] CPU: 1 PID: 5683 Comm: syz-executor369 Tainted: G B 4.19.0+ #310 [ 50.628513] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 50.637853] Call Trace: [ 50.640435] dump_stack+0x244/0x39d [ 50.644410] ? dump_stack_print_info.cold.1+0x20/0x20 [ 50.649618] panic+0x238/0x4e7 [ 50.652818] ? add_taint.cold.5+0x16/0x16 [ 50.656963] ? preempt_schedule+0x4d/0x60 [ 50.661097] ? ___preempt_schedule+0x16/0x18 [ 50.665491] ? trace_hardirqs_on+0xb4/0x310 [ 50.669798] kasan_end_report+0x47/0x4f [ 50.673757] kasan_report.cold.8+0x76/0x309 [ 50.678065] ? vb2_mmap+0x65f/0x6e0 [ 50.681702] __asan_report_load8_noabort+0x14/0x20 [ 50.686626] vb2_mmap+0x65f/0x6e0 [ 50.690080] ? vb2_poll+0x1d0/0x1d0 [ 50.693691] vb2_fop_mmap+0x4b/0x70 [ 50.697304] v4l2_mmap+0x153/0x200 [ 50.700841] mmap_region+0xe85/0x1cd0 [ 50.704659] ? __x64_sys_brk+0x8b0/0x8b0 [ 50.708713] ? zap_class+0x640/0x640 [ 50.712426] ? mpx_unmapped_area_check+0xd8/0x108 [ 50.717256] ? arch_get_unmapped_area+0x750/0x750 [ 50.722096] ? lock_acquire+0x1ed/0x520 [ 50.726061] ? __sanitizer_cov_trace_cmp8+0x18/0x20 [ 50.731066] ? cap_mmap_addr+0x52/0x130 [ 50.735112] ? __sanitizer_cov_trace_const_cmp4+0x16/0x20 [ 50.740722] ? security_mmap_addr+0x80/0xa0 [ 50.745028] ? __sanitizer_cov_trace_const_cmp8+0x18/0x20 [ 50.750563] ? get_unmapped_area+0x292/0x3b0 [ 50.754991] do_mmap+0xa22/0x1230 [ 50.758431] ? mmap_region+0x1cd0/0x1cd0 [ 50.762508] ? vm_mmap_pgoff+0x1b5/0x2c0 [ 50.766556] ? down_read_killable+0x150/0x150 [ 50.771054] ? security_mmap_file+0x174/0x1b0 [ 50.775537] vm_mmap_pgoff+0x213/0x2c0 [ 50.779418] ? vma_is_stack_for_current+0xd0/0xd0 [ 50.784246] ? __sanitizer_cov_trace_const_cmp4+0x16/0x20 [ 50.789767] ? security_file_permission+0x1c2/0x220 [ 50.794786] ksys_mmap_pgoff+0x4da/0x660 [ 50.798834] ? do_syscall_64+0x9a/0x820 [ 50.802796] ? find_mergeable_anon_vma+0xd0/0xd0 [ 50.807550] ? trace_hardirqs_on+0xbd/0x310 [ 50.811878] ? __ia32_sys_read+0xb0/0xb0 [ 50.815969] ? entry_SYSCALL_64_after_hwframe+0x49/0xbe [ 50.821374] ? trace_hardirqs_off_caller+0x310/0x310 [ 50.826480] __x64_sys_mmap+0xe9/0x1b0 [ 50.830354] do_syscall_64+0x1b9/0x820 [ 50.834228] ? entry_SYSCALL_64_after_hwframe+0x3e/0xbe [ 50.839590] ? syscall_return_slowpath+0x5e0/0x5e0 [ 50.844690] ? trace_hardirqs_off_thunk+0x1a/0x1c [ 50.849597] ? trace_hardirqs_on_caller+0x310/0x310 [ 50.854610] ? prepare_exit_to_usermode+0x3b0/0x3b0 [ 50.859610] ? prepare_exit_to_usermode+0x291/0x3b0 [ 50.864627] ? trace_hardirqs_off_thunk+0x1a/0x1c [ 50.869459] entry_SYSCALL_64_after_hwframe+0x49/0xbe [ 50.874629] RIP: 0033:0x444ba9 [ 50.877816] Code: e8 ac e8 ff ff 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 ce fb ff c3 66 2e 0f 1f 84 00 00 00 00 [ 50.896717] RSP: 002b:00007ffd29178138 EFLAGS: 00000216 ORIG_RAX: 0000000000000009 [ 50.904437] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 0000000000444ba9 [ 50.911691] RDX: 0000000002000002 RSI: 0000000000001000 RDI: 0000000020fff000 [ 50.918958] RBP: 0000000000000000 R08: 0000000000000003 R09: 0000000000000000 [ 50.926210] R10: 0000000000000013 R11: 0000000000000216 R12: 000000000000c30e [ 50.933481] R13: 0000000000401ef0 R14: 0000000000000000 R15: 0000000000000000 [ 50.941681] Kernel Offset: disabled [ 50.945325] Rebooting in 86400 seconds..