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-7,10.128.15.193' (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: [ 35.069299] ================================================================== [ 35.070402] BUG: KASAN: use-after-free in detach_if_pending+0x557/0x610 [ 35.071294] Write of size 8 at addr ffff8801ce5b3780 by task syzkaller627290/2987 [ 35.072294] [ 35.072532] CPU: 1 PID: 2987 Comm: syzkaller627290 Not tainted 4.13.0-next-20170908+ #18 [ 35.073613] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 35.074854] Call Trace: [ 35.075218] dump_stack+0x194/0x257 [ 35.075719] ? arch_local_irq_restore+0x53/0x53 [ 35.076346] ? show_regs_print_info+0x65/0x65 [ 35.076950] ? lock_timer_base+0x1a3/0x2b0 [ 35.077522] ? detach_if_pending+0x557/0x610 [ 35.078118] print_address_description+0x73/0x250 [ 35.078766] ? detach_if_pending+0x557/0x610 [ 35.079358] kasan_report+0x24e/0x340 [ 35.079877] __asan_report_store8_noabort+0x17/0x20 [ 35.080547] detach_if_pending+0x557/0x610 [ 35.081121] ? trace_raw_output_tick_stop+0x130/0x130 [ 35.081816] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 35.082455] ? lock_timer_base+0x1a3/0x2b0 [ 35.083025] ? lock_timer_base+0x1eb/0x2b0 [ 35.083600] ? __internal_add_timer+0x2d0/0x2d0 [ 35.084233] ? trace_hardirqs_on+0xd/0x10 [ 35.084803] try_to_del_timer_sync+0xa2/0x120 [ 35.085405] ? del_timer+0x130/0x130 [ 35.085910] ? del_timer_sync+0xeb/0x240 [ 35.086463] del_timer_sync+0x18a/0x240 [ 35.087002] tun_free_netdev+0x105/0x1b0 [ 35.087549] ? tun_xdp+0x410/0x410 [ 35.088031] ? cpumask_next+0x24/0x30 [ 35.088558] ? netdev_refcnt_read+0xed/0x150 [ 35.089152] ? tun_xdp+0x410/0x410 [ 35.089635] netdev_run_todo+0x870/0xca0 [ 35.093666] ? do_group_exit+0x149/0x400 [ 35.097701] ? register_netdev+0x30/0x30 [ 35.102319] ? lock_downgrade+0x990/0x990 [ 35.106439] ? trace_hardirqs_on+0xd/0x10 [ 35.110577] ? refcount_sub_and_test+0x115/0x1b0 [ 35.115304] ? refcount_inc+0x50/0x50 [ 35.119073] ? refcount_inc+0x50/0x50 [ 35.122849] ? sk_destruct+0x4c/0x80 [ 35.126532] ? __sk_free+0x5c/0x230 [ 35.130130] ? sk_free+0x2f/0x40 [ 35.133504] ? __tun_detach+0x176/0x1390 [ 35.137549] ? tun_attach+0xf90/0xf90 [ 35.141333] ? do_raw_spin_trylock+0x190/0x190 [ 35.145889] ? locks_remove_file+0x3fa/0x5a0 [ 35.150271] ? fcntl_setlk+0x10d0/0x10d0 [ 35.154307] ? __fsnotify_parent+0xb4/0x3a0 [ 35.158600] ? fsnotify+0x1af0/0x1af0 [ 35.162374] ? __tun_detach+0x1390/0x1390 [ 35.166492] ? __tun_detach+0x1390/0x1390 [ 35.170613] rtnl_unlock+0xe/0x10 [ 35.174036] tun_chr_close+0x49/0x60 [ 35.177721] __fput+0x333/0x7f0 [ 35.180977] ? fput+0x140/0x140 [ 35.184233] ? check_same_owner+0x320/0x320 [ 35.188525] ? _raw_spin_unlock_irq+0x27/0x70 [ 35.192995] ____fput+0x15/0x20 [ 35.196247] task_work_run+0x199/0x270 [ 35.200108] ? task_work_cancel+0x210/0x210 [ 35.204399] ? _raw_spin_unlock+0x22/0x30 [ 35.208515] ? switch_task_namespaces+0x87/0xc0 [ 35.213156] do_exit+0xa52/0x1b40 [ 35.216578] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 35.221567] ? check_noncircular+0x20/0x20 [ 35.225779] ? mm_update_next_owner+0x930/0x930 [ 35.230417] ? __pmd_alloc+0x4e0/0x4e0 [ 35.234283] ? find_held_lock+0x39/0x1d0 [ 35.238325] ? lock_downgrade+0x990/0x990 [ 35.242464] ? handle_mm_fault+0x410/0x8d0 [ 35.246665] ? down_read_trylock+0xdb/0x170 [ 35.250957] ? __handle_mm_fault+0x39c0/0x39c0 [ 35.255506] ? vmacache_find+0x61/0x270 [ 35.259456] ? up_read+0x1a/0x40 [ 35.262792] ? __do_page_fault+0x35b/0xb60 [ 35.266997] ? do_vfs_ioctl+0x492/0x1530 [ 35.271035] ? do_page_fault+0xee/0x720 [ 35.274980] ? __do_page_fault+0xb60/0xb60 [ 35.279182] ? putname+0xf3/0x130 [ 35.282610] do_group_exit+0x149/0x400 [ 35.286466] ? lockdep_sys_exit+0x47/0xf0 [ 35.290582] ? SyS_exit+0x30/0x30 [ 35.294006] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 35.298992] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 35.303721] SyS_exit_group+0x1d/0x20 [ 35.307492] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 35.312219] RIP: 0033:0x4436a8 [ 35.315377] RSP: 002b:00007ffff1f29098 EFLAGS: 00000246 ORIG_RAX: 00000000000000e7 [ 35.323059] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00000000004436a8 [ 35.330298] RDX: 0000000000000000 RSI: 000000000000003c RDI: 0000000000000000 [ 35.337537] RBP: 0000000000000082 R08: 00000000000000e7 R09: ffffffffffffffd0 [ 35.344777] R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000001 [ 35.352015] R13: 00000000006d6180 R14: 0000000000000000 R15: 0000000000000000 [ 35.359271] [ 35.360868] Allocated by task 2987: [ 35.364464] save_stack_trace+0x16/0x20 [ 35.368408] save_stack+0x43/0xd0 [ 35.371828] kasan_kmalloc+0xad/0xe0 [ 35.375510] __kmalloc_node+0x47/0x70 [ 35.379281] kvmalloc_node+0x64/0xd0 [ 35.382965] alloc_netdev_mqs+0x16e/0xed0 [ 35.387096] __tun_chr_ioctl+0x12be/0x3d20 [ 35.391297] tun_chr_ioctl+0x2a/0x40 [ 35.394981] do_vfs_ioctl+0x1b1/0x1530 [ 35.398838] SyS_ioctl+0x8f/0xc0 [ 35.402172] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 35.406895] [ 35.408489] Freed by task 2987: [ 35.411735] save_stack_trace+0x16/0x20 [ 35.415680] save_stack+0x43/0xd0 [ 35.419102] kasan_slab_free+0x71/0xc0 [ 35.422959] kfree+0xca/0x250 [ 35.426034] kvfree+0x36/0x60 [ 35.429113] free_netdev+0x2cf/0x360 [ 35.432794] __tun_chr_ioctl+0x2cf6/0x3d20 [ 35.436996] tun_chr_ioctl+0x2a/0x40 [ 35.440678] do_vfs_ioctl+0x1b1/0x1530 [ 35.444533] SyS_ioctl+0x8f/0xc0 [ 35.447874] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 35.452607] [ 35.454214] The buggy address belongs to the object at ffff8801ce5b0380 [ 35.454214] which belongs to the cache kmalloc-16384 of size 16384 [ 35.467186] The buggy address is located 13312 bytes inside of [ 35.467186] 16384-byte region [ffff8801ce5b0380, ffff8801ce5b4380) [ 35.479382] The buggy address belongs to the page: [ 35.484280] page:ffffea0007396c00 count:1 mapcount:0 mapping:ffff8801ce5b0380 index:0x0 compound_mapcount: 0 [ 35.494224] flags: 0x200000000008100(slab|head) [ 35.498862] raw: 0200000000008100 ffff8801ce5b0380 0000000000000000 0000000100000001 [ 35.506714] raw: ffffea0007396a20 ffff8801dac01c50 ffff8801dac02200 0000000000000000 [ 35.514560] page dumped because: kasan: bad access detected [ 35.520235] [ 35.521830] Memory state around the buggy address: [ 35.526728] ffff8801ce5b3680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 35.534061] ffff8801ce5b3700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 35.541531] >ffff8801ce5b3780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 35.548875] ^ [ 35.552214] ffff8801ce5b3800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 35.559541] ffff8801ce5b3880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 35.566865] ================================================================== [ 35.574192] Disabling lock debugging due to kernel taint [ 35.579610] Kernel panic - not syncing: panic_on_warn set ... [ 35.579610] [ 35.586938] CPU: 1 PID: 2987 Comm: syzkaller627290 Tainted: G B 4.13.0-next-20170908+ #18 [ 35.596343] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 35.605659] Call Trace: [ 35.608215] dump_stack+0x194/0x257 [ 35.611808] ? arch_local_irq_restore+0x53/0x53 [ 35.616440] ? vprintk_default+0x28/0x30 [ 35.620467] ? detach_if_pending+0x4c0/0x610 [ 35.624843] panic+0x1e4/0x417 [ 35.627998] ? __warn+0x1d9/0x1d9 [ 35.631423] ? detach_if_pending+0x557/0x610 [ 35.635793] kasan_end_report+0x50/0x50 [ 35.639730] kasan_report+0x137/0x340 [ 35.643495] __asan_report_store8_noabort+0x17/0x20 [ 35.648474] detach_if_pending+0x557/0x610 [ 35.652673] ? trace_raw_output_tick_stop+0x130/0x130 [ 35.657828] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 35.662462] ? lock_timer_base+0x1a3/0x2b0 [ 35.666660] ? lock_timer_base+0x1eb/0x2b0 [ 35.670863] ? __internal_add_timer+0x2d0/0x2d0 [ 35.675498] ? trace_hardirqs_on+0xd/0x10 [ 35.679611] try_to_del_timer_sync+0xa2/0x120 [ 35.684069] ? del_timer+0x130/0x130 [ 35.687746] ? del_timer_sync+0xeb/0x240 [ 35.691773] del_timer_sync+0x18a/0x240 [ 35.695715] tun_free_netdev+0x105/0x1b0 [ 35.699737] ? tun_xdp+0x410/0x410 [ 35.703240] ? cpumask_next+0x24/0x30 [ 35.707005] ? netdev_refcnt_read+0xed/0x150 [ 35.711377] ? tun_xdp+0x410/0x410 [ 35.714882] netdev_run_todo+0x870/0xca0 [ 35.718908] ? do_group_exit+0x149/0x400 [ 35.722935] ? register_netdev+0x30/0x30 [ 35.726963] ? lock_downgrade+0x990/0x990 [ 35.731073] ? trace_hardirqs_on+0xd/0x10 [ 35.735193] ? refcount_sub_and_test+0x115/0x1b0 [ 35.739915] ? refcount_inc+0x50/0x50 [ 35.743677] ? refcount_inc+0x50/0x50 [ 35.747445] ? sk_destruct+0x4c/0x80 [ 35.751124] ? __sk_free+0x5c/0x230 [ 35.754713] ? sk_free+0x2f/0x40 [ 35.758041] ? __tun_detach+0x176/0x1390 [ 35.762069] ? tun_attach+0xf90/0xf90 [ 35.765835] ? do_raw_spin_trylock+0x190/0x190 [ 35.770382] ? locks_remove_file+0x3fa/0x5a0 [ 35.774757] ? fcntl_setlk+0x10d0/0x10d0 [ 35.778783] ? __fsnotify_parent+0xb4/0x3a0 [ 35.783070] ? fsnotify+0x1af0/0x1af0 [ 35.786834] ? __tun_detach+0x1390/0x1390 [ 35.790958] ? __tun_detach+0x1390/0x1390 [ 35.795070] rtnl_unlock+0xe/0x10 [ 35.798486] tun_chr_close+0x49/0x60 [ 35.802164] __fput+0x333/0x7f0 [ 35.805408] ? fput+0x140/0x140 [ 35.808651] ? check_same_owner+0x320/0x320 [ 35.812935] ? _raw_spin_unlock_irq+0x27/0x70 [ 35.817396] ____fput+0x15/0x20 [ 35.820640] task_work_run+0x199/0x270 [ 35.824494] ? task_work_cancel+0x210/0x210 [ 35.828780] ? _raw_spin_unlock+0x22/0x30 [ 35.832893] ? switch_task_namespaces+0x87/0xc0 [ 35.837526] do_exit+0xa52/0x1b40 [ 35.840942] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 35.845923] ? check_noncircular+0x20/0x20 [ 35.850127] ? mm_update_next_owner+0x930/0x930 [ 35.854759] ? __pmd_alloc+0x4e0/0x4e0 [ 35.858612] ? find_held_lock+0x39/0x1d0 [ 35.862642] ? lock_downgrade+0x990/0x990 [ 35.866762] ? handle_mm_fault+0x410/0x8d0 [ 35.870959] ? down_read_trylock+0xdb/0x170 [ 35.875245] ? __handle_mm_fault+0x39c0/0x39c0 [ 35.879792] ? vmacache_find+0x61/0x270 [ 35.883732] ? up_read+0x1a/0x40 [ 35.887061] ? __do_page_fault+0x35b/0xb60 [ 35.891257] ? do_vfs_ioctl+0x492/0x1530 [ 35.895287] ? do_page_fault+0xee/0x720 [ 35.899226] ? __do_page_fault+0xb60/0xb60 [ 35.903422] ? putname+0xf3/0x130 [ 35.906843] do_group_exit+0x149/0x400 [ 35.910693] ? lockdep_sys_exit+0x47/0xf0 [ 35.914802] ? SyS_exit+0x30/0x30 [ 35.918218] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 35.923200] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 35.927921] SyS_exit_group+0x1d/0x20 [ 35.931688] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 35.936405] RIP: 0033:0x4436a8 [ 35.939558] RSP: 002b:00007ffff1f29098 EFLAGS: 00000246 ORIG_RAX: 00000000000000e7 [ 35.947228] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00000000004436a8 [ 35.954463] RDX: 0000000000000000 RSI: 000000000000003c RDI: 0000000000000000 [ 35.961695] RBP: 0000000000000082 R08: 00000000000000e7 R09: ffffffffffffffd0 [ 35.968930] R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000001 [ 35.976165] R13: 00000000006d6180 R14: 0000000000000000 R15: 0000000000000000