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-6,10.128.15.206' (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: [ 23.555252] ================================================================== [ 23.562678] BUG: KASAN: use-after-free in detach_if_pending+0x557/0x610 [ 23.569402] Write of size 8 at addr ffff8801cfceb740 by task syzkaller202669/2984 [ 23.576991] [ 23.578593] CPU: 0 PID: 2984 Comm: syzkaller202669 Not tainted 4.13.0-mm1+ #7 [ 23.585835] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 23.595160] Call Trace: [ 23.597722] dump_stack+0x194/0x257 [ 23.601326] ? arch_local_irq_restore+0x53/0x53 [ 23.605967] ? show_regs_print_info+0x65/0x65 [ 23.610435] ? lock_timer_base+0x1a3/0x2b0 [ 23.614643] ? detach_if_pending+0x557/0x610 [ 23.619024] print_address_description+0x73/0x250 [ 23.623839] ? detach_if_pending+0x557/0x610 [ 23.628217] kasan_report+0x24e/0x340 [ 23.631994] __asan_report_store8_noabort+0x17/0x20 [ 23.636984] detach_if_pending+0x557/0x610 [ 23.641192] ? trace_raw_output_tick_stop+0x130/0x130 [ 23.646352] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 23.650989] ? lock_timer_base+0x1a3/0x2b0 [ 23.655194] ? lock_timer_base+0x1eb/0x2b0 [ 23.659403] ? __internal_add_timer+0x2d0/0x2d0 [ 23.664043] ? trace_hardirqs_on+0xd/0x10 [ 23.668169] try_to_del_timer_sync+0xa2/0x120 [ 23.672632] ? del_timer+0x130/0x130 [ 23.676317] ? del_timer_sync+0xeb/0x240 [ 23.680356] del_timer_sync+0x18a/0x240 [ 23.684308] tun_free_netdev+0x105/0x1b0 [ 23.688352] ? tun_xdp+0x410/0x410 [ 23.691861] ? cpumask_next+0x24/0x30 [ 23.695634] ? netdev_refcnt_read+0xed/0x150 [ 23.700017] ? tun_xdp+0x410/0x410 [ 23.703528] netdev_run_todo+0x870/0xca0 [ 23.707560] ? do_group_exit+0x149/0x400 [ 23.711595] ? register_netdev+0x30/0x30 [ 23.715630] ? lock_downgrade+0x990/0x990 [ 23.719750] ? trace_hardirqs_on+0xd/0x10 [ 23.723885] ? refcount_sub_and_test+0x115/0x1b0 [ 23.728609] ? refcount_inc+0x50/0x50 [ 23.732379] ? refcount_inc+0x50/0x50 [ 23.736162] ? sk_destruct+0x4c/0x80 [ 23.739849] ? __sk_free+0x5c/0x230 [ 23.743449] ? sk_free+0x2f/0x40 [ 23.746787] ? __tun_detach+0x176/0x1390 [ 23.750828] ? tun_attach+0xf90/0xf90 [ 23.754610] ? locks_remove_file+0x3fa/0x5a0 [ 23.758989] ? fcntl_setlk+0x10d0/0x10d0 [ 23.763021] ? __fsnotify_parent+0xb4/0x3a0 [ 23.767330] ? fsnotify+0x1af0/0x1af0 [ 23.771105] ? __tun_detach+0x1390/0x1390 [ 23.775224] ? __tun_detach+0x1390/0x1390 [ 23.779350] rtnl_unlock+0xe/0x10 [ 23.782772] tun_chr_close+0x49/0x60 [ 23.786455] __fput+0x333/0x7f0 [ 23.789711] ? fput+0x140/0x140 [ 23.792962] ? check_same_owner+0x320/0x320 [ 23.797266] ____fput+0x15/0x20 [ 23.800517] task_work_run+0x199/0x270 [ 23.804378] ? task_work_cancel+0x210/0x210 [ 23.808671] ? free_nsproxy+0x185/0x1f0 [ 23.812619] ? switch_task_namespaces+0xa2/0xc0 [ 23.817266] do_exit+0xa52/0x1b40 [ 23.820691] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 23.825681] ? check_noncircular+0x20/0x20 [ 23.829898] ? mm_update_next_owner+0x930/0x930 [ 23.834539] ? __pmd_alloc+0x4e0/0x4e0 [ 23.838406] ? find_held_lock+0x39/0x1d0 [ 23.842447] ? lock_downgrade+0x990/0x990 [ 23.846584] ? handle_mm_fault+0x410/0x8d0 [ 23.850786] ? down_read_trylock+0xdb/0x170 [ 23.855080] ? __handle_mm_fault+0x39c0/0x39c0 [ 23.859631] ? vmacache_find+0x61/0x270 [ 23.863572] ? vmacache_update+0xfe/0x130 [ 23.867693] ? up_read+0x1a/0x40 [ 23.871034] ? __do_page_fault+0x35b/0xb60 [ 23.875240] ? do_vfs_ioctl+0x492/0x1530 [ 23.879297] ? do_page_fault+0xee/0x720 [ 23.883241] ? __do_page_fault+0xb60/0xb60 [ 23.887446] ? putname+0xf3/0x130 [ 23.890874] do_group_exit+0x149/0x400 [ 23.894730] ? lockdep_sys_exit+0x47/0xf0 [ 23.898846] ? SyS_exit+0x30/0x30 [ 23.902272] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 23.907261] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 23.911988] SyS_exit_group+0x1d/0x20 [ 23.915758] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 23.920480] RIP: 0033:0x444db9 [ 23.923638] RSP: 002b:00007ffc31cf66e8 EFLAGS: 00000206 ORIG_RAX: 00000000000000e7 [ 23.931319] RAX: ffffffffffffffda RBX: 00007ffc31cf6730 RCX: 0000000000444db9 [ 23.938558] RDX: 0000000000444db9 RSI: 0000000020fbcfd8 RDI: 0000000000000001 [ 23.945798] RBP: 0000000000000082 R08: 0000000000000000 R09: 00007ffc31cf6730 [ 23.953039] R10: 0000000000000000 R11: 0000000000000206 R12: 0000000000402160 [ 23.960280] R13: 00000000004021f0 R14: 0000000000000000 R15: 0000000000000000 [ 23.967538] [ 23.969137] Allocated by task 2984: [ 23.972735] save_stack_trace+0x16/0x20 [ 23.976680] save_stack+0x43/0xd0 [ 23.980101] kasan_kmalloc+0xad/0xe0 [ 23.983781] __kmalloc_node+0x47/0x70 [ 23.987549] kvmalloc_node+0x64/0xd0 [ 23.991232] alloc_netdev_mqs+0x16e/0xed0 [ 23.995353] __tun_chr_ioctl+0x12be/0x3d20 [ 23.999554] tun_chr_ioctl+0x2a/0x40 [ 24.003237] do_vfs_ioctl+0x1b1/0x1530 [ 24.007099] SyS_ioctl+0x8f/0xc0 [ 24.010438] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 24.015160] [ 24.016757] Freed by task 2984: [ 24.020007] save_stack_trace+0x16/0x20 [ 24.023947] save_stack+0x43/0xd0 [ 24.027368] kasan_slab_free+0x71/0xc0 [ 24.031235] kfree+0xca/0x250 [ 24.034315] kvfree+0x36/0x60 [ 24.037395] free_netdev+0x2cf/0x360 [ 24.041076] __tun_chr_ioctl+0x2cf6/0x3d20 [ 24.045284] tun_chr_ioctl+0x2a/0x40 [ 24.048966] do_vfs_ioctl+0x1b1/0x1530 [ 24.052821] SyS_ioctl+0x8f/0xc0 [ 24.056156] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 24.060882] [ 24.062484] The buggy address belongs to the object at ffff8801cfce8340 [ 24.062484] which belongs to the cache kmalloc-16384 of size 16384 [ 24.075461] The buggy address is located 13312 bytes inside of [ 24.075461] 16384-byte region [ffff8801cfce8340, ffff8801cfcec340) [ 24.087648] The buggy address belongs to the page: [ 24.092545] page:ffffea00073f3a00 count:1 mapcount:0 mapping:ffff8801cfce8340 index:0x0 compound_mapcount: 0 [ 24.102488] flags: 0x200000000008100(slab|head) [ 24.107125] raw: 0200000000008100 ffff8801cfce8340 0000000000000000 0000000100000001 [ 24.114975] raw: ffffea0006ff9620 ffff8801dac01c50 ffff8801dac02200 0000000000000000 [ 24.122821] page dumped because: kasan: bad access detected [ 24.128497] [ 24.130092] Memory state around the buggy address: [ 24.134986] ffff8801cfceb600: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 24.142312] ffff8801cfceb680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 24.149641] >ffff8801cfceb700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 24.156966] ^ [ 24.162381] ffff8801cfceb780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 24.169707] ffff8801cfceb800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 24.177045] ================================================================== [ 24.184372] Disabling lock debugging due to kernel taint [ 24.189783] Kernel panic - not syncing: panic_on_warn set ... [ 24.189783] [ 24.197108] CPU: 0 PID: 2984 Comm: syzkaller202669 Tainted: G B 4.13.0-mm1+ #7 [ 24.205566] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 24.214885] Call Trace: [ 24.217439] dump_stack+0x194/0x257 [ 24.221034] ? arch_local_irq_restore+0x53/0x53 [ 24.225669] ? vprintk_default+0x28/0x30 [ 24.230186] ? detach_if_pending+0x550/0x610 [ 24.234561] panic+0x1e4/0x417 [ 24.237720] ? __warn+0x1d9/0x1d9 [ 24.241147] ? detach_if_pending+0x557/0x610 [ 24.245518] kasan_end_report+0x50/0x50 [ 24.249457] kasan_report+0x137/0x340 [ 24.253221] __asan_report_store8_noabort+0x17/0x20 [ 24.258202] detach_if_pending+0x557/0x610 [ 24.262401] ? trace_raw_output_tick_stop+0x130/0x130 [ 24.267558] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 24.272188] ? lock_timer_base+0x1a3/0x2b0 [ 24.276385] ? lock_timer_base+0x1eb/0x2b0 [ 24.280586] ? __internal_add_timer+0x2d0/0x2d0 [ 24.285222] ? trace_hardirqs_on+0xd/0x10 [ 24.289339] try_to_del_timer_sync+0xa2/0x120 [ 24.293796] ? del_timer+0x130/0x130 [ 24.297473] ? del_timer_sync+0xeb/0x240 [ 24.301500] del_timer_sync+0x18a/0x240 [ 24.305440] tun_free_netdev+0x105/0x1b0 [ 24.309465] ? tun_xdp+0x410/0x410 [ 24.312968] ? cpumask_next+0x24/0x30 [ 24.316736] ? netdev_refcnt_read+0xed/0x150 [ 24.321109] ? tun_xdp+0x410/0x410 [ 24.324614] netdev_run_todo+0x870/0xca0 [ 24.328639] ? do_group_exit+0x149/0x400 [ 24.332666] ? register_netdev+0x30/0x30 [ 24.336694] ? lock_downgrade+0x990/0x990 [ 24.340806] ? trace_hardirqs_on+0xd/0x10 [ 24.344929] ? refcount_sub_and_test+0x115/0x1b0 [ 24.349650] ? refcount_inc+0x50/0x50 [ 24.353414] ? refcount_inc+0x50/0x50 [ 24.357185] ? sk_destruct+0x4c/0x80 [ 24.360861] ? __sk_free+0x5c/0x230 [ 24.364454] ? sk_free+0x2f/0x40 [ 24.367784] ? __tun_detach+0x176/0x1390 [ 24.371817] ? tun_attach+0xf90/0xf90 [ 24.375587] ? locks_remove_file+0x3fa/0x5a0 [ 24.379959] ? fcntl_setlk+0x10d0/0x10d0 [ 24.383985] ? __fsnotify_parent+0xb4/0x3a0 [ 24.388271] ? fsnotify+0x1af0/0x1af0 [ 24.392035] ? __tun_detach+0x1390/0x1390 [ 24.396146] ? __tun_detach+0x1390/0x1390 [ 24.400260] rtnl_unlock+0xe/0x10 [ 24.403678] tun_chr_close+0x49/0x60 [ 24.407355] __fput+0x333/0x7f0 [ 24.410599] ? fput+0x140/0x140 [ 24.413849] ? check_same_owner+0x320/0x320 [ 24.418136] ____fput+0x15/0x20 [ 24.421380] task_work_run+0x199/0x270 [ 24.425240] ? task_work_cancel+0x210/0x210 [ 24.429525] ? free_nsproxy+0x185/0x1f0 [ 24.433466] ? switch_task_namespaces+0xa2/0xc0 [ 24.438100] do_exit+0xa52/0x1b40 [ 24.441517] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 24.446514] ? check_noncircular+0x20/0x20 [ 24.450717] ? mm_update_next_owner+0x930/0x930 [ 24.455350] ? __pmd_alloc+0x4e0/0x4e0 [ 24.459205] ? find_held_lock+0x39/0x1d0 [ 24.463238] ? lock_downgrade+0x990/0x990 [ 24.467360] ? handle_mm_fault+0x410/0x8d0 [ 24.471556] ? down_read_trylock+0xdb/0x170 [ 24.475841] ? __handle_mm_fault+0x39c0/0x39c0 [ 24.480393] ? vmacache_find+0x61/0x270 [ 24.484332] ? vmacache_update+0xfe/0x130 [ 24.488446] ? up_read+0x1a/0x40 [ 24.491776] ? __do_page_fault+0x35b/0xb60 [ 24.495972] ? do_vfs_ioctl+0x492/0x1530 [ 24.499999] ? do_page_fault+0xee/0x720 [ 24.503938] ? __do_page_fault+0xb60/0xb60 [ 24.508137] ? putname+0xf3/0x130 [ 24.511557] do_group_exit+0x149/0x400 [ 24.515409] ? lockdep_sys_exit+0x47/0xf0 [ 24.519520] ? SyS_exit+0x30/0x30 [ 24.522938] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 24.527919] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 24.532644] SyS_exit_group+0x1d/0x20 [ 24.536413] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 24.541131] RIP: 0033:0x444db9 [ 24.544285] RSP: 002b:00007ffc31cf66e8 EFLAGS: 00000206 ORIG_RAX: 00000000000000e7 [ 24.551955] RAX: ffffffffffffffda RBX: 00007ffc31cf6730 RCX: 0000000000444db9