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-mmots-kasan-gce-8,10.128.0.44' (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: [ 40.278320] ================================================================== [ 40.285752] BUG: KASAN: use-after-free in detach_if_pending+0x557/0x610 [ 40.292485] Write of size 8 at addr ffff8801ce763740 by task syzkaller721229/2982 [ 40.300083] [ 40.301694] CPU: 0 PID: 2982 Comm: syzkaller721229 Not tainted 4.13.0-mm1+ #7 [ 40.308942] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 40.318267] Call Trace: [ 40.320830] dump_stack+0x194/0x257 [ 40.324433] ? arch_local_irq_restore+0x53/0x53 [ 40.329076] ? show_regs_print_info+0x65/0x65 [ 40.333548] ? lock_timer_base+0x1a3/0x2b0 [ 40.337758] ? detach_if_pending+0x557/0x610 [ 40.342141] print_address_description+0x73/0x250 [ 40.346956] ? detach_if_pending+0x557/0x610 [ 40.351335] kasan_report+0x24e/0x340 [ 40.355110] __asan_report_store8_noabort+0x17/0x20 [ 40.360095] detach_if_pending+0x557/0x610 [ 40.364304] ? trace_raw_output_tick_stop+0x130/0x130 [ 40.369466] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 40.374104] ? lock_timer_base+0x1a3/0x2b0 [ 40.378311] ? lock_timer_base+0x1eb/0x2b0 [ 40.382526] ? __internal_add_timer+0x2d0/0x2d0 [ 40.387173] ? trace_hardirqs_on+0xd/0x10 [ 40.391311] try_to_del_timer_sync+0xa2/0x120 [ 40.395778] ? del_timer+0x130/0x130 [ 40.399464] ? del_timer_sync+0xeb/0x240 [ 40.403501] del_timer_sync+0x18a/0x240 [ 40.407453] tun_free_netdev+0x105/0x1b0 [ 40.411490] ? tun_xdp+0x410/0x410 [ 40.415006] ? cpumask_next+0x24/0x30 [ 40.418781] ? netdev_refcnt_read+0xed/0x150 [ 40.423163] ? tun_xdp+0x410/0x410 [ 40.426675] netdev_run_todo+0x870/0xca0 [ 40.430707] ? do_group_exit+0x149/0x400 [ 40.434744] ? register_netdev+0x30/0x30 [ 40.438786] ? lock_downgrade+0x990/0x990 [ 40.442904] ? trace_hardirqs_on+0xd/0x10 [ 40.447040] ? refcount_sub_and_test+0x115/0x1b0 [ 40.451767] ? refcount_inc+0x50/0x50 [ 40.455539] ? refcount_inc+0x50/0x50 [ 40.459314] ? sk_destruct+0x4c/0x80 [ 40.462996] ? __sk_free+0x5c/0x230 [ 40.466596] ? sk_free+0x2f/0x40 [ 40.469931] ? __tun_detach+0x176/0x1390 [ 40.473975] ? tun_attach+0xf90/0xf90 [ 40.477752] ? do_raw_spin_trylock+0x190/0x190 [ 40.482305] ? locks_remove_file+0x3fa/0x5a0 [ 40.486688] ? fcntl_setlk+0x10d0/0x10d0 [ 40.490721] ? __fsnotify_parent+0xb4/0x3a0 [ 40.495024] ? fsnotify+0x1af0/0x1af0 [ 40.498798] ? __tun_detach+0x1390/0x1390 [ 40.502916] ? __tun_detach+0x1390/0x1390 [ 40.507035] rtnl_unlock+0xe/0x10 [ 40.510456] tun_chr_close+0x49/0x60 [ 40.514139] __fput+0x333/0x7f0 [ 40.517395] ? fput+0x140/0x140 [ 40.520648] ? check_same_owner+0x320/0x320 [ 40.524937] ? _raw_spin_unlock_irq+0x27/0x70 [ 40.529408] ____fput+0x15/0x20 [ 40.532659] task_work_run+0x199/0x270 [ 40.536526] ? task_work_cancel+0x210/0x210 [ 40.540820] ? _raw_spin_unlock+0x22/0x30 [ 40.544937] ? switch_task_namespaces+0x87/0xc0 [ 40.549583] do_exit+0xa52/0x1b40 [ 40.553008] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 40.557997] ? check_noncircular+0x20/0x20 [ 40.562210] ? mm_update_next_owner+0x930/0x930 [ 40.566850] ? __pmd_alloc+0x4e0/0x4e0 [ 40.570718] ? find_held_lock+0x39/0x1d0 [ 40.574759] ? lock_downgrade+0x990/0x990 [ 40.578896] ? handle_mm_fault+0x410/0x8d0 [ 40.583099] ? down_read_trylock+0xdb/0x170 [ 40.587396] ? __handle_mm_fault+0x39c0/0x39c0 [ 40.591947] ? vmacache_find+0x61/0x270 [ 40.595898] ? up_read+0x1a/0x40 [ 40.599236] ? __do_page_fault+0x35b/0xb60 [ 40.603439] ? do_vfs_ioctl+0x492/0x1530 [ 40.607479] ? do_page_fault+0xee/0x720 [ 40.611427] ? __do_page_fault+0xb60/0xb60 [ 40.615635] ? putname+0xf3/0x130 [ 40.619064] do_group_exit+0x149/0x400 [ 40.622924] ? lockdep_sys_exit+0x47/0xf0 [ 40.627041] ? SyS_exit+0x30/0x30 [ 40.630467] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 40.635456] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 40.640186] SyS_exit_group+0x1d/0x20 [ 40.643959] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 40.648688] RIP: 0033:0x443618 [ 40.651848] RSP: 002b:00007fff7f928ad8 EFLAGS: 00000246 ORIG_RAX: 00000000000000e7 [ 40.659531] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 0000000000443618 [ 40.666770] RDX: 0000000000000000 RSI: 000000000000003c RDI: 0000000000000000 [ 40.674009] RBP: 0000000000000082 R08: 00000000000000e7 R09: ffffffffffffffd0 [ 40.681249] R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000001 [ 40.688495] R13: 00000000006d6180 R14: 0000000000000000 R15: 0000000000000000 [ 40.695752] [ 40.697350] Allocated by task 2982: [ 40.700948] save_stack_trace+0x16/0x20 [ 40.704892] save_stack+0x43/0xd0 [ 40.708312] kasan_kmalloc+0xad/0xe0 [ 40.712004] __kmalloc_node+0x47/0x70 [ 40.715773] kvmalloc_node+0x64/0xd0 [ 40.719457] alloc_netdev_mqs+0x16e/0xed0 [ 40.723574] __tun_chr_ioctl+0x12be/0x3d20 [ 40.727775] tun_chr_ioctl+0x2a/0x40 [ 40.731459] do_vfs_ioctl+0x1b1/0x1530 [ 40.735322] SyS_ioctl+0x8f/0xc0 [ 40.738659] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 40.743386] [ 40.744982] Freed by task 2982: [ 40.748229] save_stack_trace+0x16/0x20 [ 40.752181] save_stack+0x43/0xd0 [ 40.755602] kasan_slab_free+0x71/0xc0 [ 40.759458] kfree+0xca/0x250 [ 40.762534] kvfree+0x36/0x60 [ 40.765611] free_netdev+0x2cf/0x360 [ 40.769293] __tun_chr_ioctl+0x2cf6/0x3d20 [ 40.773498] tun_chr_ioctl+0x2a/0x40 [ 40.777180] do_vfs_ioctl+0x1b1/0x1530 [ 40.781033] SyS_ioctl+0x8f/0xc0 [ 40.784368] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 40.789088] [ 40.790687] The buggy address belongs to the object at ffff8801ce760340 [ 40.790687] which belongs to the cache kmalloc-16384 of size 16384 [ 40.803658] The buggy address is located 13312 bytes inside of [ 40.803658] 16384-byte region [ffff8801ce760340, ffff8801ce764340) [ 40.815855] The buggy address belongs to the page: [ 40.820754] page:ffffea000739d800 count:1 mapcount:0 mapping:ffff8801ce760340 index:0x0 compound_mapcount: 0 [ 40.830698] flags: 0x200000000008100(slab|head) [ 40.835337] raw: 0200000000008100 ffff8801ce760340 0000000000000000 0000000100000001 [ 40.843187] raw: ffffea00075ace20 ffff8801dac01c50 ffff8801dac02200 0000000000000000 [ 40.851034] page dumped because: kasan: bad access detected [ 40.856724] [ 40.858324] Memory state around the buggy address: [ 40.863221] ffff8801ce763600: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 40.870550] ffff8801ce763680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 40.877877] >ffff8801ce763700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 40.885213] ^ [ 40.890642] ffff8801ce763780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 40.897967] ffff8801ce763800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 40.905303] ================================================================== [ 40.912631] Disabling lock debugging due to kernel taint [ 40.918043] Kernel panic - not syncing: panic_on_warn set ... [ 40.918043] [ 40.925369] CPU: 0 PID: 2982 Comm: syzkaller721229 Tainted: G B 4.13.0-mm1+ #7 [ 40.933818] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 40.943140] Call Trace: [ 40.945705] dump_stack+0x194/0x257 [ 40.949302] ? arch_local_irq_restore+0x53/0x53 [ 40.953936] ? vprintk_default+0x28/0x30 [ 40.957962] ? detach_if_pending+0x550/0x610 [ 40.962334] panic+0x1e4/0x417 [ 40.965490] ? __warn+0x1d9/0x1d9 [ 40.968912] ? detach_if_pending+0x557/0x610 [ 40.973284] kasan_end_report+0x50/0x50 [ 40.977231] kasan_report+0x137/0x340 [ 40.980997] __asan_report_store8_noabort+0x17/0x20 [ 40.985976] detach_if_pending+0x557/0x610 [ 40.990177] ? trace_raw_output_tick_stop+0x130/0x130 [ 40.995337] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 40.999974] ? lock_timer_base+0x1a3/0x2b0 [ 41.004171] ? lock_timer_base+0x1eb/0x2b0 [ 41.008371] ? __internal_add_timer+0x2d0/0x2d0 [ 41.013011] ? trace_hardirqs_on+0xd/0x10 [ 41.017126] try_to_del_timer_sync+0xa2/0x120 [ 41.021594] ? del_timer+0x130/0x130 [ 41.025272] ? del_timer_sync+0xeb/0x240 [ 41.029299] del_timer_sync+0x18a/0x240 [ 41.033239] tun_free_netdev+0x105/0x1b0 [ 41.037262] ? tun_xdp+0x410/0x410 [ 41.040766] ? cpumask_next+0x24/0x30 [ 41.044532] ? netdev_refcnt_read+0xed/0x150 [ 41.048905] ? tun_xdp+0x410/0x410 [ 41.052408] netdev_run_todo+0x870/0xca0 [ 41.056430] ? do_group_exit+0x149/0x400 [ 41.060460] ? register_netdev+0x30/0x30 [ 41.064489] ? lock_downgrade+0x990/0x990 [ 41.068600] ? trace_hardirqs_on+0xd/0x10 [ 41.072721] ? refcount_sub_and_test+0x115/0x1b0 [ 41.077440] ? refcount_inc+0x50/0x50 [ 41.081207] ? refcount_inc+0x50/0x50 [ 41.084973] ? sk_destruct+0x4c/0x80 [ 41.088649] ? __sk_free+0x5c/0x230 [ 41.092238] ? sk_free+0x2f/0x40 [ 41.095569] ? __tun_detach+0x176/0x1390 [ 41.099600] ? tun_attach+0xf90/0xf90 [ 41.103377] ? do_raw_spin_trylock+0x190/0x190 [ 41.107938] ? locks_remove_file+0x3fa/0x5a0 [ 41.112323] ? fcntl_setlk+0x10d0/0x10d0 [ 41.116351] ? __fsnotify_parent+0xb4/0x3a0 [ 41.120636] ? fsnotify+0x1af0/0x1af0 [ 41.124401] ? __tun_detach+0x1390/0x1390 [ 41.128513] ? __tun_detach+0x1390/0x1390 [ 41.132627] rtnl_unlock+0xe/0x10 [ 41.136045] tun_chr_close+0x49/0x60 [ 41.139723] __fput+0x333/0x7f0 [ 41.142970] ? fput+0x140/0x140 [ 41.146213] ? check_same_owner+0x320/0x320 [ 41.150499] ? _raw_spin_unlock_irq+0x27/0x70 [ 41.154959] ____fput+0x15/0x20 [ 41.158203] task_work_run+0x199/0x270 [ 41.162056] ? task_work_cancel+0x210/0x210 [ 41.166341] ? _raw_spin_unlock+0x22/0x30 [ 41.170459] ? switch_task_namespaces+0x87/0xc0 [ 41.175093] do_exit+0xa52/0x1b40 [ 41.178510] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 41.183494] ? check_noncircular+0x20/0x20 [ 41.187700] ? mm_update_next_owner+0x930/0x930 [ 41.192334] ? __pmd_alloc+0x4e0/0x4e0 [ 41.196198] ? find_held_lock+0x39/0x1d0 [ 41.200236] ? lock_downgrade+0x990/0x990 [ 41.204358] ? handle_mm_fault+0x410/0x8d0 [ 41.208556] ? down_read_trylock+0xdb/0x170 [ 41.212841] ? __handle_mm_fault+0x39c0/0x39c0 [ 41.217392] ? vmacache_find+0x61/0x270 [ 41.221345] ? up_read+0x1a/0x40 [ 41.224682] ? __do_page_fault+0x35b/0xb60 [ 41.228879] ? do_vfs_ioctl+0x492/0x1530 [ 41.232910] ? do_page_fault+0xee/0x720 [ 41.236847] ? __do_page_fault+0xb60/0xb60 [ 41.241043] ? putname+0xf3/0x130 [ 41.244462] do_group_exit+0x149/0x400 [ 41.248322] ? lockdep_sys_exit+0x47/0xf0 [ 41.252435] ? SyS_exit+0x30/0x30 [ 41.255853] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 41.260836] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 41.265557] SyS_exit_group+0x1d/0x20 [ 41.269321] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 41.274039] RIP: 0033:0x443618