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-kasan-gce-3,10.128.15.212' (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: [ 46.981373] ================================================================== [ 46.983129] BUG: KASAN: use-after-free in detach_if_pending+0x557/0x610 [ 46.984696] Write of size 8 at addr ffff8801cea037c0 by task syzkaller110928/2981 [ 46.986362] [ 46.986816] CPU: 1 PID: 2981 Comm: syzkaller110928 Not tainted 4.13.0+ #72 [ 46.988338] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 46.990390] Call Trace: [ 46.990882] dump_stack+0x194/0x257 [ 46.991616] ? arch_local_irq_restore+0x53/0x53 [ 46.992650] ? show_regs_print_info+0x65/0x65 [ 46.993685] ? lock_timer_base+0x1a3/0x2b0 [ 46.994547] ? detach_if_pending+0x557/0x610 [ 46.995564] print_address_description+0x73/0x250 [ 46.996618] ? detach_if_pending+0x557/0x610 [ 46.997330] kasan_report+0x24e/0x340 [ 46.998184] __asan_report_store8_noabort+0x17/0x20 [ 46.999501] detach_if_pending+0x557/0x610 [ 47.000394] ? __next_timer_interrupt+0x150/0x150 [ 47.001491] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 47.005987] ? lock_timer_base+0x1a3/0x2b0 [ 47.010200] ? lock_timer_base+0x1eb/0x2b0 [ 47.014416] ? __internal_add_timer+0x2d0/0x2d0 [ 47.019065] ? trace_hardirqs_on+0xd/0x10 [ 47.023197] try_to_del_timer_sync+0xa2/0x120 [ 47.027757] ? del_timer+0x130/0x130 [ 47.031452] ? del_timer_sync+0xeb/0x240 [ 47.035495] del_timer_sync+0x18a/0x240 [ 47.039553] tun_free_netdev+0x105/0x1b0 [ 47.044161] ? tun_xdp+0x410/0x410 [ 47.047695] ? netdev_refcnt_read+0xf4/0x160 [ 47.052104] ? tun_xdp+0x410/0x410 [ 47.055640] netdev_run_todo+0x870/0xca0 [ 47.059702] ? do_group_exit+0x149/0x400 [ 47.063825] ? register_netdev+0x30/0x30 [ 47.067897] ? do_raw_spin_trylock+0x190/0x190 [ 47.072503] ? refcount_sub_and_test+0x115/0x1b0 [ 47.077265] ? refcount_inc+0x50/0x50 [ 47.081063] ? refcount_inc+0x50/0x50 [ 47.084861] ? sk_destruct+0x4c/0x80 [ 47.088567] ? __sk_free+0x5c/0x230 [ 47.092200] ? sk_free+0x2f/0x40 [ 47.095559] ? __tun_detach+0x176/0x1390 [ 47.099641] ? tun_attach+0xf90/0xf90 [ 47.103452] ? do_raw_spin_trylock+0x190/0x190 [ 47.108033] ? locks_remove_file+0x3fa/0x5a0 [ 47.112445] ? fcntl_setlk+0x10d0/0x10d0 [ 47.116511] ? __fsnotify_parent+0xb4/0x3a0 [ 47.120831] ? fsnotify+0x1af0/0x1af0 [ 47.124628] ? __tun_detach+0x1390/0x1390 [ 47.128773] ? __tun_detach+0x1390/0x1390 [ 47.132912] rtnl_unlock+0xe/0x10 [ 47.136362] tun_chr_close+0x49/0x60 [ 47.140070] __fput+0x333/0x7f0 [ 47.143356] ? fput+0x140/0x140 [ 47.146634] ? check_same_owner+0x320/0x320 [ 47.150945] ? _raw_spin_unlock_irq+0x27/0x70 [ 47.155450] ____fput+0x15/0x20 [ 47.158774] task_work_run+0x199/0x270 [ 47.162669] ? task_work_cancel+0x210/0x210 [ 47.166996] ? _raw_spin_unlock+0x22/0x30 [ 47.171140] ? switch_task_namespaces+0x87/0xc0 [ 47.175809] do_exit+0xa52/0x1b40 [ 47.179249] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 47.184256] ? check_noncircular+0x20/0x20 [ 47.188503] ? mm_update_next_owner+0x930/0x930 [ 47.193172] ? __pmd_alloc+0x4e0/0x4e0 [ 47.197057] ? find_held_lock+0x39/0x1d0 [ 47.201120] ? lock_downgrade+0x990/0x990 [ 47.205294] ? handle_mm_fault+0x4a2/0x860 [ 47.209539] ? down_read_trylock+0xdb/0x170 [ 47.213869] ? __handle_mm_fault+0x3840/0x3840 [ 47.218451] ? vmacache_find+0x61/0x270 [ 47.222439] ? up_read+0x1a/0x40 [ 47.225801] ? __do_page_fault+0x35b/0xb60 [ 47.230020] ? do_vfs_ioctl+0x492/0x1530 [ 47.234079] ? do_page_fault+0xee/0x720 [ 47.238047] ? __do_page_fault+0xb60/0xb60 [ 47.242267] ? putname+0xf3/0x130 [ 47.245732] do_group_exit+0x149/0x400 [ 47.249626] ? lockdep_sys_exit+0x47/0xf0 [ 47.253777] ? SyS_exit+0x30/0x30 [ 47.257225] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 47.262229] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 47.266976] SyS_exit_group+0x1d/0x20 [ 47.270770] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 47.275516] RIP: 0033:0x443ba8 [ 47.278694] RSP: 002b:00007ffc78a15968 EFLAGS: 00000246 ORIG_RAX: 00000000000000e7 [ 47.286399] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 0000000000443ba8 [ 47.293662] RDX: 0000000000000000 RSI: 000000000000003c RDI: 0000000000000000 [ 47.300919] RBP: 0000000000000082 R08: 00000000000000e7 R09: ffffffffffffffd4 [ 47.308177] R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000001 [ 47.315441] R13: 00000000006d6180 R14: 0000000000000000 R15: 0000000000000000 [ 47.322740] [ 47.324364] Allocated by task 2981: [ 47.327982] save_stack_trace+0x16/0x20 [ 47.331938] save_stack+0x43/0xd0 [ 47.335385] kasan_kmalloc+0xad/0xe0 [ 47.339087] __kmalloc_node+0x47/0x70 [ 47.342875] kvmalloc_node+0x64/0xd0 [ 47.346581] alloc_netdev_mqs+0x16e/0xed0 [ 47.350727] __tun_chr_ioctl+0x12be/0x3d40 [ 47.354957] tun_chr_ioctl+0x2a/0x40 [ 47.358661] do_vfs_ioctl+0x1b1/0x1530 [ 47.362545] SyS_ioctl+0x8f/0xc0 [ 47.365901] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 47.370641] [ 47.372253] Freed by task 2981: [ 47.375522] save_stack_trace+0x16/0x20 [ 47.379479] save_stack+0x43/0xd0 [ 47.382911] kasan_slab_free+0x71/0xc0 [ 47.386782] kfree+0xca/0x250 [ 47.389872] kvfree+0x36/0x60 [ 47.392957] free_netdev+0x2cf/0x360 [ 47.396656] __tun_chr_ioctl+0x2cff/0x3d40 [ 47.400879] tun_chr_ioctl+0x2a/0x40 [ 47.404579] do_vfs_ioctl+0x1b1/0x1530 [ 47.408463] SyS_ioctl+0x8f/0xc0 [ 47.411818] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 47.416556] [ 47.418173] The buggy address belongs to the object at ffff8801cea003c0 [ 47.418173] which belongs to the cache kmalloc-16384 of size 16384 [ 47.431160] The buggy address is located 13312 bytes inside of [ 47.431160] 16384-byte region [ffff8801cea003c0, ffff8801cea043c0) [ 47.443373] The buggy address belongs to the page: [ 47.448308] page:ffffea00073a8000 count:1 mapcount:0 mapping:ffff8801cea003c0 index:0x0 compound_mapcount: 0 [ 47.458292] flags: 0x200000000008100(slab|head) [ 47.462957] raw: 0200000000008100 ffff8801cea003c0 0000000000000000 0000000100000001 [ 47.470830] raw: ffffea00073a6c20 ffff8801dac01c50 ffff8801dac02200 0000000000000000 [ 47.478695] page dumped because: kasan: bad access detected [ 47.484400] [ 47.486013] Memory state around the buggy address: [ 47.490921] ffff8801cea03680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 47.498267] ffff8801cea03700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 47.505632] >ffff8801cea03780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 47.512982] ^ [ 47.518428] ffff8801cea03800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 47.525785] ffff8801cea03880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 47.533128] ================================================================== [ 47.540473] Disabling lock debugging due to kernel taint [ 47.545898] Kernel panic - not syncing: panic_on_warn set ... [ 47.545898] [ 47.553236] CPU: 1 PID: 2981 Comm: syzkaller110928 Tainted: G B 4.13.0+ #72 [ 47.561442] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 47.570781] Call Trace: [ 47.573353] dump_stack+0x194/0x257 [ 47.576968] ? arch_local_irq_restore+0x53/0x53 [ 47.581626] ? vprintk_default+0x28/0x30 [ 47.585684] ? detach_if_pending+0x4f0/0x610 [ 47.590093] panic+0x1e4/0x417 [ 47.593265] ? __warn+0x1d9/0x1d9 [ 47.596711] ? detach_if_pending+0x557/0x610 [ 47.601100] kasan_end_report+0x50/0x50 [ 47.605056] kasan_report+0x137/0x340 [ 47.608843] __asan_report_store8_noabort+0x17/0x20 [ 47.613871] detach_if_pending+0x557/0x610 [ 47.618094] ? __next_timer_interrupt+0x150/0x150 [ 47.622920] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 47.627593] ? lock_timer_base+0x1a3/0x2b0 [ 47.631823] ? lock_timer_base+0x1eb/0x2b0 [ 47.636046] ? __internal_add_timer+0x2d0/0x2d0 [ 47.640697] ? trace_hardirqs_on+0xd/0x10 [ 47.644826] try_to_del_timer_sync+0xa2/0x120 [ 47.649310] ? del_timer+0x130/0x130 [ 47.653010] ? del_timer_sync+0xeb/0x240 [ 47.657065] del_timer_sync+0x18a/0x240 [ 47.661033] tun_free_netdev+0x105/0x1b0 [ 47.665080] ? tun_xdp+0x410/0x410 [ 47.668607] ? netdev_refcnt_read+0xf4/0x160 [ 47.673003] ? tun_xdp+0x410/0x410 [ 47.676543] netdev_run_todo+0x870/0xca0 [ 47.680594] ? do_group_exit+0x149/0x400 [ 47.684646] ? register_netdev+0x30/0x30 [ 47.688703] ? do_raw_spin_trylock+0x190/0x190 [ 47.693287] ? refcount_sub_and_test+0x115/0x1b0 [ 47.698048] ? refcount_inc+0x50/0x50 [ 47.701840] ? refcount_inc+0x50/0x50 [ 47.705622] ? sk_destruct+0x4c/0x80 [ 47.709315] ? __sk_free+0x5c/0x230 [ 47.712926] ? sk_free+0x2f/0x40 [ 47.716280] ? __tun_detach+0x176/0x1390 [ 47.720341] ? tun_attach+0xf90/0xf90 [ 47.724124] ? do_raw_spin_trylock+0x190/0x190 [ 47.728684] ? locks_remove_file+0x3fa/0x5a0 [ 47.733066] ? fcntl_setlk+0x10d0/0x10d0 [ 47.737099] ? __fsnotify_parent+0xb4/0x3a0 [ 47.741407] ? fsnotify+0x1af0/0x1af0 [ 47.745202] ? __tun_detach+0x1390/0x1390 [ 47.749341] ? __tun_detach+0x1390/0x1390 [ 47.753478] rtnl_unlock+0xe/0x10 [ 47.756926] tun_chr_close+0x49/0x60 [ 47.760663] __fput+0x333/0x7f0 [ 47.763941] ? fput+0x140/0x140 [ 47.767214] ? check_same_owner+0x320/0x320 [ 47.771528] ? _raw_spin_unlock_irq+0x27/0x70 [ 47.776020] ____fput+0x15/0x20 [ 47.779293] task_work_run+0x199/0x270 [ 47.783175] ? task_work_cancel+0x210/0x210 [ 47.787493] ? _raw_spin_unlock+0x22/0x30 [ 47.791635] ? switch_task_namespaces+0x87/0xc0 [ 47.796305] do_exit+0xa52/0x1b40 [ 47.799750] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 47.804753] ? check_noncircular+0x20/0x20 [ 47.808970] ? mm_update_next_owner+0x930/0x930 [ 47.813627] ? __pmd_alloc+0x4e0/0x4e0 [ 47.817516] ? find_held_lock+0x39/0x1d0 [ 47.821578] ? lock_downgrade+0x990/0x990 [ 47.825739] ? handle_mm_fault+0x4a2/0x860 [ 47.829957] ? down_read_trylock+0xdb/0x170 [ 47.834265] ? __handle_mm_fault+0x3840/0x3840 [ 47.838831] ? vmacache_find+0x61/0x270 [ 47.842790] ? up_read+0x1a/0x40 [ 47.846133] ? __do_page_fault+0x35b/0xb60 [ 47.850436] ? do_vfs_ioctl+0x492/0x1530 [ 47.854494] ? do_page_fault+0xee/0x720 [ 47.858456] ? __do_page_fault+0xb60/0xb60 [ 47.862759] ? putname+0xf3/0x130 [ 47.866191] do_group_exit+0x149/0x400 [ 47.870054] ? lockdep_sys_exit+0x47/0xf0 [ 47.874184] ? SyS_exit+0x30/0x30 [ 47.877628] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 47.882631] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 47.887372] SyS_exit_group+0x1d/0x20 [ 47.891170] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 47.895905] RIP: 0033:0x443ba8 [ 47.899068] RSP: 002b:00007ffc78a15968 EFLAGS: 00000246 ORIG_RAX: 00000000000000e7 [ 47.906753] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 0000000000443ba8 [ 47.914008] RDX: 0000000000000000 RSI: 000000000000003c RDI: 0000000000000000 [ 47.921268] RBP: 0000000000000082 R08: 00000000000000e7 R09: ffffffffffffffd4 [ 47.928560] R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000001 [ 47.935829] R13: 00000000006d6180 R14: 0000000000000000 R15: 0000000000000000