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.0.30' (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: [ 68.364539] ================================================================== [ 68.372020] BUG: KASAN: use-after-free in detach_if_pending+0x557/0x610 [ 68.378755] Write of size 8 at addr ffff8801ce3fb780 by task syzkaller923935/2986 [ 68.386350] [ 68.387958] CPU: 1 PID: 2986 Comm: syzkaller923935 Not tainted 4.14.0-rc4+ #129 [ 68.395372] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 68.404697] Call Trace: [ 68.407262] dump_stack+0x194/0x257 [ 68.410865] ? arch_local_irq_restore+0x53/0x53 [ 68.415507] ? show_regs_print_info+0x65/0x65 [ 68.419974] ? lock_timer_base+0x1a3/0x2b0 [ 68.424184] ? detach_if_pending+0x557/0x610 [ 68.428569] print_address_description+0x73/0x250 [ 68.433383] ? detach_if_pending+0x557/0x610 [ 68.437765] kasan_report+0x25b/0x340 [ 68.441540] __asan_report_store8_noabort+0x17/0x20 [ 68.446529] detach_if_pending+0x557/0x610 [ 68.450737] ? trace_raw_output_tick_stop+0x130/0x130 [ 68.455902] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 68.460538] ? lock_timer_base+0x1a3/0x2b0 [ 68.464743] ? lock_timer_base+0x1eb/0x2b0 [ 68.468955] ? __internal_add_timer+0x2d0/0x2d0 [ 68.473596] ? trace_hardirqs_on+0xd/0x10 [ 68.477722] try_to_del_timer_sync+0xa2/0x120 [ 68.482189] ? del_timer+0x130/0x130 [ 68.485879] ? del_timer_sync+0xeb/0x240 [ 68.489917] del_timer_sync+0x18a/0x240 [ 68.493867] tun_free_netdev+0x105/0x1b0 [ 68.497902] ? tun_xdp+0x410/0x410 [ 68.501413] ? cpumask_next+0x24/0x30 [ 68.505188] ? netdev_refcnt_read+0xed/0x150 [ 68.509571] ? tun_xdp+0x410/0x410 [ 68.513084] netdev_run_todo+0x870/0xca0 [ 68.517117] ? do_group_exit+0x149/0x400 [ 68.521154] ? register_netdev+0x30/0x30 [ 68.525190] ? lock_downgrade+0x990/0x990 [ 68.529311] ? trace_hardirqs_on+0xd/0x10 [ 68.533447] ? refcount_sub_and_test+0x115/0x1b0 [ 68.538175] ? refcount_inc+0x50/0x50 [ 68.541950] ? refcount_inc+0x50/0x50 [ 68.545728] ? sk_destruct+0x4c/0x80 [ 68.549416] ? __sk_free+0x5c/0x230 [ 68.553015] ? sk_free+0x2f/0x40 [ 68.556355] ? __tun_detach+0x176/0x1390 [ 68.560399] ? tun_attach+0xf90/0xf90 [ 68.564183] ? locks_remove_file+0x3fa/0x5a0 [ 68.568565] ? fcntl_setlk+0x10d0/0x10d0 [ 68.572601] ? __fsnotify_parent+0xb4/0x3a0 [ 68.576896] ? fsnotify+0x1af0/0x1af0 [ 68.580676] ? __tun_detach+0x1390/0x1390 [ 68.584797] rtnl_unlock+0xe/0x10 [ 68.588221] tun_chr_close+0x49/0x60 [ 68.591907] __fput+0x333/0x7f0 [ 68.595165] ? fput+0x140/0x140 [ 68.598419] ? check_same_owner+0x320/0x320 [ 68.602720] ____fput+0x15/0x20 [ 68.605973] task_work_run+0x199/0x270 [ 68.609836] ? task_work_cancel+0x210/0x210 [ 68.614131] ? free_nsproxy+0x185/0x1f0 [ 68.618077] ? switch_task_namespaces+0xa2/0xc0 [ 68.622725] do_exit+0x9d2/0x1af0 [ 68.626163] ? mm_update_next_owner+0x930/0x930 [ 68.630811] ? find_held_lock+0x39/0x1d0 [ 68.634858] ? lock_downgrade+0x990/0x990 [ 68.639001] ? handle_mm_fault+0x410/0x8d0 [ 68.643210] ? __do_page_fault+0x31e/0xd60 [ 68.647417] ? __handle_mm_fault+0x39c0/0x39c0 [ 68.651974] ? vmacache_find+0x5f/0x280 [ 68.655927] ? up_read+0x1a/0x40 [ 68.659266] ? __do_page_fault+0x3d6/0xd60 [ 68.663483] ? mm_fault_error+0x2c0/0x2c0 [ 68.667604] ? do_vfs_ioctl+0x492/0x1530 [ 68.671648] ? do_page_fault+0xee/0x720 [ 68.675596] ? __do_page_fault+0xd60/0xd60 [ 68.679806] ? putname+0xf3/0x130 [ 68.683239] do_group_exit+0x149/0x400 [ 68.687101] ? lockdep_sys_exit+0x47/0xf0 [ 68.691220] ? SyS_exit+0x30/0x30 [ 68.694657] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 68.699647] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 68.704379] SyS_exit_group+0x1d/0x20 [ 68.708156] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 68.712883] RIP: 0033:0x445149 [ 68.716046] RSP: 002b:00000000007efe48 EFLAGS: 00000206 ORIG_RAX: 00000000000000e7 [ 68.724434] RAX: ffffffffffffffda RBX: 90e71030b3d5894a RCX: 0000000000445149 [ 68.731680] RDX: 0000000000445149 RSI: 0000000020927fd8 RDI: 0000000000000001 [ 68.738922] RBP: 0000000000000086 R08: 0000000000000000 R09: 0000000000000000 [ 68.746161] R10: 0000000000000000 R11: 0000000000000206 R12: 00000000004027a0 [ 68.753402] R13: 0000000000402830 R14: 0000000000000000 R15: 0000000000000000 [ 68.760665] [ 68.762268] Allocated by task 2986: [ 68.765878] save_stack_trace+0x16/0x20 [ 68.769829] save_stack+0x43/0xd0 [ 68.773253] kasan_kmalloc+0xad/0xe0 [ 68.776937] __kmalloc_node+0x47/0x70 [ 68.780710] kvmalloc_node+0x64/0xd0 [ 68.784398] alloc_netdev_mqs+0x16e/0xed0 [ 68.788516] __tun_chr_ioctl+0x12be/0x3d20 [ 68.792717] tun_chr_ioctl+0x2a/0x40 [ 68.796406] do_vfs_ioctl+0x1b1/0x1530 [ 68.800263] SyS_ioctl+0x8f/0xc0 [ 68.803600] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 68.808322] [ 68.809922] Freed by task 2986: [ 68.813170] save_stack_trace+0x16/0x20 [ 68.817114] save_stack+0x43/0xd0 [ 68.820538] kasan_slab_free+0x71/0xc0 [ 68.824396] kfree+0xca/0x250 [ 68.827471] kvfree+0x36/0x60 [ 68.830549] free_netdev+0x2cf/0x360 [ 68.834232] __tun_chr_ioctl+0x2cf6/0x3d20 [ 68.838434] tun_chr_ioctl+0x2a/0x40 [ 68.842117] do_vfs_ioctl+0x1b1/0x1530 [ 68.845972] SyS_ioctl+0x8f/0xc0 [ 68.849307] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 68.854031] [ 68.855632] The buggy address belongs to the object at ffff8801ce3f8380 [ 68.855632] which belongs to the cache kmalloc-16384 of size 16384 [ 68.868606] The buggy address is located 13312 bytes inside of [ 68.868606] 16384-byte region [ffff8801ce3f8380, ffff8801ce3fc380) [ 68.880799] The buggy address belongs to the page: [ 68.885701] page:ffffea000738fe00 count:1 mapcount:0 mapping:ffff8801ce3f8380 index:0x0 compound_mapcount: 0 [ 68.895652] flags: 0x200000000008100(slab|head) [ 68.900292] raw: 0200000000008100 ffff8801ce3f8380 0000000000000000 0000000100000001 [ 68.908144] raw: ffffea0007389c20 ffff8801dac01c50 ffff8801dac02200 0000000000000000 [ 68.915994] page dumped because: kasan: bad access detected [ 68.921670] [ 68.923268] Memory state around the buggy address: [ 68.928167] ffff8801ce3fb680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 68.935498] ffff8801ce3fb700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 68.942829] >ffff8801ce3fb780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 68.950156] ^ [ 68.953490] ffff8801ce3fb800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 68.960820] ffff8801ce3fb880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 68.968148] ================================================================== [ 68.975472] Disabling lock debugging due to kernel taint [ 68.980888] Kernel panic - not syncing: panic_on_warn set ... [ 68.980888] [ 68.988215] CPU: 1 PID: 2986 Comm: syzkaller923935 Tainted: G B 4.14.0-rc4+ #129 [ 68.996839] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 69.006157] Call Trace: [ 69.008719] dump_stack+0x194/0x257 [ 69.012313] ? arch_local_irq_restore+0x53/0x53 [ 69.016947] ? vprintk_default+0x28/0x30 [ 69.020978] ? detach_if_pending+0x540/0x610 [ 69.025353] panic+0x1e4/0x417 [ 69.028513] ? __warn+0x1d9/0x1d9 [ 69.031939] ? detach_if_pending+0x557/0x610 [ 69.036315] kasan_end_report+0x50/0x50 [ 69.040253] kasan_report+0x144/0x340 [ 69.044021] __asan_report_store8_noabort+0x17/0x20 [ 69.049000] detach_if_pending+0x557/0x610 [ 69.053202] ? trace_raw_output_tick_stop+0x130/0x130 [ 69.058360] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 69.062991] ? lock_timer_base+0x1a3/0x2b0 [ 69.067189] ? lock_timer_base+0x1eb/0x2b0 [ 69.071390] ? __internal_add_timer+0x2d0/0x2d0 [ 69.076025] ? trace_hardirqs_on+0xd/0x10 [ 69.080141] try_to_del_timer_sync+0xa2/0x120 [ 69.084599] ? del_timer+0x130/0x130 [ 69.088278] ? del_timer_sync+0xeb/0x240 [ 69.092306] del_timer_sync+0x18a/0x240 [ 69.096248] tun_free_netdev+0x105/0x1b0 [ 69.100273] ? tun_xdp+0x410/0x410 [ 69.103777] ? cpumask_next+0x24/0x30 [ 69.107545] ? netdev_refcnt_read+0xed/0x150 [ 69.111919] ? tun_xdp+0x410/0x410 [ 69.115423] netdev_run_todo+0x870/0xca0 [ 69.119450] ? do_group_exit+0x149/0x400 [ 69.123478] ? register_netdev+0x30/0x30 [ 69.127504] ? lock_downgrade+0x990/0x990 [ 69.131618] ? trace_hardirqs_on+0xd/0x10 [ 69.135741] ? refcount_sub_and_test+0x115/0x1b0 [ 69.140460] ? refcount_inc+0x50/0x50 [ 69.144225] ? refcount_inc+0x50/0x50 [ 69.147995] ? sk_destruct+0x4c/0x80 [ 69.151674] ? __sk_free+0x5c/0x230 [ 69.155265] ? sk_free+0x2f/0x40 [ 69.158598] ? __tun_detach+0x176/0x1390 [ 69.162630] ? tun_attach+0xf90/0xf90 [ 69.166401] ? locks_remove_file+0x3fa/0x5a0 [ 69.170778] ? fcntl_setlk+0x10d0/0x10d0 [ 69.174806] ? __fsnotify_parent+0xb4/0x3a0 [ 69.179092] ? fsnotify+0x1af0/0x1af0 [ 69.183018] ? __tun_detach+0x1390/0x1390 [ 69.187133] rtnl_unlock+0xe/0x10 [ 69.190552] tun_chr_close+0x49/0x60 [ 69.194232] __fput+0x333/0x7f0 [ 69.197480] ? fput+0x140/0x140 [ 69.200728] ? check_same_owner+0x320/0x320 [ 69.205018] ____fput+0x15/0x20 [ 69.208265] task_work_run+0x199/0x270 [ 69.212119] ? task_work_cancel+0x210/0x210 [ 69.216407] ? free_nsproxy+0x185/0x1f0 [ 69.220346] ? switch_task_namespaces+0xa2/0xc0 [ 69.224980] do_exit+0x9d2/0x1af0 [ 69.228400] ? mm_update_next_owner+0x930/0x930 [ 69.233035] ? find_held_lock+0x39/0x1d0 [ 69.237066] ? lock_downgrade+0x990/0x990 [ 69.241190] ? handle_mm_fault+0x410/0x8d0 [ 69.245392] ? __do_page_fault+0x31e/0xd60 [ 69.249591] ? __handle_mm_fault+0x39c0/0x39c0 [ 69.254140] ? vmacache_find+0x5f/0x280 [ 69.258091] ? up_read+0x1a/0x40 [ 69.261423] ? __do_page_fault+0x3d6/0xd60 [ 69.265628] ? mm_fault_error+0x2c0/0x2c0 [ 69.269741] ? do_vfs_ioctl+0x492/0x1530 [ 69.273773] ? do_page_fault+0xee/0x720 [ 69.277714] ? __do_page_fault+0xd60/0xd60 [ 69.281913] ? putname+0xf3/0x130 [ 69.285333] do_group_exit+0x149/0x400 [ 69.289185] ? lockdep_sys_exit+0x47/0xf0 [ 69.293296] ? SyS_exit+0x30/0x30 [ 69.296715] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 69.301701] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 69.306423] SyS_exit_group+0x1d/0x20 [ 69.310189] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 69.314908] RIP: 0033:0x445149 [ 69.318064] RSP: 002b:00000000007efe48 EFLAGS: 00000206 ORIG_RAX: 00000000000000e7 [ 69.325737] RAX: ffffffffffffffda RBX: 90e71030b3d5894a RCX: 0000000000445149 [ 69.332974] RDX: 0000000000445149 RSI: 0000000020927fd8 RDI: 0000000000000001 [ 69.340210] RBP: 0000000000000086 R08: 0000000000000000 R09: 0000000000000000 [ 69.347446] R10: 0000000000000000 R11: 0000000000000206 R12: 00000000004027a0 [ 69.354682] R13: 0000000000402830 R14: 0000000000000000 R15: 0000000000000000