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-4,10.128.0.43' (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: [ 40.385279] ================================================================== [ 40.392692] BUG: KASAN: use-after-free in detach_if_pending+0x557/0x610 [ 40.399418] Write of size 8 at addr ffff8801cd06b740 by task syzkaller770639/2986 [ 40.407006] [ 40.408606] CPU: 1 PID: 2986 Comm: syzkaller770639 Not tainted 4.14.0-rc2+ #106 [ 40.416022] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 40.425347] Call Trace: [ 40.427909] dump_stack+0x194/0x257 [ 40.431509] ? arch_local_irq_restore+0x53/0x53 [ 40.436146] ? show_regs_print_info+0x65/0x65 [ 40.440615] ? lock_timer_base+0x1a3/0x2b0 [ 40.444822] ? detach_if_pending+0x557/0x610 [ 40.449214] print_address_description+0x73/0x250 [ 40.454025] ? detach_if_pending+0x557/0x610 [ 40.458404] kasan_report+0x25b/0x340 [ 40.462185] __asan_report_store8_noabort+0x17/0x20 [ 40.467179] detach_if_pending+0x557/0x610 [ 40.471397] ? trace_raw_output_tick_stop+0x130/0x130 [ 40.476556] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 40.481194] ? lock_timer_base+0x1a3/0x2b0 [ 40.485400] ? lock_timer_base+0x1eb/0x2b0 [ 40.489624] ? __internal_add_timer+0x2d0/0x2d0 [ 40.494265] ? trace_hardirqs_on+0xd/0x10 [ 40.498391] try_to_del_timer_sync+0xa2/0x120 [ 40.502854] ? del_timer+0x130/0x130 [ 40.506539] ? del_timer_sync+0xeb/0x240 [ 40.510578] del_timer_sync+0x18a/0x240 [ 40.514526] tun_free_netdev+0x105/0x1b0 [ 40.518556] ? tun_xdp+0x410/0x410 [ 40.522066] ? cpumask_next+0x24/0x30 [ 40.525838] ? netdev_refcnt_read+0xed/0x150 [ 40.530219] ? tun_xdp+0x410/0x410 [ 40.533728] netdev_run_todo+0x870/0xca0 [ 40.537758] ? do_group_exit+0x149/0x400 [ 40.541802] ? register_netdev+0x30/0x30 [ 40.545834] ? lock_downgrade+0x990/0x990 [ 40.549953] ? trace_hardirqs_on+0xd/0x10 [ 40.554087] ? refcount_sub_and_test+0x115/0x1b0 [ 40.558813] ? refcount_inc+0x50/0x50 [ 40.562581] ? refcount_inc+0x50/0x50 [ 40.566355] ? sk_destruct+0x4c/0x80 [ 40.570038] ? __sk_free+0x5c/0x230 [ 40.573636] ? sk_free+0x2f/0x40 [ 40.576973] ? __tun_detach+0x176/0x1390 [ 40.581013] ? tun_attach+0xf90/0xf90 [ 40.584787] ? do_raw_spin_trylock+0x190/0x190 [ 40.589344] ? locks_remove_file+0x3fa/0x5a0 [ 40.593726] ? fcntl_setlk+0x10d0/0x10d0 [ 40.597759] ? __fsnotify_parent+0xb4/0x3a0 [ 40.602051] ? fsnotify+0x1af0/0x1af0 [ 40.605829] ? __tun_detach+0x1390/0x1390 [ 40.609947] rtnl_unlock+0xe/0x10 [ 40.613368] tun_chr_close+0x49/0x60 [ 40.617052] __fput+0x333/0x7f0 [ 40.620307] ? fput+0x140/0x140 [ 40.623561] ? check_same_owner+0x320/0x320 [ 40.627850] ? _raw_spin_unlock_irq+0x27/0x70 [ 40.632324] ____fput+0x15/0x20 [ 40.635575] task_work_run+0x199/0x270 [ 40.639435] ? task_work_cancel+0x210/0x210 [ 40.643729] ? _raw_spin_unlock+0x22/0x30 [ 40.647845] ? switch_task_namespaces+0x87/0xc0 [ 40.652487] do_exit+0x9d2/0x1af0 [ 40.655916] ? mm_update_next_owner+0x930/0x930 [ 40.660556] ? __pmd_alloc+0x4e0/0x4e0 [ 40.664425] ? find_held_lock+0x39/0x1d0 [ 40.668466] ? lock_downgrade+0x990/0x990 [ 40.672607] ? handle_mm_fault+0x410/0x8d0 [ 40.676811] ? down_read_trylock+0xdb/0x170 [ 40.681103] ? __handle_mm_fault+0x39c0/0x39c0 [ 40.685654] ? vmacache_find+0x5f/0x280 [ 40.689607] ? up_read+0x1a/0x40 [ 40.692944] ? __do_page_fault+0x35b/0xb60 [ 40.697147] ? do_vfs_ioctl+0x492/0x1530 [ 40.701190] ? do_page_fault+0xee/0x720 [ 40.705136] ? __do_page_fault+0xb60/0xb60 [ 40.709348] ? putname+0xf3/0x130 [ 40.712778] do_group_exit+0x149/0x400 [ 40.716636] ? lockdep_sys_exit+0x47/0xf0 [ 40.720752] ? SyS_exit+0x30/0x30 [ 40.724176] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 40.729165] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 40.733892] SyS_exit_group+0x1d/0x20 [ 40.737663] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 40.742385] RIP: 0033:0x4436b8 [ 40.745544] RSP: 002b:00007ffcca0576d8 EFLAGS: 00000246 ORIG_RAX: 00000000000000e7 [ 40.753224] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00000000004436b8 [ 40.760462] RDX: 0000000000000000 RSI: 000000000000003c RDI: 0000000000000000 [ 40.767700] RBP: 0000000000000086 R08: 00000000000000e7 R09: ffffffffffffffd0 [ 40.774939] R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000001 [ 40.782184] R13: 00000000006d6180 R14: 0000000000000000 R15: 0000000000000000 [ 40.789439] [ 40.791038] Allocated by task 2986: [ 40.794636] save_stack_trace+0x16/0x20 [ 40.798579] save_stack+0x43/0xd0 [ 40.802000] kasan_kmalloc+0xad/0xe0 [ 40.805681] __kmalloc_node+0x47/0x70 [ 40.809449] kvmalloc_node+0x64/0xd0 [ 40.813133] alloc_netdev_mqs+0x16e/0xed0 [ 40.817253] __tun_chr_ioctl+0x12be/0x3d20 [ 40.821453] tun_chr_ioctl+0x2a/0x40 [ 40.825134] do_vfs_ioctl+0x1b1/0x1530 [ 40.828990] SyS_ioctl+0x8f/0xc0 [ 40.832325] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 40.837045] [ 40.838640] Freed by task 2986: [ 40.841887] save_stack_trace+0x16/0x20 [ 40.845827] save_stack+0x43/0xd0 [ 40.849247] kasan_slab_free+0x71/0xc0 [ 40.853103] kfree+0xca/0x250 [ 40.856179] kvfree+0x36/0x60 [ 40.859251] free_netdev+0x2cf/0x360 [ 40.862932] __tun_chr_ioctl+0x2cf6/0x3d20 [ 40.867132] tun_chr_ioctl+0x2a/0x40 [ 40.870816] do_vfs_ioctl+0x1b1/0x1530 [ 40.874670] SyS_ioctl+0x8f/0xc0 [ 40.878005] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 40.882724] [ 40.884321] The buggy address belongs to the object at ffff8801cd068340 [ 40.884321] which belongs to the cache kmalloc-16384 of size 16384 [ 40.897289] The buggy address is located 13312 bytes inside of [ 40.897289] 16384-byte region [ffff8801cd068340, ffff8801cd06c340) [ 40.909476] The buggy address belongs to the page: [ 40.914373] page:ffffea0007341a00 count:1 mapcount:0 mapping:ffff8801cd068340 index:0x0 compound_mapcount: 0 [ 40.924313] flags: 0x200000000008100(slab|head) [ 40.928952] raw: 0200000000008100 ffff8801cd068340 0000000000000000 0000000100000001 [ 40.936800] raw: ffffea000735b620 ffff8801dac01c50 ffff8801dac02200 0000000000000000 [ 40.944646] page dumped because: kasan: bad access detected [ 40.950323] [ 40.951919] Memory state around the buggy address: [ 40.956817] ffff8801cd06b600: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 40.964152] ffff8801cd06b680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 40.971480] >ffff8801cd06b700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 40.978806] ^ [ 40.984223] ffff8801cd06b780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 40.991559] ffff8801cd06b800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 40.998889] ================================================================== [ 41.006214] Disabling lock debugging due to kernel taint [ 41.011627] Kernel panic - not syncing: panic_on_warn set ... [ 41.011627] [ 41.018951] CPU: 1 PID: 2986 Comm: syzkaller770639 Tainted: G B 4.14.0-rc2+ #106 [ 41.027572] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 41.036887] Call Trace: [ 41.039440] dump_stack+0x194/0x257 [ 41.043032] ? arch_local_irq_restore+0x53/0x53 [ 41.047666] ? vprintk_default+0x28/0x30 [ 41.051692] ? detach_if_pending+0x540/0x610 [ 41.056063] panic+0x1e4/0x417 [ 41.059219] ? __warn+0x1d9/0x1d9 [ 41.062644] ? detach_if_pending+0x557/0x610 [ 41.067018] kasan_end_report+0x50/0x50 [ 41.070953] kasan_report+0x144/0x340 [ 41.074719] __asan_report_store8_noabort+0x17/0x20 [ 41.079698] detach_if_pending+0x557/0x610 [ 41.083897] ? trace_raw_output_tick_stop+0x130/0x130 [ 41.089055] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 41.093685] ? lock_timer_base+0x1a3/0x2b0 [ 41.097882] ? lock_timer_base+0x1eb/0x2b0 [ 41.102084] ? __internal_add_timer+0x2d0/0x2d0 [ 41.106717] ? trace_hardirqs_on+0xd/0x10 [ 41.110832] try_to_del_timer_sync+0xa2/0x120 [ 41.115292] ? del_timer+0x130/0x130 [ 41.118970] ? del_timer_sync+0xeb/0x240 [ 41.123005] del_timer_sync+0x18a/0x240 [ 41.126956] tun_free_netdev+0x105/0x1b0 [ 41.130980] ? tun_xdp+0x410/0x410 [ 41.134482] ? cpumask_next+0x24/0x30 [ 41.138247] ? netdev_refcnt_read+0xed/0x150 [ 41.142627] ? tun_xdp+0x410/0x410 [ 41.146131] netdev_run_todo+0x870/0xca0 [ 41.150154] ? do_group_exit+0x149/0x400 [ 41.154179] ? register_netdev+0x30/0x30 [ 41.158204] ? lock_downgrade+0x990/0x990 [ 41.162327] ? trace_hardirqs_on+0xd/0x10 [ 41.166452] ? refcount_sub_and_test+0x115/0x1b0 [ 41.171176] ? refcount_inc+0x50/0x50 [ 41.174942] ? refcount_inc+0x50/0x50 [ 41.178712] ? sk_destruct+0x4c/0x80 [ 41.182393] ? __sk_free+0x5c/0x230 [ 41.185985] ? sk_free+0x2f/0x40 [ 41.189318] ? __tun_detach+0x176/0x1390 [ 41.193350] ? tun_attach+0xf90/0xf90 [ 41.197127] ? do_raw_spin_trylock+0x190/0x190 [ 41.201681] ? locks_remove_file+0x3fa/0x5a0 [ 41.206058] ? fcntl_setlk+0x10d0/0x10d0 [ 41.210086] ? __fsnotify_parent+0xb4/0x3a0 [ 41.214375] ? fsnotify+0x1af0/0x1af0 [ 41.218144] ? __tun_detach+0x1390/0x1390 [ 41.222262] rtnl_unlock+0xe/0x10 [ 41.225680] tun_chr_close+0x49/0x60 [ 41.229359] __fput+0x333/0x7f0 [ 41.232612] ? fput+0x140/0x140 [ 41.235857] ? check_same_owner+0x320/0x320 [ 41.240141] ? _raw_spin_unlock_irq+0x27/0x70 [ 41.244601] ____fput+0x15/0x20 [ 41.247847] task_work_run+0x199/0x270 [ 41.251701] ? task_work_cancel+0x210/0x210 [ 41.255989] ? _raw_spin_unlock+0x22/0x30 [ 41.260103] ? switch_task_namespaces+0x87/0xc0 [ 41.264740] do_exit+0x9d2/0x1af0 [ 41.268164] ? mm_update_next_owner+0x930/0x930 [ 41.272799] ? __pmd_alloc+0x4e0/0x4e0 [ 41.276657] ? find_held_lock+0x39/0x1d0 [ 41.280687] ? lock_downgrade+0x990/0x990 [ 41.284809] ? handle_mm_fault+0x410/0x8d0 [ 41.289007] ? down_read_trylock+0xdb/0x170 [ 41.293301] ? __handle_mm_fault+0x39c0/0x39c0 [ 41.297849] ? vmacache_find+0x5f/0x280 [ 41.301793] ? up_read+0x1a/0x40 [ 41.305124] ? __do_page_fault+0x35b/0xb60 [ 41.309324] ? do_vfs_ioctl+0x492/0x1530 [ 41.313353] ? do_page_fault+0xee/0x720 [ 41.317295] ? __do_page_fault+0xb60/0xb60 [ 41.321493] ? putname+0xf3/0x130 [ 41.324912] do_group_exit+0x149/0x400 [ 41.328764] ? lockdep_sys_exit+0x47/0xf0 [ 41.332877] ? SyS_exit+0x30/0x30 [ 41.336297] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 41.341279] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 41.346003] SyS_exit_group+0x1d/0x20 [ 41.349770] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 41.354487] RIP: 0033:0x4436b8 [ 41.357642] RSP: 002b:00007ffcca0576d8 EFLAGS: 00000246 ORIG_RAX: 00000000000000e7 [ 41.365315] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00000000004436b8 [ 41.372549] RDX: 0000000000000000 RSI: 000000000000003c RDI: 0000000000000000 [ 41.379784] RBP: 0000000000000086 R08: 00000000000000e7 R09: ffffffffffffffd0