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-kasan-gce-2,10.128.0.42' (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: [ 42.117418] ================================================================== [ 42.124871] BUG: KASAN: use-after-free in detach_if_pending+0x557/0x610 [ 42.131595] Write of size 8 at addr ffff8801d3bab780 by task syzkaller900516/2986 [ 42.139183] [ 42.140783] CPU: 1 PID: 2986 Comm: syzkaller900516 Not tainted 4.13.0+ #82 [ 42.147762] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 42.157085] Call Trace: [ 42.159648] dump_stack+0x194/0x257 [ 42.163260] ? arch_local_irq_restore+0x53/0x53 [ 42.167900] ? show_regs_print_info+0x65/0x65 [ 42.172369] ? lock_timer_base+0x1a3/0x2b0 [ 42.176589] ? detach_if_pending+0x557/0x610 [ 42.180970] print_address_description+0x73/0x250 [ 42.185784] ? detach_if_pending+0x557/0x610 [ 42.190165] kasan_report+0x24e/0x340 [ 42.193940] __asan_report_store8_noabort+0x17/0x20 [ 42.198924] detach_if_pending+0x557/0x610 [ 42.203134] ? trace_raw_output_tick_stop+0x130/0x130 [ 42.208296] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 42.212933] ? lock_timer_base+0x1a3/0x2b0 [ 42.217146] ? lock_timer_base+0x1eb/0x2b0 [ 42.221355] ? __internal_add_timer+0x2d0/0x2d0 [ 42.225996] ? trace_hardirqs_on+0xd/0x10 [ 42.230123] try_to_del_timer_sync+0xa2/0x120 [ 42.234590] ? del_timer+0x130/0x130 [ 42.238275] ? del_timer_sync+0xeb/0x240 [ 42.242313] del_timer_sync+0x18a/0x240 [ 42.246262] tun_free_netdev+0x105/0x1b0 [ 42.250294] ? tun_xdp+0x410/0x410 [ 42.253802] ? cpumask_next+0x24/0x30 [ 42.257575] ? netdev_refcnt_read+0xed/0x150 [ 42.261959] ? tun_xdp+0x410/0x410 [ 42.265469] netdev_run_todo+0x870/0xca0 [ 42.269502] ? do_group_exit+0x149/0x400 [ 42.273538] ? register_netdev+0x30/0x30 [ 42.277572] ? lock_downgrade+0x990/0x990 [ 42.281691] ? trace_hardirqs_on+0xd/0x10 [ 42.285826] ? refcount_sub_and_test+0x115/0x1b0 [ 42.290699] ? refcount_inc+0x50/0x50 [ 42.294473] ? refcount_inc+0x50/0x50 [ 42.298249] ? sk_destruct+0x4c/0x80 [ 42.301935] ? __sk_free+0x5c/0x230 [ 42.305534] ? sk_free+0x2f/0x40 [ 42.308872] ? __tun_detach+0x176/0x1390 [ 42.312917] ? tun_attach+0xf90/0xf90 [ 42.316693] ? do_raw_spin_trylock+0x190/0x190 [ 42.321250] ? locks_remove_file+0x3fa/0x5a0 [ 42.325633] ? fcntl_setlk+0x10d0/0x10d0 [ 42.329669] ? __fsnotify_parent+0xb4/0x3a0 [ 42.333965] ? fsnotify+0x1af0/0x1af0 [ 42.337746] ? __tun_detach+0x1390/0x1390 [ 42.341866] ? __tun_detach+0x1390/0x1390 [ 42.345984] rtnl_unlock+0xe/0x10 [ 42.349407] tun_chr_close+0x49/0x60 [ 42.353092] __fput+0x333/0x7f0 [ 42.356347] ? fput+0x140/0x140 [ 42.359598] ? check_same_owner+0x320/0x320 [ 42.363890] ? _raw_spin_unlock_irq+0x27/0x70 [ 42.368362] ____fput+0x15/0x20 [ 42.371612] task_work_run+0x199/0x270 [ 42.375471] ? task_work_cancel+0x210/0x210 [ 42.379762] ? _raw_spin_unlock+0x22/0x30 [ 42.383882] ? switch_task_namespaces+0x87/0xc0 [ 42.388525] do_exit+0xa52/0x1b40 [ 42.391951] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 42.396939] ? check_noncircular+0x20/0x20 [ 42.401155] ? mm_update_next_owner+0x930/0x930 [ 42.405796] ? __pmd_alloc+0x4e0/0x4e0 [ 42.409665] ? find_held_lock+0x39/0x1d0 [ 42.413707] ? lock_downgrade+0x990/0x990 [ 42.417848] ? handle_mm_fault+0x410/0x8d0 [ 42.422052] ? down_read_trylock+0xdb/0x170 [ 42.426347] ? __handle_mm_fault+0x39c0/0x39c0 [ 42.430897] ? vmacache_find+0x61/0x270 [ 42.434847] ? up_read+0x1a/0x40 [ 42.438185] ? __do_page_fault+0x35b/0xb60 [ 42.442389] ? do_vfs_ioctl+0x492/0x1530 [ 42.446430] ? do_page_fault+0xee/0x720 [ 42.450376] ? __do_page_fault+0xb60/0xb60 [ 42.454582] ? putname+0xf3/0x130 [ 42.458012] do_group_exit+0x149/0x400 [ 42.461871] ? lockdep_sys_exit+0x47/0xf0 [ 42.465990] ? SyS_exit+0x30/0x30 [ 42.469416] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 42.474406] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 42.479136] SyS_exit_group+0x1d/0x20 [ 42.482909] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 42.487633] RIP: 0033:0x443a28 [ 42.490792] RSP: 002b:00007fff42800438 EFLAGS: 00000246 ORIG_RAX: 00000000000000e7 [ 42.498474] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 0000000000443a28 [ 42.505713] RDX: 0000000000000000 RSI: 000000000000003c RDI: 0000000000000000 [ 42.513134] RBP: 0000000000000082 R08: 00000000000000e7 R09: ffffffffffffffd4 [ 42.520374] R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000001 [ 42.527614] R13: 00000000006d6180 R14: 0000000000000000 R15: 0000000000000000 [ 42.534881] [ 42.536480] Allocated by task 2986: [ 42.540080] save_stack_trace+0x16/0x20 [ 42.544025] save_stack+0x43/0xd0 [ 42.547447] kasan_kmalloc+0xad/0xe0 [ 42.551130] __kmalloc_node+0x47/0x70 [ 42.554898] kvmalloc_node+0x64/0xd0 [ 42.558582] alloc_netdev_mqs+0x16e/0xed0 [ 42.562698] __tun_chr_ioctl+0x12be/0x3d20 [ 42.566899] tun_chr_ioctl+0x2a/0x40 [ 42.570582] do_vfs_ioctl+0x1b1/0x1530 [ 42.574439] SyS_ioctl+0x8f/0xc0 [ 42.577774] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 42.582493] [ 42.584089] Freed by task 2986: [ 42.587353] save_stack_trace+0x16/0x20 [ 42.591298] save_stack+0x43/0xd0 [ 42.594718] kasan_slab_free+0x71/0xc0 [ 42.598574] kfree+0xca/0x250 [ 42.601648] kvfree+0x36/0x60 [ 42.604722] free_netdev+0x2cf/0x360 [ 42.608406] __tun_chr_ioctl+0x2cf6/0x3d20 [ 42.612610] tun_chr_ioctl+0x2a/0x40 [ 42.616294] do_vfs_ioctl+0x1b1/0x1530 [ 42.620152] SyS_ioctl+0x8f/0xc0 [ 42.623489] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 42.628213] [ 42.629821] The buggy address belongs to the object at ffff8801d3ba8380 [ 42.629821] which belongs to the cache kmalloc-16384 of size 16384 [ 42.642790] The buggy address is located 13312 bytes inside of [ 42.642790] 16384-byte region [ffff8801d3ba8380, ffff8801d3bac380) [ 42.654977] The buggy address belongs to the page: [ 42.659876] page:ffffea00074eea00 count:1 mapcount:0 mapping:ffff8801d3ba8380 index:0x0 compound_mapcount: 0 [ 42.669819] flags: 0x200000000008100(slab|head) [ 42.674477] raw: 0200000000008100 ffff8801d3ba8380 0000000000000000 0000000100000001 [ 42.682326] raw: ffffea0007355020 ffff8801dac01c50 ffff8801dac02200 0000000000000000 [ 42.690179] page dumped because: kasan: bad access detected [ 42.695860] [ 42.697456] Memory state around the buggy address: [ 42.702352] ffff8801d3bab680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 42.709679] ffff8801d3bab700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 42.717007] >ffff8801d3bab780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 42.724334] ^ [ 42.727669] ffff8801d3bab800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 42.734995] ffff8801d3bab880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 42.742319] ================================================================== [ 42.749642] Disabling lock debugging due to kernel taint [ 42.755054] Kernel panic - not syncing: panic_on_warn set ... [ 42.755054] [ 42.762379] CPU: 1 PID: 2986 Comm: syzkaller900516 Tainted: G B 4.13.0+ #82 [ 42.770569] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 42.779884] Call Trace: [ 42.782435] dump_stack+0x194/0x257 [ 42.786027] ? arch_local_irq_restore+0x53/0x53 [ 42.790659] ? vprintk_default+0x28/0x30 [ 42.794686] ? detach_if_pending+0x550/0x610 [ 42.799063] panic+0x1e4/0x417 [ 42.802222] ? __warn+0x1d9/0x1d9 [ 42.805647] ? detach_if_pending+0x557/0x610 [ 42.810020] kasan_end_report+0x50/0x50 [ 42.813956] kasan_report+0x137/0x340 [ 42.817721] __asan_report_store8_noabort+0x17/0x20 [ 42.822700] detach_if_pending+0x557/0x610 [ 42.826902] ? trace_raw_output_tick_stop+0x130/0x130 [ 42.832056] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 42.836687] ? lock_timer_base+0x1a3/0x2b0 [ 42.840883] ? lock_timer_base+0x1eb/0x2b0 [ 42.845087] ? __internal_add_timer+0x2d0/0x2d0 [ 42.849720] ? trace_hardirqs_on+0xd/0x10 [ 42.853835] try_to_del_timer_sync+0xa2/0x120 [ 42.858295] ? del_timer+0x130/0x130 [ 42.861974] ? del_timer_sync+0xeb/0x240 [ 42.866000] del_timer_sync+0x18a/0x240 [ 42.869942] tun_free_netdev+0x105/0x1b0 [ 42.873968] ? tun_xdp+0x410/0x410 [ 42.877473] ? cpumask_next+0x24/0x30 [ 42.881240] ? netdev_refcnt_read+0xed/0x150 [ 42.885616] ? tun_xdp+0x410/0x410 [ 42.889121] netdev_run_todo+0x870/0xca0 [ 42.893146] ? do_group_exit+0x149/0x400 [ 42.897174] ? register_netdev+0x30/0x30 [ 42.901202] ? lock_downgrade+0x990/0x990 [ 42.905315] ? trace_hardirqs_on+0xd/0x10 [ 42.909439] ? refcount_sub_and_test+0x115/0x1b0 [ 42.914158] ? refcount_inc+0x50/0x50 [ 42.917924] ? refcount_inc+0x50/0x50 [ 42.921690] ? sk_destruct+0x4c/0x80 [ 42.925368] ? __sk_free+0x5c/0x230 [ 42.928964] ? sk_free+0x2f/0x40 [ 42.932295] ? __tun_detach+0x176/0x1390 [ 42.936324] ? tun_attach+0xf90/0xf90 [ 42.940106] ? do_raw_spin_trylock+0x190/0x190 [ 42.944654] ? locks_remove_file+0x3fa/0x5a0 [ 42.949047] ? fcntl_setlk+0x10d0/0x10d0 [ 42.953080] ? __fsnotify_parent+0xb4/0x3a0 [ 42.957367] ? fsnotify+0x1af0/0x1af0 [ 42.961133] ? __tun_detach+0x1390/0x1390 [ 42.965250] ? __tun_detach+0x1390/0x1390 [ 42.969364] rtnl_unlock+0xe/0x10 [ 42.972781] tun_chr_close+0x49/0x60 [ 42.976458] __fput+0x333/0x7f0 [ 42.979704] ? fput+0x140/0x140 [ 42.982949] ? check_same_owner+0x320/0x320 [ 42.987232] ? _raw_spin_unlock_irq+0x27/0x70 [ 42.991695] ____fput+0x15/0x20 [ 42.994939] task_work_run+0x199/0x270 [ 42.998790] ? task_work_cancel+0x210/0x210 [ 43.003079] ? _raw_spin_unlock+0x22/0x30 [ 43.007193] ? switch_task_namespaces+0x87/0xc0 [ 43.011827] do_exit+0xa52/0x1b40 [ 43.015246] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 43.020228] ? check_noncircular+0x20/0x20 [ 43.024429] ? mm_update_next_owner+0x930/0x930 [ 43.029061] ? __pmd_alloc+0x4e0/0x4e0 [ 43.032917] ? find_held_lock+0x39/0x1d0 [ 43.036952] ? lock_downgrade+0x990/0x990 [ 43.041076] ? handle_mm_fault+0x410/0x8d0 [ 43.045274] ? down_read_trylock+0xdb/0x170 [ 43.049561] ? __handle_mm_fault+0x39c0/0x39c0 [ 43.054109] ? vmacache_find+0x61/0x270 [ 43.058051] ? up_read+0x1a/0x40 [ 43.061381] ? __do_page_fault+0x35b/0xb60 [ 43.065578] ? do_vfs_ioctl+0x492/0x1530 [ 43.069607] ? do_page_fault+0xee/0x720 [ 43.073561] ? __do_page_fault+0xb60/0xb60 [ 43.077767] ? putname+0xf3/0x130 [ 43.081187] do_group_exit+0x149/0x400 [ 43.085047] ? lockdep_sys_exit+0x47/0xf0 [ 43.089166] ? SyS_exit+0x30/0x30 [ 43.092608] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 43.097604] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 43.102326] SyS_exit_group+0x1d/0x20 [ 43.106093] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 43.110811] RIP: 0033:0x443a28 [ 43.113967] RSP: 002b:00007fff42800438 EFLAGS: 00000246 ORIG_RAX: 00000000000000e7