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-8,10.128.0.6' (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: [ 32.603292] ================================================================== [ 32.610740] BUG: KASAN: use-after-free in detach_if_pending+0x557/0x610 [ 32.617466] Write of size 8 at addr ffff8801ce00b7c0 by task syzkaller177302/2984 [ 32.625057] [ 32.626662] CPU: 0 PID: 2984 Comm: syzkaller177302 Not tainted 4.13.0-next-20170908+ #18 [ 32.634860] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 32.644186] Call Trace: [ 32.646748] dump_stack+0x194/0x257 [ 32.650356] ? arch_local_irq_restore+0x53/0x53 [ 32.655001] ? show_regs_print_info+0x65/0x65 [ 32.659472] ? lock_timer_base+0x1a3/0x2b0 [ 32.663681] ? detach_if_pending+0x557/0x610 [ 32.668065] print_address_description+0x73/0x250 [ 32.672880] ? detach_if_pending+0x557/0x610 [ 32.677259] kasan_report+0x24e/0x340 [ 32.681034] __asan_report_store8_noabort+0x17/0x20 [ 32.686022] detach_if_pending+0x557/0x610 [ 32.690230] ? trace_raw_output_tick_stop+0x130/0x130 [ 32.695391] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 32.700028] ? lock_timer_base+0x1a3/0x2b0 [ 32.704233] ? lock_timer_base+0x1eb/0x2b0 [ 32.708441] ? __internal_add_timer+0x2d0/0x2d0 [ 32.713091] ? trace_hardirqs_on+0xd/0x10 [ 32.717218] try_to_del_timer_sync+0xa2/0x120 [ 32.721682] ? del_timer+0x130/0x130 [ 32.725366] ? del_timer_sync+0xeb/0x240 [ 32.729405] del_timer_sync+0x18a/0x240 [ 32.733351] tun_free_netdev+0x105/0x1b0 [ 32.737380] ? tun_xdp+0x410/0x410 [ 32.740901] ? cpumask_next+0x24/0x30 [ 32.744674] ? netdev_refcnt_read+0xed/0x150 [ 32.749058] ? tun_xdp+0x410/0x410 [ 32.752569] netdev_run_todo+0x870/0xca0 [ 32.756602] ? do_group_exit+0x149/0x400 [ 32.760639] ? register_netdev+0x30/0x30 [ 32.764674] ? lock_downgrade+0x990/0x990 [ 32.768805] ? trace_hardirqs_on+0xd/0x10 [ 32.772944] ? refcount_sub_and_test+0x115/0x1b0 [ 32.777670] ? refcount_inc+0x50/0x50 [ 32.781442] ? refcount_inc+0x50/0x50 [ 32.785218] ? sk_destruct+0x4c/0x80 [ 32.788903] ? __sk_free+0x5c/0x230 [ 32.792502] ? sk_free+0x2f/0x40 [ 32.795838] ? __tun_detach+0x176/0x1390 [ 32.799882] ? tun_attach+0xf90/0xf90 [ 32.803658] ? do_raw_spin_trylock+0x190/0x190 [ 32.808213] ? locks_remove_file+0x3fa/0x5a0 [ 32.812594] ? fcntl_setlk+0x10d0/0x10d0 [ 32.816629] ? __fsnotify_parent+0xb4/0x3a0 [ 32.820923] ? fsnotify+0x1af0/0x1af0 [ 32.824698] ? __tun_detach+0x1390/0x1390 [ 32.828816] ? __tun_detach+0x1390/0x1390 [ 32.832946] rtnl_unlock+0xe/0x10 [ 32.836370] tun_chr_close+0x49/0x60 [ 32.840059] __fput+0x333/0x7f0 [ 32.843327] ? fput+0x140/0x140 [ 32.846579] ? check_same_owner+0x320/0x320 [ 32.850869] ? _raw_spin_unlock_irq+0x27/0x70 [ 32.855341] ____fput+0x15/0x20 [ 32.858591] task_work_run+0x199/0x270 [ 32.862452] ? task_work_cancel+0x210/0x210 [ 32.866744] ? _raw_spin_unlock+0x22/0x30 [ 32.870862] ? switch_task_namespaces+0x87/0xc0 [ 32.875504] do_exit+0xa52/0x1b40 [ 32.878932] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 32.883921] ? check_noncircular+0x20/0x20 [ 32.888143] ? mm_update_next_owner+0x930/0x930 [ 32.892783] ? __pmd_alloc+0x4e0/0x4e0 [ 32.896649] ? find_held_lock+0x39/0x1d0 [ 32.900692] ? lock_downgrade+0x990/0x990 [ 32.904832] ? handle_mm_fault+0x410/0x8d0 [ 32.909035] ? down_read_trylock+0xdb/0x170 [ 32.913329] ? __handle_mm_fault+0x39c0/0x39c0 [ 32.917881] ? vmacache_find+0x61/0x270 [ 32.921832] ? up_read+0x1a/0x40 [ 32.925171] ? __do_page_fault+0x35b/0xb60 [ 32.929375] ? do_vfs_ioctl+0x492/0x1530 [ 32.933415] ? do_page_fault+0xee/0x720 [ 32.937362] ? __do_page_fault+0xb60/0xb60 [ 32.941567] ? putname+0xf3/0x130 [ 32.945002] do_group_exit+0x149/0x400 [ 32.948861] ? lockdep_sys_exit+0x47/0xf0 [ 32.952979] ? SyS_exit+0x30/0x30 [ 32.956406] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 32.961395] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 32.966127] SyS_exit_group+0x1d/0x20 [ 32.969917] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 32.974643] RIP: 0033:0x443a28 [ 32.977804] RSP: 002b:00007ffe675d6e18 EFLAGS: 00000246 ORIG_RAX: 00000000000000e7 [ 32.985488] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 0000000000443a28 [ 32.992729] RDX: 0000000000000000 RSI: 000000000000003c RDI: 0000000000000000 [ 32.999982] RBP: 0000000000000082 R08: 00000000000000e7 R09: ffffffffffffffd4 [ 33.007223] R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000001 [ 33.014464] R13: 00000000006d6180 R14: 0000000000000000 R15: 0000000000000000 [ 33.021724] [ 33.023325] Allocated by task 2984: [ 33.026925] save_stack_trace+0x16/0x20 [ 33.030869] save_stack+0x43/0xd0 [ 33.034291] kasan_kmalloc+0xad/0xe0 [ 33.037974] __kmalloc_node+0x47/0x70 [ 33.041742] kvmalloc_node+0x64/0xd0 [ 33.045429] alloc_netdev_mqs+0x16e/0xed0 [ 33.049546] __tun_chr_ioctl+0x12be/0x3d20 [ 33.053749] tun_chr_ioctl+0x2a/0x40 [ 33.057431] do_vfs_ioctl+0x1b1/0x1530 [ 33.061287] SyS_ioctl+0x8f/0xc0 [ 33.064625] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 33.069344] [ 33.070942] Freed by task 2984: [ 33.074194] save_stack_trace+0x16/0x20 [ 33.078138] save_stack+0x43/0xd0 [ 33.081560] kasan_slab_free+0x71/0xc0 [ 33.085416] kfree+0xca/0x250 [ 33.088490] kvfree+0x36/0x60 [ 33.091564] free_netdev+0x2cf/0x360 [ 33.095247] __tun_chr_ioctl+0x2cf6/0x3d20 [ 33.099449] tun_chr_ioctl+0x2a/0x40 [ 33.103141] do_vfs_ioctl+0x1b1/0x1530 [ 33.106996] SyS_ioctl+0x8f/0xc0 [ 33.110331] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 33.115053] [ 33.116663] The buggy address belongs to the object at ffff8801ce0083c0 [ 33.116663] which belongs to the cache kmalloc-16384 of size 16384 [ 33.129633] The buggy address is located 13312 bytes inside of [ 33.129633] 16384-byte region [ffff8801ce0083c0, ffff8801ce00c3c0) [ 33.141821] The buggy address belongs to the page: [ 33.146720] page:ffffea0007380200 count:1 mapcount:0 mapping:ffff8801ce0083c0 index:0x0 compound_mapcount: 0 [ 33.156663] flags: 0x200000000008100(slab|head) [ 33.161304] raw: 0200000000008100 ffff8801ce0083c0 0000000000000000 0000000100000001 [ 33.169164] raw: ffffea000758ae20 ffff8801dac01c50 ffff8801dac02200 0000000000000000 [ 33.177016] page dumped because: kasan: bad access detected [ 33.182697] [ 33.184292] Memory state around the buggy address: [ 33.189192] ffff8801ce00b680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 33.196519] ffff8801ce00b700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 33.203848] >ffff8801ce00b780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 33.211177] ^ [ 33.216606] ffff8801ce00b800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 33.223936] ffff8801ce00b880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 33.231263] ================================================================== [ 33.238599] Disabling lock debugging due to kernel taint [ 33.244015] Kernel panic - not syncing: panic_on_warn set ... [ 33.244015] [ 33.251340] CPU: 0 PID: 2984 Comm: syzkaller177302 Tainted: G B 4.13.0-next-20170908+ #18 [ 33.260747] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 33.270066] Call Trace: [ 33.272622] dump_stack+0x194/0x257 [ 33.276215] ? arch_local_irq_restore+0x53/0x53 [ 33.280852] ? vprintk_default+0x28/0x30 [ 33.284894] ? detach_if_pending+0x4c0/0x610 [ 33.289268] panic+0x1e4/0x417 [ 33.292425] ? __warn+0x1d9/0x1d9 [ 33.295851] ? detach_if_pending+0x557/0x610 [ 33.300227] kasan_end_report+0x50/0x50 [ 33.304179] kasan_report+0x137/0x340 [ 33.307950] __asan_report_store8_noabort+0x17/0x20 [ 33.312930] detach_if_pending+0x557/0x610 [ 33.317130] ? trace_raw_output_tick_stop+0x130/0x130 [ 33.322284] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 33.326919] ? lock_timer_base+0x1a3/0x2b0 [ 33.331129] ? lock_timer_base+0x1eb/0x2b0 [ 33.335330] ? __internal_add_timer+0x2d0/0x2d0 [ 33.339965] ? trace_hardirqs_on+0xd/0x10 [ 33.344084] try_to_del_timer_sync+0xa2/0x120 [ 33.348543] ? del_timer+0x130/0x130 [ 33.352223] ? del_timer_sync+0xeb/0x240 [ 33.356251] del_timer_sync+0x18a/0x240 [ 33.360190] tun_free_netdev+0x105/0x1b0 [ 33.364216] ? tun_xdp+0x410/0x410 [ 33.367720] ? cpumask_next+0x24/0x30 [ 33.371488] ? netdev_refcnt_read+0xed/0x150 [ 33.375864] ? tun_xdp+0x410/0x410 [ 33.379367] netdev_run_todo+0x870/0xca0 [ 33.383393] ? do_group_exit+0x149/0x400 [ 33.387422] ? register_netdev+0x30/0x30 [ 33.391449] ? lock_downgrade+0x990/0x990 [ 33.395561] ? trace_hardirqs_on+0xd/0x10 [ 33.399684] ? refcount_sub_and_test+0x115/0x1b0 [ 33.404402] ? refcount_inc+0x50/0x50 [ 33.408178] ? refcount_inc+0x50/0x50 [ 33.411946] ? sk_destruct+0x4c/0x80 [ 33.415623] ? __sk_free+0x5c/0x230 [ 33.419214] ? sk_free+0x2f/0x40 [ 33.422545] ? __tun_detach+0x176/0x1390 [ 33.426577] ? tun_attach+0xf90/0xf90 [ 33.430359] ? do_raw_spin_trylock+0x190/0x190 [ 33.434908] ? locks_remove_file+0x3fa/0x5a0 [ 33.439282] ? fcntl_setlk+0x10d0/0x10d0 [ 33.443308] ? __fsnotify_parent+0xb4/0x3a0 [ 33.447597] ? fsnotify+0x1af0/0x1af0 [ 33.451366] ? __tun_detach+0x1390/0x1390 [ 33.455478] ? __tun_detach+0x1390/0x1390 [ 33.459591] rtnl_unlock+0xe/0x10 [ 33.463011] tun_chr_close+0x49/0x60 [ 33.466690] __fput+0x333/0x7f0 [ 33.469937] ? fput+0x140/0x140 [ 33.473183] ? check_same_owner+0x320/0x320 [ 33.477469] ? _raw_spin_unlock_irq+0x27/0x70 [ 33.481934] ____fput+0x15/0x20 [ 33.485180] task_work_run+0x199/0x270 [ 33.489036] ? task_work_cancel+0x210/0x210 [ 33.493324] ? _raw_spin_unlock+0x22/0x30 [ 33.497439] ? switch_task_namespaces+0x87/0xc0 [ 33.502077] do_exit+0xa52/0x1b40 [ 33.505498] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 33.510480] ? check_noncircular+0x20/0x20 [ 33.514695] ? mm_update_next_owner+0x930/0x930 [ 33.519330] ? __pmd_alloc+0x4e0/0x4e0 [ 33.523188] ? find_held_lock+0x39/0x1d0 [ 33.527231] ? lock_downgrade+0x990/0x990 [ 33.531355] ? handle_mm_fault+0x410/0x8d0 [ 33.535559] ? down_read_trylock+0xdb/0x170 [ 33.539850] ? __handle_mm_fault+0x39c0/0x39c0 [ 33.544397] ? vmacache_find+0x61/0x270 [ 33.548338] ? up_read+0x1a/0x40 [ 33.551670] ? __do_page_fault+0x35b/0xb60 [ 33.555869] ? do_vfs_ioctl+0x492/0x1530 [ 33.559899] ? do_page_fault+0xee/0x720 [ 33.563839] ? __do_page_fault+0xb60/0xb60 [ 33.568126] ? putname+0xf3/0x130 [ 33.571547] do_group_exit+0x149/0x400 [ 33.575399] ? lockdep_sys_exit+0x47/0xf0 [ 33.579511] ? SyS_exit+0x30/0x30 [ 33.582932] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 33.587914] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 33.592637] SyS_exit_group+0x1d/0x20 [ 33.596404] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 33.601125] RIP: 0033:0x443a28