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-5,10.128.0.24' (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.618346] ================================================================== [ 42.619501] BUG: KASAN: use-after-free in detach_if_pending+0x557/0x610 [ 42.620391] Write of size 8 at addr ffff8801d07eb6f8 by task syzkaller791766/3004 [ 42.621389] [ 42.621623] CPU: 1 PID: 3004 Comm: syzkaller791766 Not tainted 4.13.0-rc6+ #45 [ 42.622584] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 42.623818] Call Trace: [ 42.624174] dump_stack+0x194/0x257 [ 42.624663] ? arch_local_irq_restore+0x53/0x53 [ 42.625286] ? show_regs_print_info+0x65/0x65 [ 42.625886] ? lock_timer_base+0x1a3/0x2b0 [ 42.626454] ? detach_if_pending+0x557/0x610 [ 42.627045] print_address_description+0x73/0x250 [ 42.627690] ? detach_if_pending+0x557/0x610 [ 42.628279] kasan_report+0x24e/0x340 [ 42.628795] __asan_report_store8_noabort+0x17/0x20 [ 42.629459] detach_if_pending+0x557/0x610 [ 42.630028] ? __next_timer_interrupt+0x150/0x150 [ 42.630701] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 42.631324] ? lock_timer_base+0x1a3/0x2b0 [ 42.631893] ? lock_timer_base+0x1eb/0x2b0 [ 42.632465] ? __internal_add_timer+0x2d0/0x2d0 [ 42.633088] ? lock_downgrade+0x990/0x990 [ 42.633707] try_to_del_timer_sync+0xa2/0x120 [ 42.634309] ? del_timer+0x130/0x130 [ 42.634810] ? del_timer_sync+0xeb/0x240 [ 42.635364] del_timer_sync+0x18a/0x240 [ 42.635904] tun_free_netdev+0x105/0x1b0 [ 42.636451] ? tun_show_group+0x170/0x170 [ 42.637012] ? netdev_refcnt_read+0xf4/0x160 [ 42.637657] ? tun_show_group+0x170/0x170 [ 42.638215] netdev_run_todo+0x870/0xca0 [ 42.640295] ? do_group_exit+0x149/0x400 [ 42.644324] ? mark_held_locks+0xaf/0x100 [ 42.648614] ? register_netdev+0x30/0x30 [ 42.652644] ? find_held_lock+0x35/0x1d0 [ 42.656686] ? lock_downgrade+0x990/0x990 [ 42.660805] ? refcount_sub_and_test+0x115/0x1b0 [ 42.665529] ? refcount_inc+0x50/0x50 [ 42.669297] ? refcount_inc+0x50/0x50 [ 42.673070] ? sk_destruct+0x4c/0x80 [ 42.676751] ? __sk_free+0x5c/0x230 [ 42.680355] ? sk_free+0x2f/0x40 [ 42.683707] ? __tun_detach+0x176/0x1390 [ 42.687754] ? tun_attach+0xfa0/0xfa0 [ 42.691532] ? locks_remove_file+0x414/0x560 [ 42.695910] ? fcntl_setlk+0x10c0/0x10c0 [ 42.699939] ? __fsnotify_parent+0xb4/0x3a0 [ 42.704234] ? fsnotify+0x1af0/0x1af0 [ 42.708009] ? __tun_detach+0x1390/0x1390 [ 42.712125] rtnl_unlock+0xe/0x10 [ 42.715545] tun_chr_close+0x49/0x60 [ 42.719227] __fput+0x327/0x7e0 [ 42.722481] ? fput+0x140/0x140 [ 42.725728] ? check_same_owner+0x320/0x320 [ 42.730025] ____fput+0x15/0x20 [ 42.733278] task_work_run+0x18a/0x260 [ 42.737145] ? task_work_cancel+0x210/0x210 [ 42.741444] ? free_nsproxy+0x185/0x1f0 [ 42.745387] ? switch_task_namespaces+0xa2/0xc0 [ 42.750031] do_exit+0xa3a/0x1b10 [ 42.753452] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 42.758438] ? trace_hardirqs_on+0xd/0x10 [ 42.762570] ? kvfree+0x3b/0x60 [ 42.765828] ? mm_update_next_owner+0x930/0x930 [ 42.770467] ? rtnl_unlock+0xe/0x10 [ 42.774064] ? __tun_chr_ioctl+0x27a/0x3d60 [ 42.778390] ? unwind_dump+0x4/0x4c0 [ 42.782082] ? tun_select_queue+0x580/0x580 [ 42.786379] ? check_noncircular+0x20/0x20 [ 42.790584] ? save_stack+0xa3/0xd0 [ 42.794186] ? __handle_mm_fault+0x577/0x3860 [ 42.798645] ? check_noncircular+0x20/0x20 [ 42.802857] ? check_noncircular+0x20/0x20 [ 42.807059] ? __pmd_alloc+0x4e0/0x4e0 [ 42.810942] ? check_same_owner+0x320/0x320 [ 42.815239] ? handle_mm_fault+0x23e/0x860 [ 42.819448] ? tun_chr_compat_ioctl+0x30/0x30 [ 42.823908] ? tun_chr_ioctl+0x2a/0x40 [ 42.827763] ? tun_chr_ioctl+0x2a/0x40 [ 42.831621] ? do_vfs_ioctl+0x486/0x1520 [ 42.835653] ? ioctl_preallocate+0x2b0/0x2b0 [ 42.840036] ? selinux_capable+0x40/0x40 [ 42.844071] ? __handle_mm_fault+0x3860/0x3860 [ 42.848626] do_group_exit+0x149/0x400 [ 42.852484] ? SyS_exit+0x30/0x30 [ 42.855908] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 42.860902] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 42.865630] SyS_exit_group+0x1d/0x20 [ 42.869400] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 42.874123] RIP: 0033:0x445209 [ 42.877280] RSP: 002b:00007ffe0e3d02b8 EFLAGS: 00000206 ORIG_RAX: 00000000000000e7 [ 42.884954] RAX: ffffffffffffffda RBX: 00007ffe0e3d02f0 RCX: 0000000000445209 [ 42.892191] RDX: 0000000000445209 RSI: 00000000208b1000 RDI: 0000000000000001 [ 42.899429] RBP: 0000000000000086 R08: 0000000000000000 R09: 00007ffe0e3d02f0 [ 42.906666] R10: 0000000000000000 R11: 0000000000000206 R12: 00000000004025b0 [ 42.913904] R13: 0000000000402640 R14: 0000000000000000 R15: 0000000000000000 [ 42.921156] [ 42.922752] Allocated by task 3004: [ 42.926348] save_stack_trace+0x16/0x20 [ 42.930290] save_stack+0x43/0xd0 [ 42.933711] kasan_kmalloc+0xad/0xe0 [ 42.937389] __kmalloc_node+0x47/0x70 [ 42.941158] kvmalloc_node+0x64/0xd0 [ 42.944838] alloc_netdev_mqs+0x16e/0xed0 [ 42.948951] __tun_chr_ioctl+0x12b2/0x3d60 [ 42.953150] tun_chr_ioctl+0x2a/0x40 [ 42.956831] do_vfs_ioctl+0x1b1/0x1520 [ 42.960695] SyS_ioctl+0x8f/0xc0 [ 42.964036] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 42.968755] [ 42.970361] Freed by task 3004: [ 42.973606] save_stack_trace+0x16/0x20 [ 42.977546] save_stack+0x43/0xd0 [ 42.980975] kasan_slab_free+0x71/0xc0 [ 42.984841] kfree+0xca/0x250 [ 42.987910] kvfree+0x36/0x60 [ 42.990981] free_netdev+0x2cf/0x360 [ 42.994663] __tun_chr_ioctl+0x2d24/0x3d60 [ 42.998863] tun_chr_ioctl+0x2a/0x40 [ 43.002543] do_vfs_ioctl+0x1b1/0x1520 [ 43.006397] SyS_ioctl+0x8f/0xc0 [ 43.009727] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 43.014446] [ 43.016043] The buggy address belongs to the object at ffff8801d07e83c0 [ 43.016043] which belongs to the cache kmalloc-16384 of size 16384 [ 43.029016] The buggy address is located 13112 bytes inside of [ 43.029016] 16384-byte region [ffff8801d07e83c0, ffff8801d07ec3c0) [ 43.041205] The buggy address belongs to the page: [ 43.046105] page:ffffea000741fa00 count:1 mapcount:0 mapping:ffff8801d07e83c0 index:0x0 compound_mapcount: 0 [ 43.056043] flags: 0x200000000008100(slab|head) [ 43.060679] raw: 0200000000008100 ffff8801d07e83c0 0000000000000000 0000000100000001 [ 43.068525] raw: ffffea0007436820 ffff8801dac01c48 ffff8801dac02200 0000000000000000 [ 43.076372] page dumped because: kasan: bad access detected [ 43.082053] [ 43.083647] Memory state around the buggy address: [ 43.088540] ffff8801d07eb580: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 43.095872] ffff8801d07eb600: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 43.103197] >ffff8801d07eb680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 43.110530] ^ [ 43.117768] ffff8801d07eb700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 43.125094] ffff8801d07eb780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 43.132416] ================================================================== [ 43.139922] Disabling lock debugging due to kernel taint [ 43.145338] Kernel panic - not syncing: panic_on_warn set ... [ 43.145338] [ 43.152664] CPU: 1 PID: 3004 Comm: syzkaller791766 Tainted: G B 4.13.0-rc6+ #45 [ 43.161201] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 43.170520] Call Trace: [ 43.173075] dump_stack+0x194/0x257 [ 43.176670] ? arch_local_irq_restore+0x53/0x53 [ 43.181304] ? kasan_end_report+0x32/0x50 [ 43.185430] ? lock_downgrade+0x990/0x990 [ 43.189566] ? detach_if_pending+0x550/0x610 [ 43.193941] panic+0x1e4/0x417 [ 43.197101] ? __warn+0x1d9/0x1d9 [ 43.200618] ? detach_if_pending+0x557/0x610 [ 43.204990] kasan_end_report+0x50/0x50 [ 43.208928] kasan_report+0x137/0x340 [ 43.212696] __asan_report_store8_noabort+0x17/0x20 [ 43.217685] detach_if_pending+0x557/0x610 [ 43.221888] ? __next_timer_interrupt+0x150/0x150 [ 43.226694] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 43.231326] ? lock_timer_base+0x1a3/0x2b0 [ 43.235524] ? lock_timer_base+0x1eb/0x2b0 [ 43.239724] ? __internal_add_timer+0x2d0/0x2d0 [ 43.244357] ? lock_downgrade+0x990/0x990 [ 43.248507] try_to_del_timer_sync+0xa2/0x120 [ 43.252967] ? del_timer+0x130/0x130 [ 43.256692] ? del_timer_sync+0xeb/0x240 [ 43.260720] del_timer_sync+0x18a/0x240 [ 43.264675] tun_free_netdev+0x105/0x1b0 [ 43.268702] ? tun_show_group+0x170/0x170 [ 43.272814] ? netdev_refcnt_read+0xf4/0x160 [ 43.277186] ? tun_show_group+0x170/0x170 [ 43.281311] netdev_run_todo+0x870/0xca0 [ 43.285338] ? do_group_exit+0x149/0x400 [ 43.289363] ? mark_held_locks+0xaf/0x100 [ 43.293474] ? register_netdev+0x30/0x30 [ 43.297502] ? find_held_lock+0x35/0x1d0 [ 43.301530] ? lock_downgrade+0x990/0x990 [ 43.305645] ? refcount_sub_and_test+0x115/0x1b0 [ 43.310365] ? refcount_inc+0x50/0x50 [ 43.314130] ? refcount_inc+0x50/0x50 [ 43.317897] ? sk_destruct+0x4c/0x80 [ 43.321576] ? __sk_free+0x5c/0x230 [ 43.325169] ? sk_free+0x2f/0x40 [ 43.328504] ? __tun_detach+0x176/0x1390 [ 43.332535] ? tun_attach+0xfa0/0xfa0 [ 43.336308] ? locks_remove_file+0x414/0x560 [ 43.340682] ? fcntl_setlk+0x10c0/0x10c0 [ 43.344707] ? __fsnotify_parent+0xb4/0x3a0 [ 43.348995] ? fsnotify+0x1af0/0x1af0 [ 43.352762] ? __tun_detach+0x1390/0x1390 [ 43.356875] rtnl_unlock+0xe/0x10 [ 43.360293] tun_chr_close+0x49/0x60 [ 43.363972] __fput+0x327/0x7e0 [ 43.367217] ? fput+0x140/0x140 [ 43.370462] ? check_same_owner+0x320/0x320 [ 43.374752] ____fput+0x15/0x20 [ 43.377994] task_work_run+0x18a/0x260 [ 43.381845] ? task_work_cancel+0x210/0x210 [ 43.386129] ? free_nsproxy+0x185/0x1f0 [ 43.390067] ? switch_task_namespaces+0xa2/0xc0 [ 43.394701] do_exit+0xa3a/0x1b10 [ 43.398118] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 43.403099] ? trace_hardirqs_on+0xd/0x10 [ 43.407212] ? kvfree+0x3b/0x60 [ 43.410457] ? mm_update_next_owner+0x930/0x930 [ 43.415091] ? rtnl_unlock+0xe/0x10 [ 43.418683] ? __tun_chr_ioctl+0x27a/0x3d60 [ 43.422969] ? unwind_dump+0x4/0x4c0 [ 43.426651] ? tun_select_queue+0x580/0x580 [ 43.430937] ? check_noncircular+0x20/0x20 [ 43.435134] ? save_stack+0xa3/0xd0 [ 43.438731] ? __handle_mm_fault+0x577/0x3860 [ 43.443188] ? check_noncircular+0x20/0x20 [ 43.447388] ? check_noncircular+0x20/0x20 [ 43.451586] ? __pmd_alloc+0x4e0/0x4e0 [ 43.455445] ? check_same_owner+0x320/0x320 [ 43.459731] ? handle_mm_fault+0x23e/0x860 [ 43.463934] ? tun_chr_compat_ioctl+0x30/0x30 [ 43.468393] ? tun_chr_ioctl+0x2a/0x40 [ 43.472244] ? tun_chr_ioctl+0x2a/0x40 [ 43.476096] ? do_vfs_ioctl+0x486/0x1520 [ 43.480124] ? ioctl_preallocate+0x2b0/0x2b0 [ 43.484503] ? selinux_capable+0x40/0x40 [ 43.488538] ? __handle_mm_fault+0x3860/0x3860 [ 43.493088] do_group_exit+0x149/0x400 [ 43.496944] ? SyS_exit+0x30/0x30 [ 43.500361] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 43.505344] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 43.510064] SyS_exit_group+0x1d/0x20 [ 43.513829] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 43.518548] RIP: 0033:0x445209 [ 43.521734] RSP: 002b:00007ffe0e3d02b8 EFLAGS: 00000206 ORIG_RAX: 00000000000000e7 [ 43.529405] RAX: ffffffffffffffda RBX: 00007ffe0e3d02f0 RCX: 0000000000445209 [ 43.536639] RDX: 0000000000445209 RSI: 00000000208b1000 RDI: 0000000000000001 [ 43.543873] RBP: 0000000000000086 R08: 0000000000000000 R09: 00007ffe0e3d02f0 [ 43.551107] R10: 0000000000000000 R11: 0000000000000206 R12: 00000000004025b0 [ 43.558341] R13: 0000000000402640 R14: 0000000000000000 R15: 0000000000000000