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-5,10.128.0.9' (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: [ 25.596423] ================================================================== [ 25.603862] BUG: KASAN: use-after-free in detach_if_pending+0x557/0x610 [ 25.610592] Write of size 8 at addr ffff8801c01536f8 by task syzkaller583896/3013 [ 25.618182] [ 25.619792] CPU: 1 PID: 3013 Comm: syzkaller583896 Not tainted 4.13.0-rc6+ #46 [ 25.627121] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 25.636999] Call Trace: [ 25.639563] dump_stack+0x194/0x257 [ 25.643162] ? arch_local_irq_restore+0x53/0x53 [ 25.647808] ? show_regs_print_info+0x65/0x65 [ 25.652274] ? lock_timer_base+0x1a3/0x2b0 [ 25.656521] ? detach_if_pending+0x557/0x610 [ 25.660907] print_address_description+0x73/0x250 [ 25.665731] ? detach_if_pending+0x557/0x610 [ 25.670114] kasan_report+0x24e/0x340 [ 25.673892] __asan_report_store8_noabort+0x17/0x20 [ 25.678878] detach_if_pending+0x557/0x610 [ 25.683087] ? __next_timer_interrupt+0x150/0x150 [ 25.687899] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 25.692536] ? lock_timer_base+0x1a3/0x2b0 [ 25.696741] ? lock_timer_base+0x1eb/0x2b0 [ 25.700945] ? __internal_add_timer+0x2d0/0x2d0 [ 25.705593] ? lock_downgrade+0x990/0x990 [ 25.709719] try_to_del_timer_sync+0xa2/0x120 [ 25.714185] ? del_timer+0x130/0x130 [ 25.717869] ? del_timer_sync+0xeb/0x240 [ 25.721905] del_timer_sync+0x18a/0x240 [ 25.725858] tun_free_netdev+0x105/0x1b0 [ 25.729889] ? tun_show_group+0x170/0x170 [ 25.734006] ? netdev_refcnt_read+0xf4/0x160 [ 25.738386] ? tun_show_group+0x170/0x170 [ 25.742505] netdev_run_todo+0x870/0xca0 [ 25.746539] ? do_group_exit+0x149/0x400 [ 25.750572] ? mark_held_locks+0xaf/0x100 [ 25.754691] ? register_netdev+0x30/0x30 [ 25.758720] ? find_held_lock+0x35/0x1d0 [ 25.762759] ? lock_downgrade+0x990/0x990 [ 25.766881] ? refcount_sub_and_test+0x115/0x1b0 [ 25.771615] ? refcount_inc+0x50/0x50 [ 25.775383] ? refcount_inc+0x50/0x50 [ 25.779156] ? sk_destruct+0x4c/0x80 [ 25.782840] ? __sk_free+0x5c/0x230 [ 25.786437] ? sk_free+0x2f/0x40 [ 25.789776] ? __tun_detach+0x176/0x1390 [ 25.793818] ? tun_attach+0xfa0/0xfa0 [ 25.797601] ? locks_remove_file+0x414/0x560 [ 25.801981] ? fcntl_setlk+0x10c0/0x10c0 [ 25.806013] ? __fsnotify_parent+0xb4/0x3a0 [ 25.810300] ? fsnotify+0x1af0/0x1af0 [ 25.814085] ? __tun_detach+0x1390/0x1390 [ 25.818209] rtnl_unlock+0xe/0x10 [ 25.821633] tun_chr_close+0x49/0x60 [ 25.825317] __fput+0x327/0x7e0 [ 25.828574] ? fput+0x140/0x140 [ 25.831833] ? check_same_owner+0x320/0x320 [ 25.836132] ____fput+0x15/0x20 [ 25.839381] task_work_run+0x18a/0x260 [ 25.843243] ? task_work_cancel+0x210/0x210 [ 25.847533] ? free_nsproxy+0x185/0x1f0 [ 25.851477] ? switch_task_namespaces+0xa2/0xc0 [ 25.856122] do_exit+0xa3a/0x1b10 [ 25.859543] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 25.864539] ? lock_acquire+0x1d5/0x580 [ 25.868484] ? kvfree+0x3b/0x60 [ 25.871738] ? __handle_mm_fault+0x1141/0x3860 [ 25.876297] ? mm_update_next_owner+0x930/0x930 [ 25.880947] ? lock_release+0xa40/0xa40 [ 25.884900] ? tun_select_queue+0x580/0x580 [ 25.889202] ? __handle_mm_fault+0x577/0x3860 [ 25.893664] ? check_noncircular+0x20/0x20 [ 25.897870] ? check_noncircular+0x20/0x20 [ 25.902079] ? __pmd_alloc+0x4e0/0x4e0 [ 25.905944] ? find_held_lock+0x35/0x1d0 [ 25.909983] ? handle_mm_fault+0x23e/0x860 [ 25.914194] ? find_held_lock+0x35/0x1d0 [ 25.918234] ? __do_page_fault+0x51b/0xb60 [ 25.922441] ? lock_downgrade+0x990/0x990 [ 25.926567] ? handle_mm_fault+0x4a2/0x860 [ 25.930788] ? down_read_trylock+0xdb/0x170 [ 25.935088] ? __handle_mm_fault+0x3860/0x3860 [ 25.939638] ? vmacache_find+0x61/0x270 [ 25.943587] do_group_exit+0x149/0x400 [ 25.947449] ? SyS_exit+0x30/0x30 [ 25.950880] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 25.955884] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 25.960618] SyS_exit_group+0x1d/0x20 [ 25.964393] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 25.969116] RIP: 0033:0x445169 [ 25.972277] RSP: 002b:00000000007efe48 EFLAGS: 00000206 ORIG_RAX: 00000000000000e7 [ 25.979959] RAX: ffffffffffffffda RBX: 609a609b65872358 RCX: 0000000000445169 [ 25.987200] RDX: 0000000000445169 RSI: 0000000020982fd8 RDI: 0000000000000001 [ 25.994442] RBP: 0000000000000086 R08: 0000000000000000 R09: 0000000000000000 [ 26.001680] R10: 0000000000000000 R11: 0000000000000206 R12: 00000000004027c0 [ 26.008922] R13: 0000000000402850 R14: 0000000000000000 R15: 0000000000000000 [ 26.016178] [ 26.017789] Allocated by task 3013: [ 26.021390] save_stack_trace+0x16/0x20 [ 26.025329] save_stack+0x43/0xd0 [ 26.028749] kasan_kmalloc+0xad/0xe0 [ 26.032427] __kmalloc_node+0x47/0x70 [ 26.036194] kvmalloc_node+0x64/0xd0 [ 26.039873] alloc_netdev_mqs+0x16e/0xed0 [ 26.043992] __tun_chr_ioctl+0x12b2/0x3d60 [ 26.048202] tun_chr_ioctl+0x2a/0x40 [ 26.051887] do_vfs_ioctl+0x1b1/0x1520 [ 26.055739] SyS_ioctl+0x8f/0xc0 [ 26.059073] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 26.063793] [ 26.065388] Freed by task 3013: [ 26.068640] save_stack_trace+0x16/0x20 [ 26.072582] save_stack+0x43/0xd0 [ 26.076002] kasan_slab_free+0x71/0xc0 [ 26.079857] kfree+0xca/0x250 [ 26.082931] kvfree+0x36/0x60 [ 26.086005] free_netdev+0x2cf/0x360 [ 26.089686] __tun_chr_ioctl+0x2d24/0x3d60 [ 26.093887] tun_chr_ioctl+0x2a/0x40 [ 26.097568] do_vfs_ioctl+0x1b1/0x1520 [ 26.101421] SyS_ioctl+0x8f/0xc0 [ 26.104751] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 26.109469] [ 26.111066] The buggy address belongs to the object at ffff8801c01503c0 [ 26.111066] which belongs to the cache kmalloc-16384 of size 16384 [ 26.124041] The buggy address is located 13112 bytes inside of [ 26.124041] 16384-byte region [ffff8801c01503c0, ffff8801c01543c0) [ 26.136233] The buggy address belongs to the page: [ 26.141184] page:ffffea0007005400 count:1 mapcount:0 mapping:ffff8801c01503c0 index:0x0 compound_mapcount: 0 [ 26.151121] flags: 0x200000000008100(slab|head) [ 26.155759] raw: 0200000000008100 ffff8801c01503c0 0000000000000000 0000000100000001 [ 26.163609] raw: ffffea00073e3a20 ffff8801dac01c48 ffff8801dac02200 0000000000000000 [ 26.171457] page dumped because: kasan: bad access detected [ 26.177132] [ 26.178723] Memory state around the buggy address: [ 26.183618] ffff8801c0153580: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 26.190950] ffff8801c0153600: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 26.198279] >ffff8801c0153680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 26.205606] ^ [ 26.212844] ffff8801c0153700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 26.220169] ffff8801c0153780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 26.227494] ================================================================== [ 26.234818] Disabling lock debugging due to kernel taint [ 26.240230] Kernel panic - not syncing: panic_on_warn set ... [ 26.240230] [ 26.247565] CPU: 1 PID: 3013 Comm: syzkaller583896 Tainted: G B 4.13.0-rc6+ #46 [ 26.256104] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 26.265424] Call Trace: [ 26.267980] dump_stack+0x194/0x257 [ 26.271575] ? arch_local_irq_restore+0x53/0x53 [ 26.276210] ? kasan_end_report+0x32/0x50 [ 26.280323] ? lock_downgrade+0x990/0x990 [ 26.284449] ? detach_if_pending+0x550/0x610 [ 26.288828] panic+0x1e4/0x417 [ 26.291989] ? __warn+0x1d9/0x1d9 [ 26.295412] ? detach_if_pending+0x557/0x610 [ 26.299789] kasan_end_report+0x50/0x50 [ 26.303728] kasan_report+0x137/0x340 [ 26.307497] __asan_report_store8_noabort+0x17/0x20 [ 26.312484] detach_if_pending+0x557/0x610 [ 26.316690] ? __next_timer_interrupt+0x150/0x150 [ 26.321503] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 26.326140] ? lock_timer_base+0x1a3/0x2b0 [ 26.330348] ? lock_timer_base+0x1eb/0x2b0 [ 26.334564] ? __internal_add_timer+0x2d0/0x2d0 [ 26.339205] ? lock_downgrade+0x990/0x990 [ 26.343327] try_to_del_timer_sync+0xa2/0x120 [ 26.347789] ? del_timer+0x130/0x130 [ 26.351471] ? del_timer_sync+0xeb/0x240 [ 26.355501] del_timer_sync+0x18a/0x240 [ 26.359454] tun_free_netdev+0x105/0x1b0 [ 26.363479] ? tun_show_group+0x170/0x170 [ 26.367592] ? netdev_refcnt_read+0xf4/0x160 [ 26.371967] ? tun_show_group+0x170/0x170 [ 26.376081] netdev_run_todo+0x870/0xca0 [ 26.380107] ? do_group_exit+0x149/0x400 [ 26.384133] ? mark_held_locks+0xaf/0x100 [ 26.388251] ? register_netdev+0x30/0x30 [ 26.392282] ? find_held_lock+0x35/0x1d0 [ 26.396315] ? lock_downgrade+0x990/0x990 [ 26.400433] ? refcount_sub_and_test+0x115/0x1b0 [ 26.405155] ? refcount_inc+0x50/0x50 [ 26.408944] ? refcount_inc+0x50/0x50 [ 26.412716] ? sk_destruct+0x4c/0x80 [ 26.416393] ? __sk_free+0x5c/0x230 [ 26.419987] ? sk_free+0x2f/0x40 [ 26.423320] ? __tun_detach+0x176/0x1390 [ 26.427353] ? tun_attach+0xfa0/0xfa0 [ 26.431124] ? locks_remove_file+0x414/0x560 [ 26.435499] ? fcntl_setlk+0x10c0/0x10c0 [ 26.439529] ? __fsnotify_parent+0xb4/0x3a0 [ 26.443817] ? fsnotify+0x1af0/0x1af0 [ 26.447585] ? __tun_detach+0x1390/0x1390 [ 26.451788] rtnl_unlock+0xe/0x10 [ 26.455209] tun_chr_close+0x49/0x60 [ 26.458890] __fput+0x327/0x7e0 [ 26.462135] ? fput+0x140/0x140 [ 26.465383] ? check_same_owner+0x320/0x320 [ 26.469673] ____fput+0x15/0x20 [ 26.472932] task_work_run+0x18a/0x260 [ 26.476790] ? task_work_cancel+0x210/0x210 [ 26.481075] ? free_nsproxy+0x185/0x1f0 [ 26.485013] ? switch_task_namespaces+0xa2/0xc0 [ 26.489650] do_exit+0xa3a/0x1b10 [ 26.493069] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 26.498055] ? lock_acquire+0x1d5/0x580 [ 26.501997] ? kvfree+0x3b/0x60 [ 26.505245] ? __handle_mm_fault+0x1141/0x3860 [ 26.509794] ? mm_update_next_owner+0x930/0x930 [ 26.514435] ? lock_release+0xa40/0xa40 [ 26.518382] ? tun_select_queue+0x580/0x580 [ 26.522688] ? __handle_mm_fault+0x577/0x3860 [ 26.527162] ? check_noncircular+0x20/0x20 [ 26.531371] ? check_noncircular+0x20/0x20 [ 26.535587] ? __pmd_alloc+0x4e0/0x4e0 [ 26.539447] ? find_held_lock+0x35/0x1d0 [ 26.543489] ? handle_mm_fault+0x23e/0x860 [ 26.547690] ? find_held_lock+0x35/0x1d0 [ 26.551723] ? __do_page_fault+0x51b/0xb60 [ 26.555935] ? lock_downgrade+0x990/0x990 [ 26.560055] ? handle_mm_fault+0x4a2/0x860 [ 26.564255] ? down_read_trylock+0xdb/0x170 [ 26.568554] ? __handle_mm_fault+0x3860/0x3860 [ 26.573109] ? vmacache_find+0x61/0x270 [ 26.577051] do_group_exit+0x149/0x400 [ 26.580904] ? SyS_exit+0x30/0x30 [ 26.584326] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 26.589319] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 26.594042] SyS_exit_group+0x1d/0x20