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-9,10.128.15.197' (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: [ 51.434266] ================================================================== [ 51.441683] BUG: KASAN: use-after-free in detach_if_pending+0x557/0x610 [ 51.448407] Write of size 8 at addr ffff8801ccc73740 by task syzkaller869535/2985 [ 51.455995] [ 51.457598] CPU: 0 PID: 2985 Comm: syzkaller869535 Not tainted 4.14.0-rc3+ #120 [ 51.465011] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 51.474335] Call Trace: [ 51.476896] dump_stack+0x194/0x257 [ 51.480497] ? arch_local_irq_restore+0x53/0x53 [ 51.485135] ? show_regs_print_info+0x65/0x65 [ 51.489602] ? lock_timer_base+0x1a3/0x2b0 [ 51.493809] ? detach_if_pending+0x557/0x610 [ 51.498190] print_address_description+0x73/0x250 [ 51.503004] ? detach_if_pending+0x557/0x610 [ 51.507383] kasan_report+0x25b/0x340 [ 51.511158] __asan_report_store8_noabort+0x17/0x20 [ 51.516147] detach_if_pending+0x557/0x610 [ 51.520355] ? trace_raw_output_tick_stop+0x130/0x130 [ 51.525519] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 51.530157] ? lock_timer_base+0x1a3/0x2b0 [ 51.534363] ? lock_timer_base+0x1eb/0x2b0 [ 51.538572] ? __internal_add_timer+0x2d0/0x2d0 [ 51.543212] ? trace_hardirqs_on+0xd/0x10 [ 51.547339] try_to_del_timer_sync+0xa2/0x120 [ 51.551809] ? del_timer+0x130/0x130 [ 51.555497] ? del_timer_sync+0xeb/0x240 [ 51.559537] del_timer_sync+0x18a/0x240 [ 51.563490] tun_free_netdev+0x105/0x1b0 [ 51.567526] ? tun_xdp+0x410/0x410 [ 51.571040] ? cpumask_next+0x24/0x30 [ 51.574812] ? netdev_refcnt_read+0xed/0x150 [ 51.579194] ? tun_xdp+0x410/0x410 [ 51.582704] netdev_run_todo+0x870/0xca0 [ 51.586736] ? do_group_exit+0x149/0x400 [ 51.590773] ? register_netdev+0x30/0x30 [ 51.594808] ? lock_downgrade+0x990/0x990 [ 51.598926] ? trace_hardirqs_on+0xd/0x10 [ 51.603061] ? refcount_sub_and_test+0x115/0x1b0 [ 51.607787] ? refcount_inc+0x50/0x50 [ 51.611558] ? refcount_inc+0x50/0x50 [ 51.615332] ? sk_destruct+0x4c/0x80 [ 51.619014] ? __sk_free+0x5c/0x230 [ 51.622615] ? sk_free+0x2f/0x40 [ 51.625953] ? __tun_detach+0x176/0x1390 [ 51.629994] ? tun_attach+0xf90/0xf90 [ 51.633768] ? do_raw_spin_trylock+0x190/0x190 [ 51.638326] ? locks_remove_file+0x3fa/0x5a0 [ 51.642707] ? fcntl_setlk+0x10d0/0x10d0 [ 51.646742] ? __fsnotify_parent+0xb4/0x3a0 [ 51.651037] ? fsnotify+0x1af0/0x1af0 [ 51.654815] ? __tun_detach+0x1390/0x1390 [ 51.658932] rtnl_unlock+0xe/0x10 [ 51.662355] tun_chr_close+0x49/0x60 [ 51.666038] __fput+0x333/0x7f0 [ 51.669293] ? fput+0x140/0x140 [ 51.672546] ? check_same_owner+0x320/0x320 [ 51.676837] ? _raw_spin_unlock_irq+0x27/0x70 [ 51.681309] ____fput+0x15/0x20 [ 51.684561] task_work_run+0x199/0x270 [ 51.688425] ? task_work_cancel+0x210/0x210 [ 51.692717] ? _raw_spin_unlock+0x22/0x30 [ 51.696835] ? switch_task_namespaces+0x87/0xc0 [ 51.701479] do_exit+0x9d2/0x1af0 [ 51.704909] ? mm_update_next_owner+0x930/0x930 [ 51.709550] ? find_held_lock+0x39/0x1d0 [ 51.713595] ? lock_downgrade+0x990/0x990 [ 51.717735] ? handle_mm_fault+0x410/0x8d0 [ 51.721939] ? __do_page_fault+0x31e/0xd60 [ 51.726145] ? __handle_mm_fault+0x39c0/0x39c0 [ 51.730697] ? vmacache_find+0x5f/0x280 [ 51.734650] ? up_read+0x1a/0x40 [ 51.737990] ? __do_page_fault+0x3d6/0xd60 [ 51.742205] ? mm_fault_error+0x2c0/0x2c0 [ 51.746324] ? do_vfs_ioctl+0x492/0x1530 [ 51.750365] ? do_page_fault+0xee/0x720 [ 51.754311] ? __do_page_fault+0xd60/0xd60 [ 51.758517] ? putname+0xf3/0x130 [ 51.761947] do_group_exit+0x149/0x400 [ 51.765805] ? lockdep_sys_exit+0x47/0xf0 [ 51.769923] ? SyS_exit+0x30/0x30 [ 51.773347] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 51.778337] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 51.783065] SyS_exit_group+0x1d/0x20 [ 51.786839] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 51.791565] RIP: 0033:0x443b88 [ 51.794724] RSP: 002b:00007ffec92df3a8 EFLAGS: 00000246 ORIG_RAX: 00000000000000e7 [ 51.802405] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 0000000000443b88 [ 51.809646] RDX: 0000000000000000 RSI: 000000000000003c RDI: 0000000000000000 [ 51.816885] RBP: 0000000000000086 R08: 00000000000000e7 R09: ffffffffffffffd4 [ 51.824124] R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000001 [ 51.831364] R13: 00000000006d6180 R14: 0000000000000000 R15: 0000000000000000 [ 51.838619] [ 51.840218] Allocated by task 2985: [ 51.843818] save_stack_trace+0x16/0x20 [ 51.847764] save_stack+0x43/0xd0 [ 51.851188] kasan_kmalloc+0xad/0xe0 [ 51.854869] __kmalloc_node+0x47/0x70 [ 51.858640] kvmalloc_node+0x64/0xd0 [ 51.862321] alloc_netdev_mqs+0x16e/0xed0 [ 51.866435] __tun_chr_ioctl+0x12be/0x3d20 [ 51.870637] tun_chr_ioctl+0x2a/0x40 [ 51.874320] do_vfs_ioctl+0x1b1/0x1530 [ 51.878176] SyS_ioctl+0x8f/0xc0 [ 51.881509] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 51.886230] [ 51.887829] Freed by task 2985: [ 51.891076] save_stack_trace+0x16/0x20 [ 51.895017] save_stack+0x43/0xd0 [ 51.898440] kasan_slab_free+0x71/0xc0 [ 51.902296] kfree+0xca/0x250 [ 51.905370] kvfree+0x36/0x60 [ 51.908445] free_netdev+0x2cf/0x360 [ 51.912127] __tun_chr_ioctl+0x2cf6/0x3d20 [ 51.916328] tun_chr_ioctl+0x2a/0x40 [ 51.920012] do_vfs_ioctl+0x1b1/0x1530 [ 51.923867] SyS_ioctl+0x8f/0xc0 [ 51.927204] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 51.931924] [ 51.933522] The buggy address belongs to the object at ffff8801ccc70340 [ 51.933522] which belongs to the cache kmalloc-16384 of size 16384 [ 51.946492] The buggy address is located 13312 bytes inside of [ 51.946492] 16384-byte region [ffff8801ccc70340, ffff8801ccc74340) [ 51.958679] The buggy address belongs to the page: [ 51.963577] page:ffffea0007331c00 count:1 mapcount:0 mapping:ffff8801ccc70340 index:0x0 compound_mapcount: 0 [ 51.973523] flags: 0x200000000008100(slab|head) [ 51.978162] raw: 0200000000008100 ffff8801ccc70340 0000000000000000 0000000100000001 [ 51.986010] raw: ffffea0007332820 ffff8801dac01c50 ffff8801dac02200 0000000000000000 [ 51.993856] page dumped because: kasan: bad access detected [ 51.999533] [ 52.001131] Memory state around the buggy address: [ 52.006026] ffff8801ccc73600: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 52.013355] ffff8801ccc73680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 52.020683] >ffff8801ccc73700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 52.028009] ^ [ 52.033426] ffff8801ccc73780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 52.040754] ffff8801ccc73800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 52.048077] ================================================================== [ 52.055399] Disabling lock debugging due to kernel taint [ 52.060811] Kernel panic - not syncing: panic_on_warn set ... [ 52.060811] [ 52.068137] CPU: 0 PID: 2985 Comm: syzkaller869535 Tainted: G B 4.14.0-rc3+ #120 [ 52.076759] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 52.086077] Call Trace: [ 52.088632] dump_stack+0x194/0x257 [ 52.092223] ? arch_local_irq_restore+0x53/0x53 [ 52.096854] ? vprintk_default+0x28/0x30 [ 52.100881] ? detach_if_pending+0x540/0x610 [ 52.105254] panic+0x1e4/0x417 [ 52.108412] ? __warn+0x1d9/0x1d9 [ 52.111834] ? detach_if_pending+0x557/0x610 [ 52.116205] kasan_end_report+0x50/0x50 [ 52.120144] kasan_report+0x144/0x340 [ 52.123909] __asan_report_store8_noabort+0x17/0x20 [ 52.128889] detach_if_pending+0x557/0x610 [ 52.133089] ? trace_raw_output_tick_stop+0x130/0x130 [ 52.138240] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 52.142870] ? lock_timer_base+0x1a3/0x2b0 [ 52.147068] ? lock_timer_base+0x1eb/0x2b0 [ 52.151267] ? __internal_add_timer+0x2d0/0x2d0 [ 52.155902] ? trace_hardirqs_on+0xd/0x10 [ 52.160017] try_to_del_timer_sync+0xa2/0x120 [ 52.164476] ? del_timer+0x130/0x130 [ 52.168156] ? del_timer_sync+0xeb/0x240 [ 52.172183] del_timer_sync+0x18a/0x240 [ 52.176120] tun_free_netdev+0x105/0x1b0 [ 52.180143] ? tun_xdp+0x410/0x410 [ 52.183644] ? cpumask_next+0x24/0x30 [ 52.187410] ? netdev_refcnt_read+0xed/0x150 [ 52.191783] ? tun_xdp+0x410/0x410 [ 52.195287] netdev_run_todo+0x870/0xca0 [ 52.199311] ? do_group_exit+0x149/0x400 [ 52.203336] ? register_netdev+0x30/0x30 [ 52.207362] ? lock_downgrade+0x990/0x990 [ 52.211478] ? trace_hardirqs_on+0xd/0x10 [ 52.215597] ? refcount_sub_and_test+0x115/0x1b0 [ 52.220315] ? refcount_inc+0x50/0x50 [ 52.224079] ? refcount_inc+0x50/0x50 [ 52.227848] ? sk_destruct+0x4c/0x80 [ 52.231528] ? __sk_free+0x5c/0x230 [ 52.235120] ? sk_free+0x2f/0x40 [ 52.238448] ? __tun_detach+0x176/0x1390 [ 52.242486] ? tun_attach+0xf90/0xf90 [ 52.246251] ? do_raw_spin_trylock+0x190/0x190 [ 52.250797] ? locks_remove_file+0x3fa/0x5a0 [ 52.255170] ? fcntl_setlk+0x10d0/0x10d0 [ 52.259195] ? __fsnotify_parent+0xb4/0x3a0 [ 52.263482] ? fsnotify+0x1af0/0x1af0 [ 52.267250] ? __tun_detach+0x1390/0x1390 [ 52.271364] rtnl_unlock+0xe/0x10 [ 52.274783] tun_chr_close+0x49/0x60 [ 52.278461] __fput+0x333/0x7f0 [ 52.281708] ? fput+0x140/0x140 [ 52.284952] ? check_same_owner+0x320/0x320 [ 52.289236] ? _raw_spin_unlock_irq+0x27/0x70 [ 52.293698] ____fput+0x15/0x20 [ 52.296940] task_work_run+0x199/0x270 [ 52.300792] ? task_work_cancel+0x210/0x210 [ 52.305078] ? _raw_spin_unlock+0x22/0x30 [ 52.309189] ? switch_task_namespaces+0x87/0xc0 [ 52.313821] do_exit+0x9d2/0x1af0 [ 52.317242] ? mm_update_next_owner+0x930/0x930 [ 52.321875] ? find_held_lock+0x39/0x1d0 [ 52.325903] ? lock_downgrade+0x990/0x990 [ 52.330026] ? handle_mm_fault+0x410/0x8d0 [ 52.334223] ? __do_page_fault+0x31e/0xd60 [ 52.338423] ? __handle_mm_fault+0x39c0/0x39c0 [ 52.342968] ? vmacache_find+0x5f/0x280 [ 52.346909] ? up_read+0x1a/0x40 [ 52.350238] ? __do_page_fault+0x3d6/0xd60 [ 52.354439] ? mm_fault_error+0x2c0/0x2c0 [ 52.358549] ? do_vfs_ioctl+0x492/0x1530 [ 52.362576] ? do_page_fault+0xee/0x720 [ 52.366513] ? __do_page_fault+0xd60/0xd60 [ 52.370712] ? putname+0xf3/0x130 [ 52.374131] do_group_exit+0x149/0x400 [ 52.377984] ? lockdep_sys_exit+0x47/0xf0 [ 52.382094] ? SyS_exit+0x30/0x30 [ 52.385521] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 52.390505] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 52.395225] SyS_exit_group+0x1d/0x20 [ 52.398990] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 52.403707] RIP: 0033:0x443b88 [ 52.406860] RSP: 002b:00007ffec92df3a8 EFLAGS: 00000246 ORIG_RAX: 00000000000000e7 [ 52.414528] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 0000000000443b88 [ 52.421760] RDX: 0000000000000000 RSI: 000000000000003c RDI: 0000000000000000 [ 52.428992] RBP: 0000000000000086 R08: 00000000000000e7 R09: ffffffffffffffd4