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-1,10.128.0.34' (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: [ 41.156312] ================================================================== [ 41.163741] BUG: KASAN: use-after-free in detach_if_pending+0x557/0x610 [ 41.170476] Write of size 8 at addr ffff8801ce08b740 by task syzkaller053499/2980 [ 41.178063] [ 41.179663] CPU: 1 PID: 2980 Comm: syzkaller053499 Not tainted 4.14.0-rc2+ #106 [ 41.187078] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 41.196406] Call Trace: [ 41.198970] dump_stack+0x194/0x257 [ 41.202575] ? arch_local_irq_restore+0x53/0x53 [ 41.207227] ? show_regs_print_info+0x65/0x65 [ 41.211700] ? lock_timer_base+0x1a3/0x2b0 [ 41.215910] ? detach_if_pending+0x557/0x610 [ 41.220298] print_address_description+0x73/0x250 [ 41.225112] ? detach_if_pending+0x557/0x610 [ 41.229497] kasan_report+0x25b/0x340 [ 41.233275] __asan_report_store8_noabort+0x17/0x20 [ 41.238272] detach_if_pending+0x557/0x610 [ 41.242482] ? trace_raw_output_tick_stop+0x130/0x130 [ 41.247645] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 41.252283] ? lock_timer_base+0x1a3/0x2b0 [ 41.256488] ? lock_timer_base+0x1eb/0x2b0 [ 41.260702] ? __internal_add_timer+0x2d0/0x2d0 [ 41.265344] ? trace_hardirqs_on+0xd/0x10 [ 41.269473] try_to_del_timer_sync+0xa2/0x120 [ 41.273939] ? del_timer+0x130/0x130 [ 41.277625] ? del_timer_sync+0xeb/0x240 [ 41.281663] del_timer_sync+0x18a/0x240 [ 41.285615] tun_free_netdev+0x105/0x1b0 [ 41.289649] ? tun_xdp+0x410/0x410 [ 41.293158] ? cpumask_next+0x24/0x30 [ 41.296933] ? netdev_refcnt_read+0xed/0x150 [ 41.301318] ? tun_xdp+0x410/0x410 [ 41.304840] netdev_run_todo+0x870/0xca0 [ 41.308873] ? do_group_exit+0x149/0x400 [ 41.312912] ? register_netdev+0x30/0x30 [ 41.316949] ? lock_downgrade+0x990/0x990 [ 41.321076] ? trace_hardirqs_on+0xd/0x10 [ 41.325217] ? refcount_sub_and_test+0x115/0x1b0 [ 41.329944] ? refcount_inc+0x50/0x50 [ 41.333717] ? refcount_inc+0x50/0x50 [ 41.337495] ? sk_destruct+0x4c/0x80 [ 41.341179] ? __sk_free+0x5c/0x230 [ 41.344775] ? sk_free+0x2f/0x40 [ 41.348120] ? __tun_detach+0x176/0x1390 [ 41.352165] ? tun_attach+0xf90/0xf90 [ 41.355945] ? locks_remove_file+0x3fa/0x5a0 [ 41.360326] ? fcntl_setlk+0x10d0/0x10d0 [ 41.364361] ? __fsnotify_parent+0xb4/0x3a0 [ 41.368656] ? fsnotify+0x1af0/0x1af0 [ 41.372434] ? __tun_detach+0x1390/0x1390 [ 41.376554] rtnl_unlock+0xe/0x10 [ 41.379976] tun_chr_close+0x49/0x60 [ 41.383661] __fput+0x333/0x7f0 [ 41.386917] ? fput+0x140/0x140 [ 41.390171] ? check_same_owner+0x320/0x320 [ 41.394467] ____fput+0x15/0x20 [ 41.397729] task_work_run+0x199/0x270 [ 41.401591] ? task_work_cancel+0x210/0x210 [ 41.405884] ? free_nsproxy+0x185/0x1f0 [ 41.409831] ? switch_task_namespaces+0xa2/0xc0 [ 41.414476] do_exit+0x9d2/0x1af0 [ 41.417901] ? kvfree+0x3b/0x60 [ 41.421154] ? mm_update_next_owner+0x930/0x930 [ 41.425794] ? rtnl_unlock+0xe/0x10 [ 41.429390] ? __tun_chr_ioctl+0x27a/0x3d20 [ 41.433694] ? tun_chr_read_iter+0x1e0/0x1e0 [ 41.438095] ? lock_downgrade+0x990/0x990 [ 41.442244] ? check_same_owner+0x320/0x320 [ 41.446540] ? __handle_mm_fault+0x39c0/0x39c0 [ 41.451096] ? vmacache_find+0x5f/0x280 [ 41.455048] ? tun_chr_compat_ioctl+0x30/0x30 [ 41.459511] ? tun_chr_ioctl+0x2a/0x40 [ 41.463712] ? tun_chr_ioctl+0x2a/0x40 [ 41.467573] ? do_vfs_ioctl+0x492/0x1530 [ 41.471611] ? ioctl_preallocate+0x2b0/0x2b0 [ 41.475994] ? selinux_capable+0x40/0x40 [ 41.480027] ? putname+0xf3/0x130 [ 41.483457] do_group_exit+0x149/0x400 [ 41.487321] ? SyS_exit+0x30/0x30 [ 41.490749] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 41.495739] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 41.500468] SyS_exit_group+0x1d/0x20 [ 41.504244] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 41.508968] RIP: 0033:0x445409 [ 41.512130] RSP: 002b:00007fff7f34a2d8 EFLAGS: 00000202 ORIG_RAX: 00000000000000e7 [ 41.519812] RAX: ffffffffffffffda RBX: 00007fff7f34a310 RCX: 0000000000445409 [ 41.527052] RDX: 0000000000445409 RSI: 0000000020c63fd8 RDI: 0000000000000001 [ 41.534293] RBP: 0000000000000086 R08: 0000000000000000 R09: 00007fff7f34a310 [ 41.541534] R10: 0000000000000000 R11: 0000000000000202 R12: 0000000000402750 [ 41.548775] R13: 00000000004027e0 R14: 0000000000000000 R15: 0000000000000000 [ 41.556036] [ 41.557634] Allocated by task 2980: [ 41.561235] save_stack_trace+0x16/0x20 [ 41.565180] save_stack+0x43/0xd0 [ 41.568607] kasan_kmalloc+0xad/0xe0 [ 41.572290] __kmalloc_node+0x47/0x70 [ 41.576062] kvmalloc_node+0x64/0xd0 [ 41.579746] alloc_netdev_mqs+0x16e/0xed0 [ 41.583865] __tun_chr_ioctl+0x12be/0x3d20 [ 41.588069] tun_chr_ioctl+0x2a/0x40 [ 41.591754] do_vfs_ioctl+0x1b1/0x1530 [ 41.595611] SyS_ioctl+0x8f/0xc0 [ 41.598951] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 41.603675] [ 41.605273] Freed by task 2980: [ 41.609245] save_stack_trace+0x16/0x20 [ 41.613196] save_stack+0x43/0xd0 [ 41.616622] kasan_slab_free+0x71/0xc0 [ 41.620481] kfree+0xca/0x250 [ 41.623558] kvfree+0x36/0x60 [ 41.626642] free_netdev+0x2cf/0x360 [ 41.630334] __tun_chr_ioctl+0x2cf6/0x3d20 [ 41.634540] tun_chr_ioctl+0x2a/0x40 [ 41.638228] do_vfs_ioctl+0x1b1/0x1530 [ 41.642085] SyS_ioctl+0x8f/0xc0 [ 41.645428] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 41.650153] [ 41.651755] The buggy address belongs to the object at ffff8801ce088340 [ 41.651755] which belongs to the cache kmalloc-16384 of size 16384 [ 41.664732] The buggy address is located 13312 bytes inside of [ 41.664732] 16384-byte region [ffff8801ce088340, ffff8801ce08c340) [ 41.676924] The buggy address belongs to the page: [ 41.681834] page:ffffea0007382200 count:1 mapcount:0 mapping:ffff8801ce088340 index:0x0 compound_mapcount: 0 [ 41.691787] flags: 0x200000000008100(slab|head) [ 41.696431] raw: 0200000000008100 ffff8801ce088340 0000000000000000 0000000100000001 [ 41.704286] raw: ffffea000736ec20 ffff8801dac01c50 ffff8801dac02200 0000000000000000 [ 41.712134] page dumped because: kasan: bad access detected [ 41.717814] [ 41.719415] Memory state around the buggy address: [ 41.724316] ffff8801ce08b600: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 41.731646] ffff8801ce08b680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 41.738988] >ffff8801ce08b700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 41.746317] ^ [ 41.751735] ffff8801ce08b780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 41.759087] ffff8801ce08b800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 41.766424] ================================================================== [ 41.773749] Disabling lock debugging due to kernel taint [ 41.779166] Kernel panic - not syncing: panic_on_warn set ... [ 41.779166] [ 41.786494] CPU: 1 PID: 2980 Comm: syzkaller053499 Tainted: G B 4.14.0-rc2+ #106 [ 41.795119] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 41.804524] Call Trace: [ 41.807087] dump_stack+0x194/0x257 [ 41.810687] ? arch_local_irq_restore+0x53/0x53 [ 41.815324] ? vprintk_default+0x28/0x30 [ 41.819353] ? detach_if_pending+0x540/0x610 [ 41.823729] panic+0x1e4/0x417 [ 41.826888] ? __warn+0x1d9/0x1d9 [ 41.830315] ? detach_if_pending+0x557/0x610 [ 41.834689] kasan_end_report+0x50/0x50 [ 41.838628] kasan_report+0x144/0x340 [ 41.842397] __asan_report_store8_noabort+0x17/0x20 [ 41.847380] detach_if_pending+0x557/0x610 [ 41.851590] ? trace_raw_output_tick_stop+0x130/0x130 [ 41.856748] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 41.861382] ? lock_timer_base+0x1a3/0x2b0 [ 41.865583] ? lock_timer_base+0x1eb/0x2b0 [ 41.869785] ? __internal_add_timer+0x2d0/0x2d0 [ 41.874424] ? trace_hardirqs_on+0xd/0x10 [ 41.878539] try_to_del_timer_sync+0xa2/0x120 [ 41.882999] ? del_timer+0x130/0x130 [ 41.886681] ? del_timer_sync+0xeb/0x240 [ 41.890710] del_timer_sync+0x18a/0x240 [ 41.894653] tun_free_netdev+0x105/0x1b0 [ 41.898679] ? tun_xdp+0x410/0x410 [ 41.902185] ? cpumask_next+0x24/0x30 [ 41.905956] ? netdev_refcnt_read+0xed/0x150 [ 41.910330] ? tun_xdp+0x410/0x410 [ 41.913836] netdev_run_todo+0x870/0xca0 [ 41.917864] ? do_group_exit+0x149/0x400 [ 41.921893] ? register_netdev+0x30/0x30 [ 41.925921] ? lock_downgrade+0x990/0x990 [ 41.930033] ? trace_hardirqs_on+0xd/0x10 [ 41.934157] ? refcount_sub_and_test+0x115/0x1b0 [ 41.938885] ? refcount_inc+0x50/0x50 [ 41.942648] ? refcount_inc+0x50/0x50 [ 41.946418] ? sk_destruct+0x4c/0x80 [ 41.950097] ? __sk_free+0x5c/0x230 [ 41.953702] ? sk_free+0x2f/0x40 [ 41.957039] ? __tun_detach+0x176/0x1390 [ 41.961073] ? tun_attach+0xf90/0xf90 [ 41.964845] ? locks_remove_file+0x3fa/0x5a0 [ 41.969219] ? fcntl_setlk+0x10d0/0x10d0 [ 41.973256] ? __fsnotify_parent+0xb4/0x3a0 [ 41.977556] ? fsnotify+0x1af0/0x1af0 [ 41.981326] ? __tun_detach+0x1390/0x1390 [ 41.985443] rtnl_unlock+0xe/0x10 [ 41.988863] tun_chr_close+0x49/0x60 [ 41.992545] __fput+0x333/0x7f0 [ 41.995800] ? fput+0x140/0x140 [ 41.999047] ? check_same_owner+0x320/0x320 [ 42.003348] ____fput+0x15/0x20 [ 42.006599] task_work_run+0x199/0x270 [ 42.010452] ? task_work_cancel+0x210/0x210 [ 42.014740] ? free_nsproxy+0x185/0x1f0 [ 42.018690] ? switch_task_namespaces+0xa2/0xc0 [ 42.023328] do_exit+0x9d2/0x1af0 [ 42.026747] ? kvfree+0x3b/0x60 [ 42.029994] ? mm_update_next_owner+0x930/0x930 [ 42.034627] ? rtnl_unlock+0xe/0x10 [ 42.038220] ? __tun_chr_ioctl+0x27a/0x3d20 [ 42.043294] ? tun_chr_read_iter+0x1e0/0x1e0 [ 42.047676] ? lock_downgrade+0x990/0x990 [ 42.051800] ? check_same_owner+0x320/0x320 [ 42.056088] ? __handle_mm_fault+0x39c0/0x39c0 [ 42.060643] ? vmacache_find+0x5f/0x280 [ 42.064583] ? tun_chr_compat_ioctl+0x30/0x30 [ 42.069045] ? tun_chr_ioctl+0x2a/0x40 [ 42.072898] ? tun_chr_ioctl+0x2a/0x40 [ 42.076752] ? do_vfs_ioctl+0x492/0x1530 [ 42.080782] ? ioctl_preallocate+0x2b0/0x2b0 [ 42.085168] ? selinux_capable+0x40/0x40 [ 42.089196] ? putname+0xf3/0x130 [ 42.092619] do_group_exit+0x149/0x400 [ 42.096471] ? SyS_exit+0x30/0x30 [ 42.099892] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 42.104877] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 42.109600] SyS_exit_group+0x1d/0x20 [ 42.113380] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 42.118099] RIP: 0033:0x445409 [ 42.121254] RSP: 002b:00007fff7f34a2d8 EFLAGS: 00000202 ORIG_RAX: 00000000000000e7 [ 42.128938] RAX: ffffffffffffffda RBX: 00007fff7f34a310 RCX: 0000000000445409 [ 42.136174] RDX: 0000000000445409 RSI: 0000000020c63fd8 RDI: 0000000000000001 [ 42.143409] RBP: 0000000000000086 R08: 0000000000000000 R09: 00007fff7f34a310 [ 42.150645] R10: 0000000000000000 R11: 0000000000000202 R12: 0000000000402750