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.53' (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.264317] ================================================================== [ 40.271726] BUG: KASAN: use-after-free in detach_if_pending+0x557/0x610 [ 40.278448] Write of size 8 at addr ffff8801cdc73740 by task syzkaller714233/2985 [ 40.286035] [ 40.287635] CPU: 1 PID: 2985 Comm: syzkaller714233 Not tainted 4.13.0-mm1+ #7 [ 40.294875] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 40.304195] Call Trace: [ 40.306754] dump_stack+0x194/0x257 [ 40.310353] ? arch_local_irq_restore+0x53/0x53 [ 40.314992] ? show_regs_print_info+0x65/0x65 [ 40.319464] ? lock_timer_base+0x1a3/0x2b0 [ 40.323669] ? detach_if_pending+0x557/0x610 [ 40.328050] print_address_description+0x73/0x250 [ 40.332862] ? detach_if_pending+0x557/0x610 [ 40.337240] kasan_report+0x24e/0x340 [ 40.341015] __asan_report_store8_noabort+0x17/0x20 [ 40.346001] detach_if_pending+0x557/0x610 [ 40.350209] ? trace_raw_output_tick_stop+0x130/0x130 [ 40.355369] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 40.360005] ? lock_timer_base+0x1a3/0x2b0 [ 40.364209] ? lock_timer_base+0x1eb/0x2b0 [ 40.368417] ? __internal_add_timer+0x2d0/0x2d0 [ 40.373056] ? trace_hardirqs_on+0xd/0x10 [ 40.377180] try_to_del_timer_sync+0xa2/0x120 [ 40.381644] ? del_timer+0x130/0x130 [ 40.385331] ? del_timer_sync+0xeb/0x240 [ 40.389368] del_timer_sync+0x18a/0x240 [ 40.393316] tun_free_netdev+0x105/0x1b0 [ 40.397349] ? tun_xdp+0x410/0x410 [ 40.400861] ? cpumask_next+0x24/0x30 [ 40.404634] ? netdev_refcnt_read+0xed/0x150 [ 40.409017] ? tun_xdp+0x410/0x410 [ 40.412526] netdev_run_todo+0x870/0xca0 [ 40.416558] ? do_group_exit+0x149/0x400 [ 40.420596] ? register_netdev+0x30/0x30 [ 40.424630] ? lock_downgrade+0x990/0x990 [ 40.428749] ? trace_hardirqs_on+0xd/0x10 [ 40.432882] ? refcount_sub_and_test+0x115/0x1b0 [ 40.437606] ? refcount_inc+0x50/0x50 [ 40.441376] ? refcount_inc+0x50/0x50 [ 40.445151] ? sk_destruct+0x4c/0x80 [ 40.448833] ? __sk_free+0x5c/0x230 [ 40.452431] ? sk_free+0x2f/0x40 [ 40.455769] ? __tun_detach+0x176/0x1390 [ 40.459812] ? tun_attach+0xf90/0xf90 [ 40.463585] ? do_raw_spin_trylock+0x190/0x190 [ 40.468138] ? locks_remove_file+0x3fa/0x5a0 [ 40.472518] ? fcntl_setlk+0x10d0/0x10d0 [ 40.476551] ? __fsnotify_parent+0xb4/0x3a0 [ 40.480842] ? fsnotify+0x1af0/0x1af0 [ 40.484615] ? __tun_detach+0x1390/0x1390 [ 40.488736] ? __tun_detach+0x1390/0x1390 [ 40.492852] rtnl_unlock+0xe/0x10 [ 40.496275] tun_chr_close+0x49/0x60 [ 40.499959] __fput+0x333/0x7f0 [ 40.503214] ? fput+0x140/0x140 [ 40.506466] ? check_same_owner+0x320/0x320 [ 40.510755] ? _raw_spin_unlock_irq+0x27/0x70 [ 40.515228] ____fput+0x15/0x20 [ 40.518477] task_work_run+0x199/0x270 [ 40.522337] ? task_work_cancel+0x210/0x210 [ 40.526628] ? _raw_spin_unlock+0x22/0x30 [ 40.530746] ? switch_task_namespaces+0x87/0xc0 [ 40.535390] do_exit+0xa52/0x1b40 [ 40.538814] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 40.543803] ? check_noncircular+0x20/0x20 [ 40.548016] ? mm_update_next_owner+0x930/0x930 [ 40.552654] ? __pmd_alloc+0x4e0/0x4e0 [ 40.556521] ? find_held_lock+0x39/0x1d0 [ 40.560563] ? lock_downgrade+0x990/0x990 [ 40.564700] ? handle_mm_fault+0x410/0x8d0 [ 40.568901] ? down_read_trylock+0xdb/0x170 [ 40.573194] ? __handle_mm_fault+0x39c0/0x39c0 [ 40.577749] ? vmacache_find+0x61/0x270 [ 40.581698] ? up_read+0x1a/0x40 [ 40.585035] ? __do_page_fault+0x35b/0xb60 [ 40.589243] ? do_vfs_ioctl+0x492/0x1530 [ 40.593280] ? do_page_fault+0xee/0x720 [ 40.597230] ? __do_page_fault+0xb60/0xb60 [ 40.601438] ? putname+0xf3/0x130 [ 40.604871] do_group_exit+0x149/0x400 [ 40.608731] ? lockdep_sys_exit+0x47/0xf0 [ 40.612847] ? SyS_exit+0x30/0x30 [ 40.616272] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 40.621259] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 40.625987] SyS_exit_group+0x1d/0x20 [ 40.629757] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 40.634479] RIP: 0033:0x443648 [ 40.637637] RSP: 002b:00007fff7e47b328 EFLAGS: 00000246 ORIG_RAX: 00000000000000e7 [ 40.645318] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 0000000000443648 [ 40.652558] RDX: 0000000000000000 RSI: 000000000000003c RDI: 0000000000000000 [ 40.659798] RBP: 0000000000000082 R08: 00000000000000e7 R09: ffffffffffffffd0 [ 40.667039] R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000001 [ 40.674280] R13: 00000000006d6180 R14: 0000000000000000 R15: 0000000000000000 [ 40.681538] [ 40.683135] Allocated by task 2985: [ 40.686735] save_stack_trace+0x16/0x20 [ 40.690681] save_stack+0x43/0xd0 [ 40.694101] kasan_kmalloc+0xad/0xe0 [ 40.697783] __kmalloc_node+0x47/0x70 [ 40.701554] kvmalloc_node+0x64/0xd0 [ 40.705237] alloc_netdev_mqs+0x16e/0xed0 [ 40.709354] __tun_chr_ioctl+0x12be/0x3d20 [ 40.713555] tun_chr_ioctl+0x2a/0x40 [ 40.717240] do_vfs_ioctl+0x1b1/0x1530 [ 40.721112] SyS_ioctl+0x8f/0xc0 [ 40.724466] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 40.729187] [ 40.730785] Freed by task 2985: [ 40.734033] save_stack_trace+0x16/0x20 [ 40.737975] save_stack+0x43/0xd0 [ 40.741394] kasan_slab_free+0x71/0xc0 [ 40.745248] kfree+0xca/0x250 [ 40.748320] kvfree+0x36/0x60 [ 40.751396] free_netdev+0x2cf/0x360 [ 40.755080] __tun_chr_ioctl+0x2cf6/0x3d20 [ 40.759283] tun_chr_ioctl+0x2a/0x40 [ 40.762964] do_vfs_ioctl+0x1b1/0x1530 [ 40.766819] SyS_ioctl+0x8f/0xc0 [ 40.770153] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 40.774874] [ 40.776474] The buggy address belongs to the object at ffff8801cdc70340 [ 40.776474] which belongs to the cache kmalloc-16384 of size 16384 [ 40.789445] The buggy address is located 13312 bytes inside of [ 40.789445] 16384-byte region [ffff8801cdc70340, ffff8801cdc74340) [ 40.801631] The buggy address belongs to the page: [ 40.806527] page:ffffea0007371c00 count:1 mapcount:0 mapping:ffff8801cdc70340 index:0x0 compound_mapcount: 0 [ 40.816478] flags: 0x200000000008100(slab|head) [ 40.821115] raw: 0200000000008100 ffff8801cdc70340 0000000000000000 0000000100000001 [ 40.828966] raw: ffffea00073c6220 ffff8801dac01c50 ffff8801dac02200 0000000000000000 [ 40.836816] page dumped because: kasan: bad access detected [ 40.842497] [ 40.844094] Memory state around the buggy address: [ 40.848990] ffff8801cdc73600: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 40.856316] ffff8801cdc73680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 40.863642] >ffff8801cdc73700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 40.870968] ^ [ 40.876384] ffff8801cdc73780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 40.883711] ffff8801cdc73800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 40.891036] ================================================================== [ 40.898362] Disabling lock debugging due to kernel taint [ 40.903772] Kernel panic - not syncing: panic_on_warn set ... [ 40.903772] [ 40.911097] CPU: 1 PID: 2985 Comm: syzkaller714233 Tainted: G B 4.13.0-mm1+ #7 [ 40.919545] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 40.928864] Call Trace: [ 40.931420] dump_stack+0x194/0x257 [ 40.935013] ? arch_local_irq_restore+0x53/0x53 [ 40.939648] ? vprintk_default+0x28/0x30 [ 40.943676] ? detach_if_pending+0x550/0x610 [ 40.948051] panic+0x1e4/0x417 [ 40.951212] ? __warn+0x1d9/0x1d9 [ 40.954639] ? detach_if_pending+0x557/0x610 [ 40.959011] kasan_end_report+0x50/0x50 [ 40.962947] kasan_report+0x137/0x340 [ 40.966715] __asan_report_store8_noabort+0x17/0x20 [ 40.971692] detach_if_pending+0x557/0x610 [ 40.975890] ? trace_raw_output_tick_stop+0x130/0x130 [ 40.981044] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 40.985675] ? lock_timer_base+0x1a3/0x2b0 [ 40.989872] ? lock_timer_base+0x1eb/0x2b0 [ 40.994070] ? __internal_add_timer+0x2d0/0x2d0 [ 40.998708] ? trace_hardirqs_on+0xd/0x10 [ 41.002824] try_to_del_timer_sync+0xa2/0x120 [ 41.007284] ? del_timer+0x130/0x130 [ 41.010961] ? del_timer_sync+0xeb/0x240 [ 41.014989] del_timer_sync+0x18a/0x240 [ 41.018934] tun_free_netdev+0x105/0x1b0 [ 41.022963] ? tun_xdp+0x410/0x410 [ 41.026466] ? cpumask_next+0x24/0x30 [ 41.030231] ? netdev_refcnt_read+0xed/0x150 [ 41.034605] ? tun_xdp+0x410/0x410 [ 41.038107] netdev_run_todo+0x870/0xca0 [ 41.042131] ? do_group_exit+0x149/0x400 [ 41.046157] ? register_netdev+0x30/0x30 [ 41.050182] ? lock_downgrade+0x990/0x990 [ 41.054293] ? trace_hardirqs_on+0xd/0x10 [ 41.058417] ? refcount_sub_and_test+0x115/0x1b0 [ 41.063134] ? refcount_inc+0x50/0x50 [ 41.066896] ? refcount_inc+0x50/0x50 [ 41.070661] ? sk_destruct+0x4c/0x80 [ 41.074336] ? __sk_free+0x5c/0x230 [ 41.077926] ? sk_free+0x2f/0x40 [ 41.081255] ? __tun_detach+0x176/0x1390 [ 41.085284] ? tun_attach+0xf90/0xf90 [ 41.089049] ? do_raw_spin_trylock+0x190/0x190 [ 41.093597] ? locks_remove_file+0x3fa/0x5a0 [ 41.097968] ? fcntl_setlk+0x10d0/0x10d0 [ 41.101993] ? __fsnotify_parent+0xb4/0x3a0 [ 41.106278] ? fsnotify+0x1af0/0x1af0 [ 41.110042] ? __tun_detach+0x1390/0x1390 [ 41.114151] ? __tun_detach+0x1390/0x1390 [ 41.118262] rtnl_unlock+0xe/0x10 [ 41.121677] tun_chr_close+0x49/0x60 [ 41.125353] __fput+0x333/0x7f0 [ 41.128600] ? fput+0x140/0x140 [ 41.131843] ? check_same_owner+0x320/0x320 [ 41.136126] ? _raw_spin_unlock_irq+0x27/0x70 [ 41.140585] ____fput+0x15/0x20 [ 41.143825] task_work_run+0x199/0x270 [ 41.147675] ? task_work_cancel+0x210/0x210 [ 41.151961] ? _raw_spin_unlock+0x22/0x30 [ 41.156071] ? switch_task_namespaces+0x87/0xc0 [ 41.160706] do_exit+0xa52/0x1b40 [ 41.164123] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 41.169102] ? check_noncircular+0x20/0x20 [ 41.173393] ? mm_update_next_owner+0x930/0x930 [ 41.178024] ? __pmd_alloc+0x4e0/0x4e0 [ 41.181880] ? find_held_lock+0x39/0x1d0 [ 41.185910] ? lock_downgrade+0x990/0x990 [ 41.190031] ? handle_mm_fault+0x410/0x8d0 [ 41.194229] ? down_read_trylock+0xdb/0x170 [ 41.198513] ? __handle_mm_fault+0x39c0/0x39c0 [ 41.203060] ? vmacache_find+0x61/0x270 [ 41.207001] ? up_read+0x1a/0x40 [ 41.210332] ? __do_page_fault+0x35b/0xb60 [ 41.214537] ? do_vfs_ioctl+0x492/0x1530 [ 41.218563] ? do_page_fault+0xee/0x720 [ 41.222501] ? __do_page_fault+0xb60/0xb60 [ 41.226701] ? putname+0xf3/0x130 [ 41.230123] do_group_exit+0x149/0x400 [ 41.233975] ? lockdep_sys_exit+0x47/0xf0 [ 41.238086] ? SyS_exit+0x30/0x30 [ 41.241505] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 41.246485] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 41.251206] SyS_exit_group+0x1d/0x20 [ 41.254973] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 41.259693] RIP: 0033:0x443648