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-next-kasan-gce-1,10.128.15.207' (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: [ 45.384337] ================================================================== [ 45.385480] BUG: KASAN: use-after-free in detach_if_pending+0x557/0x610 [ 45.386435] Write of size 8 at addr ffff8801ce5e3800 by task syzkaller563573/2985 [ 45.387453] [ 45.387690] CPU: 1 PID: 2985 Comm: syzkaller563573 Not tainted 4.13.0-next-20170908+ #18 [ 45.388825] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 45.390078] Call Trace: [ 45.390441] dump_stack+0x194/0x257 [ 45.390954] ? arch_local_irq_restore+0x53/0x53 [ 45.391659] ? show_regs_print_info+0x65/0x65 [ 45.392297] ? lock_timer_base+0x1a3/0x2b0 [ 45.392869] ? detach_if_pending+0x557/0x610 [ 45.393513] print_address_description+0x73/0x250 [ 45.394193] ? detach_if_pending+0x557/0x610 [ 45.394824] kasan_report+0x24e/0x340 [ 45.395354] __asan_report_store8_noabort+0x17/0x20 [ 45.396025] detach_if_pending+0x557/0x610 [ 45.396598] ? trace_raw_output_tick_stop+0x130/0x130 [ 45.397303] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 45.397942] ? lock_timer_base+0x1a3/0x2b0 [ 45.398555] ? lock_timer_base+0x1eb/0x2b0 [ 45.399138] ? __internal_add_timer+0x2d0/0x2d0 [ 45.399780] ? trace_hardirqs_on+0xd/0x10 [ 45.400388] try_to_del_timer_sync+0xa2/0x120 [ 45.401039] ? del_timer+0x130/0x130 [ 45.401555] ? del_timer_sync+0xeb/0x240 [ 45.402129] del_timer_sync+0x18a/0x240 [ 45.402725] tun_free_netdev+0x105/0x1b0 [ 45.403284] ? tun_xdp+0x410/0x410 [ 45.403785] ? cpumask_next+0x24/0x30 [ 45.404380] ? netdev_refcnt_read+0xed/0x150 [ 45.408038] ? tun_xdp+0x410/0x410 [ 45.411554] netdev_run_todo+0x870/0xca0 [ 45.415588] ? do_group_exit+0x149/0x400 [ 45.419640] ? register_netdev+0x30/0x30 [ 45.423678] ? lock_downgrade+0x990/0x990 [ 45.427800] ? trace_hardirqs_on+0xd/0x10 [ 45.431939] ? refcount_sub_and_test+0x115/0x1b0 [ 45.436668] ? refcount_inc+0x50/0x50 [ 45.440441] ? refcount_inc+0x50/0x50 [ 45.444236] ? sk_destruct+0x4c/0x80 [ 45.447919] ? __sk_free+0x5c/0x230 [ 45.451519] ? sk_free+0x2f/0x40 [ 45.454860] ? __tun_detach+0x176/0x1390 [ 45.458904] ? tun_attach+0xf90/0xf90 [ 45.462689] ? locks_remove_file+0x3fa/0x5a0 [ 45.467074] ? fcntl_setlk+0x10d0/0x10d0 [ 45.471110] ? __fsnotify_parent+0xb4/0x3a0 [ 45.475404] ? fsnotify+0x1af0/0x1af0 [ 45.479180] ? __tun_detach+0x1390/0x1390 [ 45.483300] ? __tun_detach+0x1390/0x1390 [ 45.487422] rtnl_unlock+0xe/0x10 [ 45.490844] tun_chr_close+0x49/0x60 [ 45.494532] __fput+0x333/0x7f0 [ 45.497802] ? fput+0x140/0x140 [ 45.501057] ? check_same_owner+0x320/0x320 [ 45.505357] ____fput+0x15/0x20 [ 45.508610] task_work_run+0x199/0x270 [ 45.512472] ? task_work_cancel+0x210/0x210 [ 45.516768] ? free_nsproxy+0x185/0x1f0 [ 45.520726] ? switch_task_namespaces+0xa2/0xc0 [ 45.525374] do_exit+0xa52/0x1b40 [ 45.528800] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 45.533788] ? trace_hardirqs_on+0xd/0x10 [ 45.537914] ? kvfree+0x3b/0x60 [ 45.541167] ? mm_update_next_owner+0x930/0x930 [ 45.545807] ? rtnl_unlock+0xe/0x10 [ 45.549406] ? __tun_chr_ioctl+0x27a/0x3d20 [ 45.553731] ? tun_chr_read_iter+0x1e0/0x1e0 [ 45.558123] ? lock_downgrade+0x990/0x990 [ 45.562273] ? check_same_owner+0x320/0x320 [ 45.566567] ? __handle_mm_fault+0x39c0/0x39c0 [ 45.571122] ? vmacache_find+0x61/0x270 [ 45.575070] ? tun_chr_compat_ioctl+0x30/0x30 [ 45.579534] ? tun_chr_ioctl+0x2a/0x40 [ 45.583390] ? tun_chr_ioctl+0x2a/0x40 [ 45.587252] ? do_vfs_ioctl+0x492/0x1530 [ 45.591289] ? ioctl_preallocate+0x2b0/0x2b0 [ 45.595673] ? selinux_capable+0x40/0x40 [ 45.599706] ? putname+0xf3/0x130 [ 45.603147] do_group_exit+0x149/0x400 [ 45.607014] ? SyS_exit+0x30/0x30 [ 45.610442] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 45.615435] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 45.620165] SyS_exit_group+0x1d/0x20 [ 45.623943] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 45.628673] RIP: 0033:0x445699 [ 45.631840] RSP: 002b:00000000007efe58 EFLAGS: 00000206 ORIG_RAX: 00000000000000e7 [ 45.640413] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 0000000000445699 [ 45.647654] RDX: 0000000000445699 RSI: 0000000020115000 RDI: 0000000000000001 [ 45.654895] RBP: 0000000000000082 R08: 0000000000000000 R09: 0000000000000000 [ 45.662135] R10: 0000000000000000 R11: 0000000000000206 R12: 0000000000402cf0 [ 45.669377] R13: 0000000000402d80 R14: 0000000000000000 R15: 0000000000000000 [ 45.676643] [ 45.678250] Allocated by task 2985: [ 45.681857] save_stack_trace+0x16/0x20 [ 45.685807] save_stack+0x43/0xd0 [ 45.689231] kasan_kmalloc+0xad/0xe0 [ 45.692914] __kmalloc_node+0x47/0x70 [ 45.696687] kvmalloc_node+0x64/0xd0 [ 45.700375] alloc_netdev_mqs+0x16e/0xed0 [ 45.704495] __tun_chr_ioctl+0x12be/0x3d20 [ 45.708698] tun_chr_ioctl+0x2a/0x40 [ 45.712384] do_vfs_ioctl+0x1b1/0x1530 [ 45.716240] SyS_ioctl+0x8f/0xc0 [ 45.719578] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 45.724303] [ 45.725901] Freed by task 2985: [ 45.729154] save_stack_trace+0x16/0x20 [ 45.733098] save_stack+0x43/0xd0 [ 45.736520] kasan_slab_free+0x71/0xc0 [ 45.740374] kfree+0xca/0x250 [ 45.743447] kvfree+0x36/0x60 [ 45.746521] free_netdev+0x2cf/0x360 [ 45.750202] __tun_chr_ioctl+0x2cf6/0x3d20 [ 45.754409] tun_chr_ioctl+0x2a/0x40 [ 45.758091] do_vfs_ioctl+0x1b1/0x1530 [ 45.761951] SyS_ioctl+0x8f/0xc0 [ 45.765290] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 45.770010] [ 45.771619] The buggy address belongs to the object at ffff8801ce5e0400 [ 45.771619] which belongs to the cache kmalloc-16384 of size 16384 [ 45.784605] The buggy address is located 13312 bytes inside of [ 45.784605] 16384-byte region [ffff8801ce5e0400, ffff8801ce5e4400) [ 45.796798] The buggy address belongs to the page: [ 45.801697] page:ffffea0007397800 count:1 mapcount:0 mapping:ffff8801ce5e0400 index:0x0 compound_mapcount: 0 [ 45.811647] flags: 0x200000000008100(slab|head) [ 45.816292] raw: 0200000000008100 ffff8801ce5e0400 0000000000000000 0000000100000001 [ 45.824156] raw: ffffea000738a220 ffff8801dac01c50 ffff8801dac02200 0000000000000000 [ 45.832108] page dumped because: kasan: bad access detected [ 45.837785] [ 45.839381] Memory state around the buggy address: [ 45.844283] ffff8801ce5e3700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 45.851615] ffff8801ce5e3780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 45.858943] >ffff8801ce5e3800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 45.866271] ^ [ 45.869608] ffff8801ce5e3880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 45.876936] ffff8801ce5e3900: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 45.884263] ================================================================== [ 45.891592] Disabling lock debugging due to kernel taint [ 45.897010] Kernel panic - not syncing: panic_on_warn set ... [ 45.897010] [ 45.904338] CPU: 1 PID: 2985 Comm: syzkaller563573 Tainted: G B 4.13.0-next-20170908+ #18 [ 45.913754] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 45.923081] Call Trace: [ 45.925641] dump_stack+0x194/0x257 [ 45.929237] ? arch_local_irq_restore+0x53/0x53 [ 45.933872] ? vprintk_default+0x28/0x30 [ 45.937900] ? detach_if_pending+0x4c0/0x610 [ 45.942275] panic+0x1e4/0x417 [ 45.945443] ? __warn+0x1d9/0x1d9 [ 45.948866] ? detach_if_pending+0x557/0x610 [ 45.953248] kasan_end_report+0x50/0x50 [ 45.957187] kasan_report+0x137/0x340 [ 45.960955] __asan_report_store8_noabort+0x17/0x20 [ 45.965937] detach_if_pending+0x557/0x610 [ 45.970143] ? trace_raw_output_tick_stop+0x130/0x130 [ 45.975301] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 45.979935] ? lock_timer_base+0x1a3/0x2b0 [ 45.984134] ? lock_timer_base+0x1eb/0x2b0 [ 45.988334] ? __internal_add_timer+0x2d0/0x2d0 [ 45.992968] ? trace_hardirqs_on+0xd/0x10 [ 45.997085] try_to_del_timer_sync+0xa2/0x120 [ 46.001542] ? del_timer+0x130/0x130 [ 46.005236] ? del_timer_sync+0xeb/0x240 [ 46.009264] del_timer_sync+0x18a/0x240 [ 46.013218] tun_free_netdev+0x105/0x1b0 [ 46.017244] ? tun_xdp+0x410/0x410 [ 46.020752] ? cpumask_next+0x24/0x30 [ 46.024524] ? netdev_refcnt_read+0xed/0x150 [ 46.028899] ? tun_xdp+0x410/0x410 [ 46.032410] netdev_run_todo+0x870/0xca0 [ 46.036438] ? do_group_exit+0x149/0x400 [ 46.040476] ? register_netdev+0x30/0x30 [ 46.044505] ? lock_downgrade+0x990/0x990 [ 46.048618] ? trace_hardirqs_on+0xd/0x10 [ 46.052740] ? refcount_sub_and_test+0x115/0x1b0 [ 46.057471] ? refcount_inc+0x50/0x50 [ 46.061237] ? refcount_inc+0x50/0x50 [ 46.065011] ? sk_destruct+0x4c/0x80 [ 46.068688] ? __sk_free+0x5c/0x230 [ 46.072288] ? sk_free+0x2f/0x40 [ 46.075618] ? __tun_detach+0x176/0x1390 [ 46.079657] ? tun_attach+0xf90/0xf90 [ 46.083435] ? locks_remove_file+0x3fa/0x5a0 [ 46.087820] ? fcntl_setlk+0x10d0/0x10d0 [ 46.091867] ? __fsnotify_parent+0xb4/0x3a0 [ 46.096165] ? fsnotify+0x1af0/0x1af0 [ 46.099934] ? __tun_detach+0x1390/0x1390 [ 46.104047] ? __tun_detach+0x1390/0x1390 [ 46.108164] rtnl_unlock+0xe/0x10 [ 46.111581] tun_chr_close+0x49/0x60 [ 46.115261] __fput+0x333/0x7f0 [ 46.118508] ? fput+0x140/0x140 [ 46.121757] ? check_same_owner+0x320/0x320 [ 46.126054] ____fput+0x15/0x20 [ 46.129311] task_work_run+0x199/0x270 [ 46.133166] ? task_work_cancel+0x210/0x210 [ 46.137453] ? free_nsproxy+0x185/0x1f0 [ 46.141393] ? switch_task_namespaces+0xa2/0xc0 [ 46.146037] do_exit+0xa52/0x1b40 [ 46.149459] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 46.154438] ? trace_hardirqs_on+0xd/0x10 [ 46.158555] ? kvfree+0x3b/0x60 [ 46.161801] ? mm_update_next_owner+0x930/0x930 [ 46.166437] ? rtnl_unlock+0xe/0x10 [ 46.170032] ? __tun_chr_ioctl+0x27a/0x3d20 [ 46.174321] ? tun_chr_read_iter+0x1e0/0x1e0 [ 46.178701] ? lock_downgrade+0x990/0x990 [ 46.182826] ? check_same_owner+0x320/0x320 [ 46.187123] ? __handle_mm_fault+0x39c0/0x39c0 [ 46.191681] ? vmacache_find+0x61/0x270 [ 46.195626] ? tun_chr_compat_ioctl+0x30/0x30 [ 46.200093] ? tun_chr_ioctl+0x2a/0x40 [ 46.203961] ? tun_chr_ioctl+0x2a/0x40 [ 46.207827] ? do_vfs_ioctl+0x492/0x1530 [ 46.211859] ? ioctl_preallocate+0x2b0/0x2b0 [ 46.216242] ? selinux_capable+0x40/0x40 [ 46.220283] ? putname+0xf3/0x130 [ 46.223706] do_group_exit+0x149/0x400 [ 46.227560] ? SyS_exit+0x30/0x30 [ 46.230982] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 46.235968] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 46.240694] SyS_exit_group+0x1d/0x20 [ 46.244465] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 46.249193] RIP: 0033:0x445699 [ 46.252361] RSP: 002b:00000000007efe58 EFLAGS: 00000206 ORIG_RAX: 00000000000000e7 [ 46.260034] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 0000000000445699 [ 46.267271] RDX: 0000000000445699 RSI: 0000000020115000 RDI: 0000000000000001 [ 46.274511] RBP: 0000000000000082 R08: 0000000000000000 R09: 0000000000000000 [ 46.281754] R10: 0000000000000000 R11: 0000000000000206 R12: 0000000000402cf0 [ 46.288989] R13: 0000000000402d80 R14: 0000000000000000 R15: 0000000000000000