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-386-4,10.128.0.39' (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: [ 29.316246] ================================================================== [ 29.317387] BUG: KASAN: use-after-free in detach_if_pending+0x557/0x610 [ 29.318282] Write of size 8 at addr ffff8801cdea3740 by task syzkaller318145/2983 [ 29.319300] [ 29.319559] CPU: 0 PID: 2983 Comm: syzkaller318145 Not tainted 4.14.0-rc2+ #20 [ 29.320526] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 29.321750] Call Trace: [ 29.322114] dump_stack+0x194/0x257 [ 29.322609] ? arch_local_irq_restore+0x53/0x53 [ 29.323234] ? show_regs_print_info+0x65/0x65 [ 29.323840] ? lock_timer_base+0x1a3/0x2b0 [ 29.324412] ? detach_if_pending+0x557/0x610 [ 29.325006] print_address_description+0x73/0x250 [ 29.325660] ? detach_if_pending+0x557/0x610 [ 29.326256] kasan_report+0x25b/0x340 [ 29.326776] __asan_report_store8_noabort+0x17/0x20 [ 29.327447] detach_if_pending+0x557/0x610 [ 29.328050] ? trace_raw_output_tick_stop+0x130/0x130 [ 29.328746] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 29.329374] ? lock_timer_base+0x1a3/0x2b0 [ 29.329947] ? lock_timer_base+0x1eb/0x2b0 [ 29.330522] ? __internal_add_timer+0x2d0/0x2d0 [ 29.331149] ? trace_hardirqs_on+0xd/0x10 [ 29.331714] try_to_del_timer_sync+0xa2/0x120 [ 29.332317] ? del_timer+0x130/0x130 [ 29.332823] ? del_timer_sync+0xeb/0x240 [ 29.333378] del_timer_sync+0x18a/0x240 [ 29.333920] tun_free_netdev+0x105/0x1b0 [ 29.334472] ? tun_xdp+0x410/0x410 [ 29.334951] ? cpumask_next+0x24/0x30 [ 29.335469] ? netdev_refcnt_read+0xed/0x150 [ 29.336064] ? tun_xdp+0x410/0x410 [ 29.336545] netdev_run_todo+0x870/0xca0 [ 29.340577] ? do_group_exit+0x149/0x400 [ 29.344612] ? register_netdev+0x30/0x30 [ 29.348648] ? lock_downgrade+0x990/0x990 [ 29.352770] ? trace_hardirqs_on+0xd/0x10 [ 29.356907] ? refcount_sub_and_test+0x115/0x1b0 [ 29.361632] ? refcount_inc+0x50/0x50 [ 29.365405] ? refcount_inc+0x50/0x50 [ 29.369179] ? sk_destruct+0x4c/0x80 [ 29.372872] ? __sk_free+0x5c/0x230 [ 29.376473] ? sk_free+0x2f/0x40 [ 29.379808] ? __tun_detach+0x176/0x1390 [ 29.383851] ? tun_attach+0xf90/0xf90 [ 29.387630] ? locks_remove_file+0x3fa/0x5a0 [ 29.392009] ? fcntl_setlk+0x10d0/0x10d0 [ 29.396041] ? __fsnotify_parent+0xb4/0x3a0 [ 29.400333] ? fsnotify+0x1af0/0x1af0 [ 29.404107] ? __tun_detach+0x1390/0x1390 [ 29.408223] ? __tun_detach+0x1390/0x1390 [ 29.412340] rtnl_unlock+0xe/0x10 [ 29.415762] tun_chr_close+0x49/0x60 [ 29.419445] __fput+0x333/0x7f0 [ 29.422699] ? fput+0x140/0x140 [ 29.425949] ? check_same_owner+0x320/0x320 [ 29.430246] ____fput+0x15/0x20 [ 29.433502] task_work_run+0x199/0x270 [ 29.437360] ? task_work_cancel+0x210/0x210 [ 29.441653] ? free_nsproxy+0x185/0x1f0 [ 29.445598] ? switch_task_namespaces+0xa2/0xc0 [ 29.450242] do_exit+0x9d2/0x1af0 [ 29.453662] ? trace_hardirqs_on+0xd/0x10 [ 29.457783] ? mm_update_next_owner+0x930/0x930 [ 29.462424] ? mark_held_locks+0xb2/0x100 [ 29.466541] ? kfree+0xe4/0x250 [ 29.469790] ? kvfree+0x36/0x60 [ 29.473037] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 29.478036] ? trace_hardirqs_on+0xd/0x10 [ 29.482157] ? kvfree+0x3b/0x60 [ 29.485413] ? rtnl_unlock+0xe/0x10 [ 29.489007] ? __tun_chr_ioctl+0x27a/0x3d20 [ 29.493319] ? __might_sleep+0x95/0x190 [ 29.497261] ? __fd_install+0x2f7/0x6a0 [ 29.501216] ? selinux_file_ioctl+0x444/0x690 [ 29.505676] ? __fget_light+0x29d/0x390 [ 29.509628] ? putname+0xee/0x130 [ 29.513053] ? putname+0xee/0x130 [ 29.516476] ? rcu_read_lock_sched_held+0x108/0x120 [ 29.521467] ? tun_chr_compat_ioctl+0x29/0x30 [ 29.525928] ? tun_chr_compat_ioctl+0x29/0x30 [ 29.530397] do_group_exit+0x149/0x400 [ 29.534252] ? __tun_chr_ioctl+0x3d20/0x3d20 [ 29.538630] ? SyS_exit+0x30/0x30 [ 29.542052] ? do_ioctl+0x60/0x60 [ 29.545478] ? do_fast_syscall_32+0x158/0xf05 [ 29.549945] ? do_group_exit+0x400/0x400 [ 29.553975] SyS_exit_group+0x1d/0x20 [ 29.557744] do_fast_syscall_32+0x3f2/0xf05 [ 29.562040] ? do_int80_syscall_32+0x940/0x940 [ 29.566589] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 29.571317] ? lockdep_sys_exit+0x47/0xf0 [ 29.575435] ? syscall_return_slowpath+0x2b3/0x510 [ 29.580339] ? sysret32_from_system_call+0x5/0x3b [ 29.585156] ? trace_hardirqs_off_thunk+0x1a/0x1c [ 29.589974] entry_SYSENTER_compat+0x51/0x60 [ 29.594353] RIP: 0023:0xf7ff5c79 [ 29.597688] RSP: 002b:00000000ffc705fc EFLAGS: 00000286 ORIG_RAX: 00000000000000fc [ 29.605371] RAX: ffffffffffffffda RBX: 0000000000000001 RCX: 00000000ffc707e8 [ 29.612608] RDX: 0000000008048c9a RSI: 0000000000000036 RDI: 0000000000000004 [ 29.619846] RBP: 00000000400454ca R08: 0000000000000000 R09: 0000000000000000 [ 29.627083] R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000000 [ 29.634321] R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 [ 29.641584] [ 29.643183] Allocated by task 2983: [ 29.646782] save_stack_trace+0x16/0x20 [ 29.650725] save_stack+0x43/0xd0 [ 29.654148] kasan_kmalloc+0xad/0xe0 [ 29.657829] __kmalloc_node+0x47/0x70 [ 29.661597] kvmalloc_node+0x64/0xd0 [ 29.665282] alloc_netdev_mqs+0x16e/0xed0 [ 29.669397] __tun_chr_ioctl+0x12be/0x3d20 [ 29.673598] tun_chr_compat_ioctl+0x29/0x30 [ 29.677887] compat_SyS_ioctl+0x1d7/0x3290 [ 29.682090] do_fast_syscall_32+0x3f2/0xf05 [ 29.686383] entry_SYSENTER_compat+0x51/0x60 [ 29.690755] [ 29.692351] Freed by task 2983: [ 29.695601] save_stack_trace+0x16/0x20 [ 29.699544] save_stack+0x43/0xd0 [ 29.702975] kasan_slab_free+0x71/0xc0 [ 29.706830] kfree+0xca/0x250 [ 29.709902] kvfree+0x36/0x60 [ 29.712980] free_netdev+0x2cf/0x360 [ 29.716660] __tun_chr_ioctl+0x2cf6/0x3d20 [ 29.720861] tun_chr_compat_ioctl+0x29/0x30 [ 29.725148] compat_SyS_ioctl+0x1d7/0x3290 [ 29.729350] do_fast_syscall_32+0x3f2/0xf05 [ 29.733643] entry_SYSENTER_compat+0x51/0x60 [ 29.738015] [ 29.739611] The buggy address belongs to the object at ffff8801cdea0340 [ 29.739611] which belongs to the cache kmalloc-16384 of size 16384 [ 29.752580] The buggy address is located 13312 bytes inside of [ 29.752580] 16384-byte region [ffff8801cdea0340, ffff8801cdea4340) [ 29.764765] The buggy address belongs to the page: [ 29.769660] page:ffffea000737a800 count:1 mapcount:0 mapping:ffff8801cdea0340 index:0x0 compound_mapcount: 0 [ 29.779601] flags: 0x200000000008100(slab|head) [ 29.784247] raw: 0200000000008100 ffff8801cdea0340 0000000000000000 0000000100000001 [ 29.792096] raw: ffffea0007332020 ffff8801dac01c50 ffff8801dac02200 0000000000000000 [ 29.799942] page dumped because: kasan: bad access detected [ 29.805616] [ 29.807211] Memory state around the buggy address: [ 29.812109] ffff8801cdea3600: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 29.819436] ffff8801cdea3680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 29.826760] >ffff8801cdea3700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 29.834084] ^ [ 29.839500] ffff8801cdea3780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 29.846832] ffff8801cdea3800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 29.854157] ================================================================== [ 29.861479] Disabling lock debugging due to kernel taint [ 29.866890] Kernel panic - not syncing: panic_on_warn set ... [ 29.866890] [ 29.874216] CPU: 0 PID: 2983 Comm: syzkaller318145 Tainted: G B 4.14.0-rc2+ #20 [ 29.882750] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 29.892064] Call Trace: [ 29.894615] dump_stack+0x194/0x257 [ 29.898205] ? arch_local_irq_restore+0x53/0x53 [ 29.902838] ? vprintk_default+0x28/0x30 [ 29.906863] ? detach_if_pending+0x4d0/0x610 [ 29.911235] panic+0x1e4/0x417 [ 29.914394] ? __warn+0x1d9/0x1d9 [ 29.917818] ? detach_if_pending+0x557/0x610 [ 29.922188] kasan_end_report+0x50/0x50 [ 29.926123] kasan_report+0x144/0x340 [ 29.929888] __asan_report_store8_noabort+0x17/0x20 [ 29.934864] detach_if_pending+0x557/0x610 [ 29.939065] ? trace_raw_output_tick_stop+0x130/0x130 [ 29.944219] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 29.948865] ? lock_timer_base+0x1a3/0x2b0 [ 29.953061] ? lock_timer_base+0x1eb/0x2b0 [ 29.957264] ? __internal_add_timer+0x2d0/0x2d0 [ 29.961898] ? trace_hardirqs_on+0xd/0x10 [ 29.966013] try_to_del_timer_sync+0xa2/0x120 [ 29.970471] ? del_timer+0x130/0x130 [ 29.974150] ? del_timer_sync+0xeb/0x240 [ 29.978185] del_timer_sync+0x18a/0x240 [ 29.982126] tun_free_netdev+0x105/0x1b0 [ 29.986148] ? tun_xdp+0x410/0x410 [ 29.989649] ? cpumask_next+0x24/0x30 [ 29.993413] ? netdev_refcnt_read+0xed/0x150 [ 29.997785] ? tun_xdp+0x410/0x410 [ 30.001290] netdev_run_todo+0x870/0xca0 [ 30.005317] ? do_group_exit+0x149/0x400 [ 30.009351] ? register_netdev+0x30/0x30 [ 30.013376] ? lock_downgrade+0x990/0x990 [ 30.017486] ? trace_hardirqs_on+0xd/0x10 [ 30.021604] ? refcount_sub_and_test+0x115/0x1b0 [ 30.026324] ? refcount_inc+0x50/0x50 [ 30.030089] ? refcount_inc+0x50/0x50 [ 30.033856] ? sk_destruct+0x4c/0x80 [ 30.037533] ? __sk_free+0x5c/0x230 [ 30.041123] ? sk_free+0x2f/0x40 [ 30.044460] ? __tun_detach+0x176/0x1390 [ 30.048496] ? tun_attach+0xf90/0xf90 [ 30.052264] ? locks_remove_file+0x3fa/0x5a0 [ 30.056635] ? fcntl_setlk+0x10d0/0x10d0 [ 30.060662] ? __fsnotify_parent+0xb4/0x3a0 [ 30.064948] ? fsnotify+0x1af0/0x1af0 [ 30.068711] ? __tun_detach+0x1390/0x1390 [ 30.072820] ? __tun_detach+0x1390/0x1390 [ 30.076932] rtnl_unlock+0xe/0x10 [ 30.080351] tun_chr_close+0x49/0x60 [ 30.084029] __fput+0x333/0x7f0 [ 30.087275] ? fput+0x140/0x140 [ 30.090522] ? check_same_owner+0x320/0x320 [ 30.094809] ____fput+0x15/0x20 [ 30.098055] task_work_run+0x199/0x270 [ 30.101906] ? task_work_cancel+0x210/0x210 [ 30.106191] ? free_nsproxy+0x185/0x1f0 [ 30.110129] ? switch_task_namespaces+0xa2/0xc0 [ 30.114764] do_exit+0x9d2/0x1af0 [ 30.118182] ? trace_hardirqs_on+0xd/0x10 [ 30.122295] ? mm_update_next_owner+0x930/0x930 [ 30.126928] ? mark_held_locks+0xb2/0x100 [ 30.131042] ? kfree+0xe4/0x250 [ 30.134284] ? kvfree+0x36/0x60 [ 30.137529] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 30.142508] ? trace_hardirqs_on+0xd/0x10 [ 30.146621] ? kvfree+0x3b/0x60 [ 30.149866] ? rtnl_unlock+0xe/0x10 [ 30.153456] ? __tun_chr_ioctl+0x27a/0x3d20 [ 30.157755] ? __might_sleep+0x95/0x190 [ 30.161693] ? __fd_install+0x2f7/0x6a0 [ 30.165638] ? selinux_file_ioctl+0x444/0x690 [ 30.170095] ? __fget_light+0x29d/0x390 [ 30.174038] ? putname+0xee/0x130 [ 30.177455] ? putname+0xee/0x130 [ 30.180874] ? rcu_read_lock_sched_held+0x108/0x120 [ 30.185860] ? tun_chr_compat_ioctl+0x29/0x30 [ 30.190322] ? tun_chr_compat_ioctl+0x29/0x30 [ 30.194782] do_group_exit+0x149/0x400 [ 30.198633] ? __tun_chr_ioctl+0x3d20/0x3d20 [ 30.203006] ? SyS_exit+0x30/0x30 [ 30.206428] ? do_ioctl+0x60/0x60 [ 30.209847] ? do_fast_syscall_32+0x158/0xf05 [ 30.214305] ? do_group_exit+0x400/0x400 [ 30.218334] SyS_exit_group+0x1d/0x20 [ 30.222099] do_fast_syscall_32+0x3f2/0xf05 [ 30.226387] ? do_int80_syscall_32+0x940/0x940 [ 30.230933] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 30.235654] ? lockdep_sys_exit+0x47/0xf0 [ 30.239763] ? syscall_return_slowpath+0x2b3/0x510 [ 30.244660] ? sysret32_from_system_call+0x5/0x3b [ 30.249467] ? trace_hardirqs_off_thunk+0x1a/0x1c [ 30.254277] entry_SYSENTER_compat+0x51/0x60 [ 30.258663] RIP: 0023:0xf7ff5c79 [ 30.261997] RSP: 002b:00000000ffc705fc EFLAGS: 00000286 ORIG_RAX: 00000000000000fc [ 30.269666] RAX: ffffffffffffffda RBX: 0000000000000001 RCX: 00000000ffc707e8 [ 30.276900] RDX: 0000000008048c9a RSI: 0000000000000036 RDI: 0000000000000004 [ 30.284133] RBP: 00000000400454ca R08: 0000000000000000 R09: 0000000000000000 [ 30.291371] R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000000 [ 30.298607] R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000