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-0,10.128.0.58' (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: [ 34.092399] ================================================================== [ 34.099811] BUG: KASAN: use-after-free in detach_if_pending+0x557/0x610 [ 34.106534] Write of size 8 at addr ffff8801cd62b740 by task syzkaller925605/2982 [ 34.114121] [ 34.115722] CPU: 1 PID: 2982 Comm: syzkaller925605 Not tainted 4.13.0-mm1+ #7 [ 34.122960] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 34.132283] Call Trace: [ 34.134840] dump_stack+0x194/0x257 [ 34.138439] ? arch_local_irq_restore+0x53/0x53 [ 34.143079] ? show_regs_print_info+0x65/0x65 [ 34.147545] ? lock_timer_base+0x1a3/0x2b0 [ 34.151750] ? detach_if_pending+0x557/0x610 [ 34.156130] print_address_description+0x73/0x250 [ 34.160942] ? detach_if_pending+0x557/0x610 [ 34.165321] kasan_report+0x24e/0x340 [ 34.169096] __asan_report_store8_noabort+0x17/0x20 [ 34.174083] detach_if_pending+0x557/0x610 [ 34.178288] ? trace_raw_output_tick_stop+0x130/0x130 [ 34.183454] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 34.188089] ? lock_timer_base+0x1a3/0x2b0 [ 34.192297] ? lock_timer_base+0x1eb/0x2b0 [ 34.196504] ? __internal_add_timer+0x2d0/0x2d0 [ 34.201143] ? trace_hardirqs_on+0xd/0x10 [ 34.205267] try_to_del_timer_sync+0xa2/0x120 [ 34.209730] ? del_timer+0x130/0x130 [ 34.213425] ? del_timer_sync+0xeb/0x240 [ 34.217462] del_timer_sync+0x18a/0x240 [ 34.221411] tun_free_netdev+0x105/0x1b0 [ 34.225441] ? tun_xdp+0x410/0x410 [ 34.228952] ? cpumask_next+0x24/0x30 [ 34.232728] ? netdev_refcnt_read+0xed/0x150 [ 34.237109] ? tun_xdp+0x410/0x410 [ 34.240621] netdev_run_todo+0x870/0xca0 [ 34.244649] ? do_group_exit+0x149/0x400 [ 34.248686] ? register_netdev+0x30/0x30 [ 34.252720] ? lock_downgrade+0x990/0x990 [ 34.256837] ? trace_hardirqs_on+0xd/0x10 [ 34.260973] ? refcount_sub_and_test+0x115/0x1b0 [ 34.265702] ? refcount_inc+0x50/0x50 [ 34.269471] ? refcount_inc+0x50/0x50 [ 34.273246] ? sk_destruct+0x4c/0x80 [ 34.276928] ? __sk_free+0x5c/0x230 [ 34.280524] ? sk_free+0x2f/0x40 [ 34.283858] ? __tun_detach+0x176/0x1390 [ 34.287897] ? tun_attach+0xf90/0xf90 [ 34.291673] ? do_raw_spin_trylock+0x190/0x190 [ 34.296228] ? locks_remove_file+0x3fa/0x5a0 [ 34.300609] ? fcntl_setlk+0x10d0/0x10d0 [ 34.304641] ? __fsnotify_parent+0xb4/0x3a0 [ 34.308932] ? fsnotify+0x1af0/0x1af0 [ 34.312706] ? __tun_detach+0x1390/0x1390 [ 34.316828] ? __tun_detach+0x1390/0x1390 [ 34.320958] rtnl_unlock+0xe/0x10 [ 34.324380] tun_chr_close+0x49/0x60 [ 34.328062] __fput+0x333/0x7f0 [ 34.331317] ? fput+0x140/0x140 [ 34.334572] ? check_same_owner+0x320/0x320 [ 34.338862] ? _raw_spin_unlock_irq+0x27/0x70 [ 34.343344] ____fput+0x15/0x20 [ 34.346595] task_work_run+0x199/0x270 [ 34.350457] ? task_work_cancel+0x210/0x210 [ 34.354747] ? _raw_spin_unlock+0x22/0x30 [ 34.358866] ? switch_task_namespaces+0x87/0xc0 [ 34.363510] do_exit+0xa52/0x1b40 [ 34.366934] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 34.371921] ? check_noncircular+0x20/0x20 [ 34.376138] ? mm_update_next_owner+0x930/0x930 [ 34.380775] ? __pmd_alloc+0x4e0/0x4e0 [ 34.384643] ? find_held_lock+0x39/0x1d0 [ 34.388683] ? lock_downgrade+0x990/0x990 [ 34.392821] ? handle_mm_fault+0x410/0x8d0 [ 34.397026] ? down_read_trylock+0xdb/0x170 [ 34.401318] ? __handle_mm_fault+0x39c0/0x39c0 [ 34.405870] ? vmacache_find+0x61/0x270 [ 34.409819] ? up_read+0x1a/0x40 [ 34.413159] ? __do_page_fault+0x35b/0xb60 [ 34.417368] ? do_vfs_ioctl+0x492/0x1530 [ 34.421407] ? do_page_fault+0xee/0x720 [ 34.425350] ? __do_page_fault+0xb60/0xb60 [ 34.429553] ? putname+0xf3/0x130 [ 34.432985] do_group_exit+0x149/0x400 [ 34.436843] ? lockdep_sys_exit+0x47/0xf0 [ 34.440958] ? SyS_exit+0x30/0x30 [ 34.444382] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 34.449370] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 34.454098] SyS_exit_group+0x1d/0x20 [ 34.457871] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 34.462594] RIP: 0033:0x4435e8 [ 34.465752] RSP: 002b:00007ffcc2139778 EFLAGS: 00000246 ORIG_RAX: 00000000000000e7 [ 34.473429] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00000000004435e8 [ 34.480667] RDX: 0000000000000000 RSI: 000000000000003c RDI: 0000000000000000 [ 34.487907] RBP: 0000000000000082 R08: 00000000000000e7 R09: ffffffffffffffd0 [ 34.495146] R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000001 [ 34.502384] R13: 00000000006d6180 R14: 0000000000000000 R15: 0000000000000000 [ 34.509639] [ 34.511237] Allocated by task 2982: [ 34.514831] save_stack_trace+0x16/0x20 [ 34.518776] save_stack+0x43/0xd0 [ 34.522283] kasan_kmalloc+0xad/0xe0 [ 34.525962] __kmalloc_node+0x47/0x70 [ 34.529730] kvmalloc_node+0x64/0xd0 [ 34.533412] alloc_netdev_mqs+0x16e/0xed0 [ 34.537527] __tun_chr_ioctl+0x12be/0x3d20 [ 34.541727] tun_chr_ioctl+0x2a/0x40 [ 34.545408] do_vfs_ioctl+0x1b1/0x1530 [ 34.549275] SyS_ioctl+0x8f/0xc0 [ 34.552608] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 34.557328] [ 34.558923] Freed by task 2982: [ 34.562172] save_stack_trace+0x16/0x20 [ 34.566123] save_stack+0x43/0xd0 [ 34.569542] kasan_slab_free+0x71/0xc0 [ 34.573406] kfree+0xca/0x250 [ 34.576480] kvfree+0x36/0x60 [ 34.579551] free_netdev+0x2cf/0x360 [ 34.583233] __tun_chr_ioctl+0x2cf6/0x3d20 [ 34.587436] tun_chr_ioctl+0x2a/0x40 [ 34.591115] do_vfs_ioctl+0x1b1/0x1530 [ 34.594969] SyS_ioctl+0x8f/0xc0 [ 34.598302] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 34.603025] [ 34.604625] The buggy address belongs to the object at ffff8801cd628340 [ 34.604625] which belongs to the cache kmalloc-16384 of size 16384 [ 34.617595] The buggy address is located 13312 bytes inside of [ 34.617595] 16384-byte region [ffff8801cd628340, ffff8801cd62c340) [ 34.629781] The buggy address belongs to the page: [ 34.634677] page:ffffea0007358a00 count:1 mapcount:0 mapping:ffff8801cd628340 index:0x0 compound_mapcount: 0 [ 34.644617] flags: 0x200000000008100(slab|head) [ 34.649255] raw: 0200000000008100 ffff8801cd628340 0000000000000000 0000000100000001 [ 34.657103] raw: ffffea00073fc220 ffff8801dac01c50 ffff8801dac02200 0000000000000000 [ 34.664947] page dumped because: kasan: bad access detected [ 34.670623] [ 34.672220] Memory state around the buggy address: [ 34.677117] ffff8801cd62b600: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 34.684443] ffff8801cd62b680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 34.691770] >ffff8801cd62b700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 34.699097] ^ [ 34.704513] ffff8801cd62b780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 34.711839] ffff8801cd62b800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 34.719163] ================================================================== [ 34.726486] Disabling lock debugging due to kernel taint [ 34.731900] Kernel panic - not syncing: panic_on_warn set ... [ 34.731900] [ 34.739226] CPU: 1 PID: 2982 Comm: syzkaller925605 Tainted: G B 4.13.0-mm1+ #7 [ 34.747674] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 34.756993] Call Trace: [ 34.759543] dump_stack+0x194/0x257 [ 34.763134] ? arch_local_irq_restore+0x53/0x53 [ 34.767766] ? vprintk_default+0x28/0x30 [ 34.771792] ? detach_if_pending+0x550/0x610 [ 34.776163] panic+0x1e4/0x417 [ 34.779321] ? __warn+0x1d9/0x1d9 [ 34.782741] ? detach_if_pending+0x557/0x610 [ 34.787114] kasan_end_report+0x50/0x50 [ 34.791052] kasan_report+0x137/0x340 [ 34.794819] __asan_report_store8_noabort+0x17/0x20 [ 34.799799] detach_if_pending+0x557/0x610 [ 34.803997] ? trace_raw_output_tick_stop+0x130/0x130 [ 34.809155] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 34.813787] ? lock_timer_base+0x1a3/0x2b0 [ 34.817985] ? lock_timer_base+0x1eb/0x2b0 [ 34.822183] ? __internal_add_timer+0x2d0/0x2d0 [ 34.826819] ? trace_hardirqs_on+0xd/0x10 [ 34.830935] try_to_del_timer_sync+0xa2/0x120 [ 34.835391] ? del_timer+0x130/0x130 [ 34.839070] ? del_timer_sync+0xeb/0x240 [ 34.843097] del_timer_sync+0x18a/0x240 [ 34.847037] tun_free_netdev+0x105/0x1b0 [ 34.851060] ? tun_xdp+0x410/0x410 [ 34.854563] ? cpumask_next+0x24/0x30 [ 34.858328] ? netdev_refcnt_read+0xed/0x150 [ 34.862702] ? tun_xdp+0x410/0x410 [ 34.866206] netdev_run_todo+0x870/0xca0 [ 34.870233] ? do_group_exit+0x149/0x400 [ 34.874259] ? register_netdev+0x30/0x30 [ 34.878283] ? lock_downgrade+0x990/0x990 [ 34.882394] ? trace_hardirqs_on+0xd/0x10 [ 34.886515] ? refcount_sub_and_test+0x115/0x1b0 [ 34.891232] ? refcount_inc+0x50/0x50 [ 34.894994] ? refcount_inc+0x50/0x50 [ 34.898759] ? sk_destruct+0x4c/0x80 [ 34.902437] ? __sk_free+0x5c/0x230 [ 34.906027] ? sk_free+0x2f/0x40 [ 34.909358] ? __tun_detach+0x176/0x1390 [ 34.913389] ? tun_attach+0xf90/0xf90 [ 34.917154] ? do_raw_spin_trylock+0x190/0x190 [ 34.921699] ? locks_remove_file+0x3fa/0x5a0 [ 34.926071] ? fcntl_setlk+0x10d0/0x10d0 [ 34.930098] ? __fsnotify_parent+0xb4/0x3a0 [ 34.934384] ? fsnotify+0x1af0/0x1af0 [ 34.938149] ? __tun_detach+0x1390/0x1390 [ 34.942258] ? __tun_detach+0x1390/0x1390 [ 34.946370] rtnl_unlock+0xe/0x10 [ 34.949786] tun_chr_close+0x49/0x60 [ 34.953465] __fput+0x333/0x7f0 [ 34.956708] ? fput+0x140/0x140 [ 34.959954] ? check_same_owner+0x320/0x320 [ 34.964238] ? _raw_spin_unlock_irq+0x27/0x70 [ 34.968699] ____fput+0x15/0x20 [ 34.971943] task_work_run+0x199/0x270 [ 34.975797] ? task_work_cancel+0x210/0x210 [ 34.980081] ? _raw_spin_unlock+0x22/0x30 [ 34.984195] ? switch_task_namespaces+0x87/0xc0 [ 34.988840] do_exit+0xa52/0x1b40 [ 34.992258] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 34.997238] ? check_noncircular+0x20/0x20 [ 35.001440] ? mm_update_next_owner+0x930/0x930 [ 35.006075] ? __pmd_alloc+0x4e0/0x4e0 [ 35.009929] ? find_held_lock+0x39/0x1d0 [ 35.013958] ? lock_downgrade+0x990/0x990 [ 35.018079] ? handle_mm_fault+0x410/0x8d0 [ 35.022279] ? down_read_trylock+0xdb/0x170 [ 35.026564] ? __handle_mm_fault+0x39c0/0x39c0 [ 35.031112] ? vmacache_find+0x61/0x270 [ 35.035051] ? up_read+0x1a/0x40 [ 35.038380] ? __do_page_fault+0x35b/0xb60 [ 35.042577] ? do_vfs_ioctl+0x492/0x1530 [ 35.046603] ? do_page_fault+0xee/0x720 [ 35.050540] ? __do_page_fault+0xb60/0xb60 [ 35.054737] ? putname+0xf3/0x130 [ 35.058156] do_group_exit+0x149/0x400 [ 35.062008] ? lockdep_sys_exit+0x47/0xf0 [ 35.066117] ? SyS_exit+0x30/0x30 [ 35.069533] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 35.074511] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 35.079232] SyS_exit_group+0x1d/0x20 [ 35.082995] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 35.087711] RIP: 0033:0x4435e8