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-9,10.128.15.215' (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: [ 38.390301] ================================================================== [ 38.391503] BUG: KASAN: use-after-free in detach_if_pending+0x557/0x610 [ 38.392407] Write of size 8 at addr ffff8801ce66b7c0 by task syzkaller372728/2985 [ 38.393442] [ 38.393680] CPU: 0 PID: 2985 Comm: syzkaller372728 Not tainted 4.13.0-next-20170908+ #18 [ 38.394760] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 38.396000] Call Trace: [ 38.396374] dump_stack+0x194/0x257 [ 38.396870] ? arch_local_irq_restore+0x53/0x53 [ 38.397496] ? show_regs_print_info+0x65/0x65 [ 38.398102] ? lock_timer_base+0x1a3/0x2b0 [ 38.398686] ? detach_if_pending+0x557/0x610 [ 38.399281] print_address_description+0x73/0x250 [ 38.399929] ? detach_if_pending+0x557/0x610 [ 38.400524] kasan_report+0x24e/0x340 [ 38.401044] __asan_report_store8_noabort+0x17/0x20 [ 38.401714] detach_if_pending+0x557/0x610 [ 38.402300] ? trace_raw_output_tick_stop+0x130/0x130 [ 38.402995] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 38.403619] ? lock_timer_base+0x1a3/0x2b0 [ 38.404271] ? lock_timer_base+0x1eb/0x2b0 [ 38.404845] ? __internal_add_timer+0x2d0/0x2d0 [ 38.405474] ? trace_hardirqs_on+0xd/0x10 [ 38.406042] try_to_del_timer_sync+0xa2/0x120 [ 38.406668] ? del_timer+0x130/0x130 [ 38.407190] ? del_timer_sync+0xeb/0x240 [ 38.407744] del_timer_sync+0x18a/0x240 [ 38.408322] tun_free_netdev+0x105/0x1b0 [ 38.408871] ? tun_xdp+0x410/0x410 [ 38.409368] ? cpumask_next+0x24/0x30 [ 38.409907] ? netdev_refcnt_read+0xed/0x150 [ 38.410695] ? tun_xdp+0x410/0x410 [ 38.414208] netdev_run_todo+0x870/0xca0 [ 38.418244] ? do_group_exit+0x149/0x400 [ 38.422287] ? register_netdev+0x30/0x30 [ 38.426335] ? lock_downgrade+0x990/0x990 [ 38.430456] ? trace_hardirqs_on+0xd/0x10 [ 38.434595] ? refcount_sub_and_test+0x115/0x1b0 [ 38.439325] ? refcount_inc+0x50/0x50 [ 38.443193] ? refcount_inc+0x50/0x50 [ 38.446984] ? sk_destruct+0x4c/0x80 [ 38.450679] ? __sk_free+0x5c/0x230 [ 38.454289] ? sk_free+0x2f/0x40 [ 38.457628] ? __tun_detach+0x176/0x1390 [ 38.461672] ? tun_attach+0xf90/0xf90 [ 38.465449] ? do_raw_spin_trylock+0x190/0x190 [ 38.470005] ? locks_remove_file+0x3fa/0x5a0 [ 38.474396] ? fcntl_setlk+0x10d0/0x10d0 [ 38.478431] ? __fsnotify_parent+0xb4/0x3a0 [ 38.482727] ? fsnotify+0x1af0/0x1af0 [ 38.486501] ? __tun_detach+0x1390/0x1390 [ 38.490621] ? __tun_detach+0x1390/0x1390 [ 38.494742] rtnl_unlock+0xe/0x10 [ 38.498178] tun_chr_close+0x49/0x60 [ 38.501864] __fput+0x333/0x7f0 [ 38.505124] ? fput+0x140/0x140 [ 38.508377] ? check_same_owner+0x320/0x320 [ 38.512669] ? _raw_spin_unlock_irq+0x27/0x70 [ 38.517142] ____fput+0x15/0x20 [ 38.520394] task_work_run+0x199/0x270 [ 38.524257] ? task_work_cancel+0x210/0x210 [ 38.528551] ? _raw_spin_unlock+0x22/0x30 [ 38.532680] ? switch_task_namespaces+0x87/0xc0 [ 38.537335] do_exit+0xa52/0x1b40 [ 38.540759] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 38.545757] ? check_noncircular+0x20/0x20 [ 38.549970] ? mm_update_next_owner+0x930/0x930 [ 38.554611] ? __pmd_alloc+0x4e0/0x4e0 [ 38.558477] ? find_held_lock+0x39/0x1d0 [ 38.562518] ? lock_downgrade+0x990/0x990 [ 38.566658] ? handle_mm_fault+0x410/0x8d0 [ 38.570863] ? down_read_trylock+0xdb/0x170 [ 38.575167] ? __handle_mm_fault+0x39c0/0x39c0 [ 38.579721] ? vmacache_find+0x61/0x270 [ 38.583684] ? up_read+0x1a/0x40 [ 38.587023] ? __do_page_fault+0x35b/0xb60 [ 38.591237] ? do_vfs_ioctl+0x492/0x1530 [ 38.595277] ? do_page_fault+0xee/0x720 [ 38.599233] ? __do_page_fault+0xb60/0xb60 [ 38.603438] ? putname+0xf3/0x130 [ 38.606867] do_group_exit+0x149/0x400 [ 38.610724] ? lockdep_sys_exit+0x47/0xf0 [ 38.614847] ? SyS_exit+0x30/0x30 [ 38.618286] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 38.623286] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 38.628017] SyS_exit_group+0x1d/0x20 [ 38.631800] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 38.636526] RIP: 0033:0x4435f8 [ 38.639695] RSP: 002b:00007ffc031a7ef8 EFLAGS: 00000246 ORIG_RAX: 00000000000000e7 [ 38.647384] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00000000004435f8 [ 38.654626] RDX: 0000000000000000 RSI: 000000000000003c RDI: 0000000000000000 [ 38.661867] RBP: 0000000000000082 R08: 00000000000000e7 R09: ffffffffffffffd0 [ 38.669118] R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000001 [ 38.676358] R13: 00000000006d6180 R14: 0000000000000000 R15: 0000000000000000 [ 38.683614] [ 38.685212] Allocated by task 2985: [ 38.688809] save_stack_trace+0x16/0x20 [ 38.692753] save_stack+0x43/0xd0 [ 38.696176] kasan_kmalloc+0xad/0xe0 [ 38.699859] __kmalloc_node+0x47/0x70 [ 38.703638] kvmalloc_node+0x64/0xd0 [ 38.707322] alloc_netdev_mqs+0x16e/0xed0 [ 38.711446] __tun_chr_ioctl+0x12be/0x3d20 [ 38.715660] tun_chr_ioctl+0x2a/0x40 [ 38.719343] do_vfs_ioctl+0x1b1/0x1530 [ 38.723200] SyS_ioctl+0x8f/0xc0 [ 38.726534] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 38.731258] [ 38.732854] Freed by task 2985: [ 38.736103] save_stack_trace+0x16/0x20 [ 38.740044] save_stack+0x43/0xd0 [ 38.743466] kasan_slab_free+0x71/0xc0 [ 38.747322] kfree+0xca/0x250 [ 38.750407] kvfree+0x36/0x60 [ 38.753480] free_netdev+0x2cf/0x360 [ 38.757163] __tun_chr_ioctl+0x2cf6/0x3d20 [ 38.761368] tun_chr_ioctl+0x2a/0x40 [ 38.765052] do_vfs_ioctl+0x1b1/0x1530 [ 38.768906] SyS_ioctl+0x8f/0xc0 [ 38.772416] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 38.777139] [ 38.778736] The buggy address belongs to the object at ffff8801ce6683c0 [ 38.778736] which belongs to the cache kmalloc-16384 of size 16384 [ 38.791717] The buggy address is located 13312 bytes inside of [ 38.791717] 16384-byte region [ffff8801ce6683c0, ffff8801ce66c3c0) [ 38.803906] The buggy address belongs to the page: [ 38.808803] page:ffffea0007399a00 count:1 mapcount:0 mapping:ffff8801ce6683c0 index:0x0 compound_mapcount: 0 [ 38.818745] flags: 0x200000000008100(slab|head) [ 38.823386] raw: 0200000000008100 ffff8801ce6683c0 0000000000000000 0000000100000001 [ 38.831235] raw: ffffea0007358820 ffff8801dac01c50 ffff8801dac02200 0000000000000000 [ 38.839084] page dumped because: kasan: bad access detected [ 38.844760] [ 38.846356] Memory state around the buggy address: [ 38.851255] ffff8801ce66b680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 38.858581] ffff8801ce66b700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 38.865909] >ffff8801ce66b780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 38.873250] ^ [ 38.878670] ffff8801ce66b800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 38.885997] ffff8801ce66b880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 38.893322] ================================================================== [ 38.900647] Disabling lock debugging due to kernel taint [ 38.906060] Kernel panic - not syncing: panic_on_warn set ... [ 38.906060] [ 38.913390] CPU: 0 PID: 2985 Comm: syzkaller372728 Tainted: G B 4.13.0-next-20170908+ #18 [ 38.922806] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 38.932220] Call Trace: [ 38.934777] dump_stack+0x194/0x257 [ 38.938379] ? arch_local_irq_restore+0x53/0x53 [ 38.943013] ? vprintk_default+0x28/0x30 [ 38.947041] ? detach_if_pending+0x4c0/0x610 [ 38.951417] panic+0x1e4/0x417 [ 38.954573] ? __warn+0x1d9/0x1d9 [ 38.957999] ? detach_if_pending+0x557/0x610 [ 38.962372] kasan_end_report+0x50/0x50 [ 38.966319] kasan_report+0x137/0x340 [ 38.970086] __asan_report_store8_noabort+0x17/0x20 [ 38.975067] detach_if_pending+0x557/0x610 [ 38.979270] ? trace_raw_output_tick_stop+0x130/0x130 [ 38.984423] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 38.989055] ? lock_timer_base+0x1a3/0x2b0 [ 38.993255] ? lock_timer_base+0x1eb/0x2b0 [ 38.997457] ? __internal_add_timer+0x2d0/0x2d0 [ 39.002094] ? trace_hardirqs_on+0xd/0x10 [ 39.006209] try_to_del_timer_sync+0xa2/0x120 [ 39.010678] ? del_timer+0x130/0x130 [ 39.014367] ? del_timer_sync+0xeb/0x240 [ 39.018394] del_timer_sync+0x18a/0x240 [ 39.022342] tun_free_netdev+0x105/0x1b0 [ 39.026366] ? tun_xdp+0x410/0x410 [ 39.029869] ? cpumask_next+0x24/0x30 [ 39.033635] ? netdev_refcnt_read+0xed/0x150 [ 39.038009] ? tun_xdp+0x410/0x410 [ 39.041515] netdev_run_todo+0x870/0xca0 [ 39.045540] ? do_group_exit+0x149/0x400 [ 39.049567] ? register_netdev+0x30/0x30 [ 39.053592] ? lock_downgrade+0x990/0x990 [ 39.057703] ? trace_hardirqs_on+0xd/0x10 [ 39.061825] ? refcount_sub_and_test+0x115/0x1b0 [ 39.066556] ? refcount_inc+0x50/0x50 [ 39.070319] ? refcount_inc+0x50/0x50 [ 39.074087] ? sk_destruct+0x4c/0x80 [ 39.077765] ? __sk_free+0x5c/0x230 [ 39.081356] ? sk_free+0x2f/0x40 [ 39.084685] ? __tun_detach+0x176/0x1390 [ 39.088726] ? tun_attach+0xf90/0xf90 [ 39.092493] ? do_raw_spin_trylock+0x190/0x190 [ 39.097042] ? locks_remove_file+0x3fa/0x5a0 [ 39.101417] ? fcntl_setlk+0x10d0/0x10d0 [ 39.105442] ? __fsnotify_parent+0xb4/0x3a0 [ 39.109729] ? fsnotify+0x1af0/0x1af0 [ 39.113495] ? __tun_detach+0x1390/0x1390 [ 39.117606] ? __tun_detach+0x1390/0x1390 [ 39.121718] rtnl_unlock+0xe/0x10 [ 39.125137] tun_chr_close+0x49/0x60 [ 39.128815] __fput+0x333/0x7f0 [ 39.132068] ? fput+0x140/0x140 [ 39.135313] ? check_same_owner+0x320/0x320 [ 39.139600] ? _raw_spin_unlock_irq+0x27/0x70 [ 39.144066] ____fput+0x15/0x20 [ 39.147319] task_work_run+0x199/0x270 [ 39.151173] ? task_work_cancel+0x210/0x210 [ 39.155458] ? _raw_spin_unlock+0x22/0x30 [ 39.159570] ? switch_task_namespaces+0x87/0xc0 [ 39.164204] do_exit+0xa52/0x1b40 [ 39.167622] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 39.172612] ? check_noncircular+0x20/0x20 [ 39.176827] ? mm_update_next_owner+0x930/0x930 [ 39.181473] ? __pmd_alloc+0x4e0/0x4e0 [ 39.185329] ? find_held_lock+0x39/0x1d0 [ 39.189369] ? lock_downgrade+0x990/0x990 [ 39.193491] ? handle_mm_fault+0x410/0x8d0 [ 39.197688] ? down_read_trylock+0xdb/0x170 [ 39.201974] ? __handle_mm_fault+0x39c0/0x39c0 [ 39.206530] ? vmacache_find+0x61/0x270 [ 39.210471] ? up_read+0x1a/0x40 [ 39.213802] ? __do_page_fault+0x35b/0xb60 [ 39.218002] ? do_vfs_ioctl+0x492/0x1530 [ 39.222033] ? do_page_fault+0xee/0x720 [ 39.225987] ? __do_page_fault+0xb60/0xb60 [ 39.230186] ? putname+0xf3/0x130 [ 39.233605] do_group_exit+0x149/0x400 [ 39.237457] ? lockdep_sys_exit+0x47/0xf0 [ 39.241574] ? SyS_exit+0x30/0x30 [ 39.244995] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 39.249979] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 39.254703] SyS_exit_group+0x1d/0x20 [ 39.258472] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 39.263192] RIP: 0033:0x4435f8 [ 39.266349] RSP: 002b:00007ffc031a7ef8 EFLAGS: 00000246 ORIG_RAX: 00000000000000e7 [ 39.274032] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00000000004435f8 [ 39.281273] RDX: 0000000000000000 RSI: 000000000000003c RDI: 0000000000000000 [ 39.288507] RBP: 0000000000000082 R08: 00000000000000e7 R09: ffffffffffffffd0 [ 39.295827] R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000001 [ 39.303063] R13: 00000000006d6180 R14: 0000000000000000 R15: 0000000000000000