INIT: Entering runlevel: 2 [info] Using makefile-style concurrent boot in runlevel 2. [....] 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. Debian GNU/Linux 7 syzkaller ttyS0 Warning: Permanently added 'ci-upstream-mmots-kasan-gce-1,10.128.0.31' (ECDSA) to the list of known hosts. net.ipv6.conf.syz0.accept_dad = 0 net.ipv6.conf.syz0.router_solicitations = 0 executing program syzkaller login: [ 31.597497] ================================================================== [ 31.604907] BUG: KASAN: use-after-free in detach_if_pending+0x557/0x610 [ 31.611630] Write of size 8 at addr ffff8801ce01b7c0 by task syzkaller811450/2985 [ 31.619216] [ 31.620819] CPU: 1 PID: 2985 Comm: syzkaller811450 Not tainted 4.13.0-mm1+ #7 [ 31.628068] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 31.637395] Call Trace: [ 31.639956] dump_stack+0x194/0x257 [ 31.643557] ? arch_local_irq_restore+0x53/0x53 [ 31.648198] ? show_regs_print_info+0x65/0x65 [ 31.652666] ? lock_timer_base+0x1a3/0x2b0 [ 31.656872] ? detach_if_pending+0x557/0x610 [ 31.661254] print_address_description+0x73/0x250 [ 31.666065] ? detach_if_pending+0x557/0x610 [ 31.670449] kasan_report+0x24e/0x340 [ 31.674225] __asan_report_store8_noabort+0x17/0x20 [ 31.679210] detach_if_pending+0x557/0x610 [ 31.683423] ? trace_raw_output_tick_stop+0x130/0x130 [ 31.688587] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 31.693222] ? lock_timer_base+0x1a3/0x2b0 [ 31.697427] ? lock_timer_base+0x1eb/0x2b0 [ 31.701635] ? __internal_add_timer+0x2d0/0x2d0 [ 31.706276] ? trace_hardirqs_on+0xd/0x10 [ 31.710412] try_to_del_timer_sync+0xa2/0x120 [ 31.714876] ? del_timer+0x130/0x130 [ 31.718564] ? del_timer_sync+0xeb/0x240 [ 31.722602] del_timer_sync+0x18a/0x240 [ 31.726551] tun_free_netdev+0x105/0x1b0 [ 31.730580] ? tun_xdp+0x410/0x410 [ 31.734090] ? cpumask_next+0x24/0x30 [ 31.737862] ? netdev_refcnt_read+0xed/0x150 [ 31.742245] ? tun_xdp+0x410/0x410 [ 31.745754] netdev_run_todo+0x870/0xca0 [ 31.749783] ? do_group_exit+0x149/0x400 [ 31.753817] ? register_netdev+0x30/0x30 [ 31.757852] ? lock_downgrade+0x990/0x990 [ 31.761968] ? trace_hardirqs_on+0xd/0x10 [ 31.766110] ? refcount_sub_and_test+0x115/0x1b0 [ 31.770839] ? refcount_inc+0x50/0x50 [ 31.774610] ? refcount_inc+0x50/0x50 [ 31.778384] ? sk_destruct+0x4c/0x80 [ 31.782065] ? __sk_free+0x5c/0x230 [ 31.785662] ? sk_free+0x2f/0x40 [ 31.788998] ? __tun_detach+0x176/0x1390 [ 31.793038] ? tun_attach+0xf90/0xf90 [ 31.796817] ? locks_remove_file+0x3fa/0x5a0 [ 31.801197] ? fcntl_setlk+0x10d0/0x10d0 [ 31.805230] ? __fsnotify_parent+0xb4/0x3a0 [ 31.809539] ? fsnotify+0x1af0/0x1af0 [ 31.813311] ? __tun_detach+0x1390/0x1390 [ 31.817428] ? __tun_detach+0x1390/0x1390 [ 31.821548] rtnl_unlock+0xe/0x10 [ 31.824972] tun_chr_close+0x49/0x60 [ 31.828656] __fput+0x333/0x7f0 [ 31.831914] ? fput+0x140/0x140 [ 31.835165] ? check_same_owner+0x320/0x320 [ 31.839467] ____fput+0x15/0x20 [ 31.842719] task_work_run+0x199/0x270 [ 31.846578] ? task_work_cancel+0x210/0x210 [ 31.850870] ? free_nsproxy+0x185/0x1f0 [ 31.854814] ? switch_task_namespaces+0xa2/0xc0 [ 31.859460] do_exit+0xa52/0x1b40 [ 31.862883] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 31.867870] ? check_noncircular+0x20/0x20 [ 31.872084] ? mm_update_next_owner+0x930/0x930 [ 31.876721] ? __pmd_alloc+0x4e0/0x4e0 [ 31.880588] ? find_held_lock+0x39/0x1d0 [ 31.884629] ? lock_downgrade+0x990/0x990 [ 31.888767] ? handle_mm_fault+0x410/0x8d0 [ 31.892972] ? down_read_trylock+0xdb/0x170 [ 31.897263] ? __handle_mm_fault+0x39c0/0x39c0 [ 31.901813] ? vmacache_find+0x61/0x270 [ 31.905756] ? vmacache_update+0xfe/0x130 [ 31.909880] ? up_read+0x1a/0x40 [ 31.913217] ? __do_page_fault+0x35b/0xb60 [ 31.917428] ? do_vfs_ioctl+0x492/0x1530 [ 31.921467] ? do_page_fault+0xee/0x720 [ 31.925413] ? __do_page_fault+0xb60/0xb60 [ 31.929623] ? putname+0xf3/0x130 [ 31.933050] do_group_exit+0x149/0x400 [ 31.936905] ? lockdep_sys_exit+0x47/0xf0 [ 31.941021] ? SyS_exit+0x30/0x30 [ 31.944445] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 31.949433] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 31.954161] SyS_exit_group+0x1d/0x20 [ 31.957933] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 31.962656] RIP: 0033:0x445159 [ 31.965821] RSP: 002b:00000000007efe48 EFLAGS: 00000206 ORIG_RAX: 00000000000000e7 [ 31.973500] RAX: ffffffffffffffda RBX: 00000000ffffffff RCX: 0000000000445159 [ 31.980741] RDX: 0000000000445159 RSI: 0000000020074000 RDI: 0000000000000001 [ 31.987981] RBP: 0000000000000082 R08: 0000000000000000 R09: 00000000ffffffff [ 31.995225] R10: 0000000000000000 R11: 0000000000000206 R12: 00000000004027b0 [ 32.002465] R13: 0000000000402840 R14: 0000000000000000 R15: 0000000000000000 [ 32.009724] [ 32.011321] Allocated by task 2985: [ 32.014921] save_stack_trace+0x16/0x20 [ 32.018870] save_stack+0x43/0xd0 [ 32.022300] kasan_kmalloc+0xad/0xe0 [ 32.025990] __kmalloc_node+0x47/0x70 [ 32.029763] kvmalloc_node+0x64/0xd0 [ 32.033446] alloc_netdev_mqs+0x16e/0xed0 [ 32.037561] __tun_chr_ioctl+0x12be/0x3d20 [ 32.041770] tun_chr_ioctl+0x2a/0x40 [ 32.045460] do_vfs_ioctl+0x1b1/0x1530 [ 32.049325] SyS_ioctl+0x8f/0xc0 [ 32.052672] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 32.057404] [ 32.059010] Freed by task 2985: [ 32.062259] save_stack_trace+0x16/0x20 [ 32.066205] save_stack+0x43/0xd0 [ 32.069626] kasan_slab_free+0x71/0xc0 [ 32.073480] kfree+0xca/0x250 [ 32.076553] kvfree+0x36/0x60 [ 32.079627] free_netdev+0x2cf/0x360 [ 32.083310] __tun_chr_ioctl+0x2cf6/0x3d20 [ 32.087511] tun_chr_ioctl+0x2a/0x40 [ 32.091195] do_vfs_ioctl+0x1b1/0x1530 [ 32.095048] SyS_ioctl+0x8f/0xc0 [ 32.098383] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 32.103115] [ 32.104730] The buggy address belongs to the object at ffff8801ce0183c0 [ 32.104730] which belongs to the cache kmalloc-16384 of size 16384 [ 32.117704] The buggy address is located 13312 bytes inside of [ 32.117704] 16384-byte region [ffff8801ce0183c0, ffff8801ce01c3c0) [ 32.129896] The buggy address belongs to the page: [ 32.134794] page:ffffea0007380600 count:1 mapcount:0 mapping:ffff8801ce0183c0 index:0x0 compound_mapcount: 0 [ 32.144736] flags: 0x200000000008100(slab|head) [ 32.149374] raw: 0200000000008100 ffff8801ce0183c0 0000000000000000 0000000100000001 [ 32.157223] raw: ffffea0007388620 ffff8801dac01c50 ffff8801dac02200 0000000000000000 [ 32.165069] page dumped because: kasan: bad access detected [ 32.170746] [ 32.172350] Memory state around the buggy address: [ 32.177246] ffff8801ce01b680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 32.184581] ffff8801ce01b700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 32.191905] >ffff8801ce01b780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 32.199229] ^ [ 32.204645] ffff8801ce01b800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 32.211970] ffff8801ce01b880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 32.219295] ================================================================== [ 32.226622] Disabling lock debugging due to kernel taint [ 32.232034] Kernel panic - not syncing: panic_on_warn set ... [ 32.232034] [ 32.239362] CPU: 1 PID: 2985 Comm: syzkaller811450 Tainted: G B 4.13.0-mm1+ #7 [ 32.247813] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 32.257134] Call Trace: [ 32.259698] dump_stack+0x194/0x257 [ 32.263290] ? arch_local_irq_restore+0x53/0x53 [ 32.267923] ? vprintk_default+0x28/0x30 [ 32.271949] ? detach_if_pending+0x550/0x610 [ 32.276320] panic+0x1e4/0x417 [ 32.279476] ? __warn+0x1d9/0x1d9 [ 32.282899] ? detach_if_pending+0x557/0x610 [ 32.287271] kasan_end_report+0x50/0x50 [ 32.291212] kasan_report+0x137/0x340 [ 32.294977] __asan_report_store8_noabort+0x17/0x20 [ 32.299960] detach_if_pending+0x557/0x610 [ 32.304160] ? trace_raw_output_tick_stop+0x130/0x130 [ 32.309313] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 32.313942] ? lock_timer_base+0x1a3/0x2b0 [ 32.318139] ? lock_timer_base+0x1eb/0x2b0 [ 32.322338] ? __internal_add_timer+0x2d0/0x2d0 [ 32.326971] ? trace_hardirqs_on+0xd/0x10 [ 32.331084] try_to_del_timer_sync+0xa2/0x120 [ 32.335544] ? del_timer+0x130/0x130 [ 32.339220] ? del_timer_sync+0xeb/0x240 [ 32.343246] del_timer_sync+0x18a/0x240 [ 32.347192] tun_free_netdev+0x105/0x1b0 [ 32.351214] ? tun_xdp+0x410/0x410 [ 32.354717] ? cpumask_next+0x24/0x30 [ 32.358480] ? netdev_refcnt_read+0xed/0x150 [ 32.362851] ? tun_xdp+0x410/0x410 [ 32.366353] netdev_run_todo+0x870/0xca0 [ 32.370378] ? do_group_exit+0x149/0x400 [ 32.374404] ? register_netdev+0x30/0x30 [ 32.378429] ? lock_downgrade+0x990/0x990 [ 32.382541] ? trace_hardirqs_on+0xd/0x10 [ 32.386668] ? refcount_sub_and_test+0x115/0x1b0 [ 32.391387] ? refcount_inc+0x50/0x50 [ 32.395150] ? refcount_inc+0x50/0x50 [ 32.398916] ? sk_destruct+0x4c/0x80 [ 32.402590] ? __sk_free+0x5c/0x230 [ 32.406180] ? sk_free+0x2f/0x40 [ 32.409510] ? __tun_detach+0x176/0x1390 [ 32.413542] ? tun_attach+0xf90/0xf90 [ 32.417312] ? locks_remove_file+0x3fa/0x5a0 [ 32.421684] ? fcntl_setlk+0x10d0/0x10d0 [ 32.425710] ? __fsnotify_parent+0xb4/0x3a0 [ 32.429997] ? fsnotify+0x1af0/0x1af0 [ 32.433849] ? __tun_detach+0x1390/0x1390 [ 32.437960] ? __tun_detach+0x1390/0x1390 [ 32.442070] rtnl_unlock+0xe/0x10 [ 32.445487] tun_chr_close+0x49/0x60 [ 32.449167] __fput+0x333/0x7f0 [ 32.452411] ? fput+0x140/0x140 [ 32.455654] ? check_same_owner+0x320/0x320 [ 32.459943] ____fput+0x15/0x20 [ 32.463185] task_work_run+0x199/0x270 [ 32.467039] ? task_work_cancel+0x210/0x210 [ 32.471325] ? free_nsproxy+0x185/0x1f0 [ 32.475263] ? switch_task_namespaces+0xa2/0xc0 [ 32.479899] do_exit+0xa52/0x1b40 [ 32.483316] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 32.488299] ? check_noncircular+0x20/0x20 [ 32.492506] ? mm_update_next_owner+0x930/0x930 [ 32.497145] ? __pmd_alloc+0x4e0/0x4e0 [ 32.501007] ? find_held_lock+0x39/0x1d0 [ 32.505040] ? lock_downgrade+0x990/0x990 [ 32.509162] ? handle_mm_fault+0x410/0x8d0 [ 32.513359] ? down_read_trylock+0xdb/0x170 [ 32.517644] ? __handle_mm_fault+0x39c0/0x39c0 [ 32.522191] ? vmacache_find+0x61/0x270 [ 32.526128] ? vmacache_update+0xfe/0x130 [ 32.530244] ? up_read+0x1a/0x40 [ 32.533572] ? __do_page_fault+0x35b/0xb60 [ 32.537776] ? do_vfs_ioctl+0x492/0x1530 [ 32.541803] ? do_page_fault+0xee/0x720 [ 32.545739] ? __do_page_fault+0xb60/0xb60 [ 32.549937] ? putname+0xf3/0x130 [ 32.553355] do_group_exit+0x149/0x400 [ 32.557208] ? lockdep_sys_exit+0x47/0xf0 [ 32.561317] ? SyS_exit+0x30/0x30 [ 32.564734] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 32.569722] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 32.574442] SyS_exit_group+0x1d/0x20 [ 32.578207] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 32.582926] RIP: 0033:0x445159 [ 32.586080] RSP: 002b:00000000007efe48 EFLAGS: 00000206 ORIG_RAX: 00000000000000e7 [ 32.593752] RAX: ffffffffffffffda RBX: 00000000ffffffff RCX: 0000000000445159