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-0,10.128.0.31' (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: [ 52.185254] ================================================================== [ 52.192675] BUG: KASAN: use-after-free in detach_if_pending+0x557/0x610 [ 52.199398] Write of size 8 at addr ffff8801ccfeb740 by task syzkaller407269/2983 [ 52.206987] [ 52.208586] CPU: 1 PID: 2983 Comm: syzkaller407269 Not tainted 4.14.0-rc3+ #30 [ 52.215914] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 52.225238] Call Trace: [ 52.227806] dump_stack+0x194/0x257 [ 52.231411] ? arch_local_irq_restore+0x53/0x53 [ 52.236057] ? show_regs_print_info+0x65/0x65 [ 52.240529] ? lock_timer_base+0x1a3/0x2b0 [ 52.244736] ? detach_if_pending+0x557/0x610 [ 52.249120] print_address_description+0x73/0x250 [ 52.253936] ? detach_if_pending+0x557/0x610 [ 52.258315] kasan_report+0x25b/0x340 [ 52.262091] __asan_report_store8_noabort+0x17/0x20 [ 52.267076] detach_if_pending+0x557/0x610 [ 52.271285] ? trace_raw_output_tick_stop+0x130/0x130 [ 52.276445] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 52.281082] ? lock_timer_base+0x1a3/0x2b0 [ 52.285289] ? lock_timer_base+0x1eb/0x2b0 [ 52.289497] ? __internal_add_timer+0x2d0/0x2d0 [ 52.294139] ? trace_hardirqs_on+0xd/0x10 [ 52.298266] try_to_del_timer_sync+0xa2/0x120 [ 52.302730] ? del_timer+0x130/0x130 [ 52.306415] ? del_timer_sync+0xeb/0x240 [ 52.310454] del_timer_sync+0x18a/0x240 [ 52.314404] tun_free_netdev+0x105/0x1b0 [ 52.318437] ? tun_xdp+0x410/0x410 [ 52.321946] ? cpumask_next+0x24/0x30 [ 52.325719] ? netdev_refcnt_read+0xed/0x150 [ 52.330100] ? tun_xdp+0x410/0x410 [ 52.333610] netdev_run_todo+0x870/0xca0 [ 52.337641] ? do_group_exit+0x149/0x400 [ 52.341676] ? register_netdev+0x30/0x30 [ 52.345709] ? lock_downgrade+0x990/0x990 [ 52.349825] ? trace_hardirqs_on+0xd/0x10 [ 52.353960] ? refcount_sub_and_test+0x115/0x1b0 [ 52.358685] ? refcount_inc+0x50/0x50 [ 52.362456] ? refcount_inc+0x50/0x50 [ 52.366235] ? sk_destruct+0x4c/0x80 [ 52.369920] ? __sk_free+0x5c/0x230 [ 52.373520] ? sk_free+0x2f/0x40 [ 52.376854] ? __tun_detach+0x176/0x1390 [ 52.380897] ? tun_attach+0xf90/0xf90 [ 52.384671] ? do_raw_spin_trylock+0x190/0x190 [ 52.389223] ? locks_remove_file+0x3fa/0x5a0 [ 52.393605] ? fcntl_setlk+0x10d0/0x10d0 [ 52.397638] ? __fsnotify_parent+0xb4/0x3a0 [ 52.401932] ? fsnotify+0x1af0/0x1af0 [ 52.405707] ? __tun_detach+0x1390/0x1390 [ 52.409826] ? __tun_detach+0x1390/0x1390 [ 52.413946] rtnl_unlock+0xe/0x10 [ 52.417370] tun_chr_close+0x49/0x60 [ 52.421054] __fput+0x333/0x7f0 [ 52.424309] ? fput+0x140/0x140 [ 52.427564] ? check_same_owner+0x320/0x320 [ 52.431852] ? _raw_spin_unlock_irq+0x27/0x70 [ 52.436324] ____fput+0x15/0x20 [ 52.439573] task_work_run+0x199/0x270 [ 52.443433] ? task_work_cancel+0x210/0x210 [ 52.447724] ? _raw_spin_unlock+0x22/0x30 [ 52.451848] ? switch_task_namespaces+0x87/0xc0 [ 52.456495] do_exit+0x9d2/0x1af0 [ 52.459925] ? __handle_mm_fault+0xf07/0x39c0 [ 52.464398] ? mm_update_next_owner+0x930/0x930 [ 52.469036] ? lock_release+0xd70/0xd70 [ 52.472983] ? check_noncircular+0x20/0x20 [ 52.477191] ? kfree+0xe4/0x250 [ 52.480440] ? kvfree+0x36/0x60 [ 52.483700] ? check_noncircular+0x20/0x20 [ 52.487910] ? __handle_mm_fault+0x587/0x39c0 [ 52.492383] ? __pmd_alloc+0x4e0/0x4e0 [ 52.496253] ? find_held_lock+0x39/0x1d0 [ 52.500298] ? lock_downgrade+0x990/0x990 [ 52.504440] ? handle_mm_fault+0x410/0x8d0 [ 52.508648] ? down_read_trylock+0xdb/0x170 [ 52.512941] ? __do_page_fault+0x31e/0xd60 [ 52.517146] ? __handle_mm_fault+0x39c0/0x39c0 [ 52.521696] ? vmacache_find+0x5f/0x280 [ 52.525639] ? vmacache_update+0xfe/0x130 [ 52.529765] do_group_exit+0x149/0x400 [ 52.533624] ? __do_page_fault+0x3d6/0xd60 [ 52.537833] ? __tun_chr_ioctl+0x3d20/0x3d20 [ 52.542223] ? SyS_exit+0x30/0x30 [ 52.545656] ? do_fast_syscall_32+0x158/0xf05 [ 52.550120] ? do_group_exit+0x400/0x400 [ 52.554151] SyS_exit_group+0x1d/0x20 [ 52.557925] do_fast_syscall_32+0x3f2/0xf05 [ 52.562223] ? do_int80_syscall_32+0x940/0x940 [ 52.566779] ? kasan_check_read+0x11/0x20 [ 52.570900] ? syscall_return_slowpath+0x510/0x510 [ 52.575802] ? SyS_rt_sigaction+0x94/0x1b0 [ 52.580011] ? lockdep_sys_exit+0x47/0xf0 [ 52.584137] ? retint_user+0x18/0x20 [ 52.587828] ? trace_hardirqs_off_thunk+0x1a/0x1c [ 52.592646] entry_SYSENTER_compat+0x51/0x60 [ 52.597110] RIP: 0023:0xf7fd5c79 [ 52.600444] RSP: 002b:00000000ffd050bc EFLAGS: 00000296 ORIG_RAX: 00000000000000fc [ 52.608125] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00000000080f1298 [ 52.615365] RDX: 0000000000000000 RSI: 00000000080daa98 RDI: 00000000080f12a0 [ 52.622604] RBP: 0000000000000001 R08: 0000000000000000 R09: 0000000000000000 [ 52.629842] R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000000 [ 52.637084] R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 [ 52.645034] [ 52.646635] Allocated by task 2983: [ 52.650237] save_stack_trace+0x16/0x20 [ 52.654180] save_stack+0x43/0xd0 [ 52.657605] kasan_kmalloc+0xad/0xe0 [ 52.661289] __kmalloc_node+0x47/0x70 [ 52.665062] kvmalloc_node+0x64/0xd0 [ 52.668746] alloc_netdev_mqs+0x16e/0xed0 [ 52.672862] __tun_chr_ioctl+0x12be/0x3d20 [ 52.677073] tun_chr_compat_ioctl+0x29/0x30 [ 52.681365] compat_SyS_ioctl+0x1d7/0x3290 [ 52.685569] do_fast_syscall_32+0x3f2/0xf05 [ 52.689859] entry_SYSENTER_compat+0x51/0x60 [ 52.694234] [ 52.695829] Freed by task 2983: [ 52.699077] save_stack_trace+0x16/0x20 [ 52.703022] save_stack+0x43/0xd0 [ 52.706441] kasan_slab_free+0x71/0xc0 [ 52.710295] kfree+0xca/0x250 [ 52.713370] kvfree+0x36/0x60 [ 52.716443] free_netdev+0x2cf/0x360 [ 52.720123] __tun_chr_ioctl+0x2cf6/0x3d20 [ 52.724324] tun_chr_compat_ioctl+0x29/0x30 [ 52.728613] compat_SyS_ioctl+0x1d7/0x3290 [ 52.732814] do_fast_syscall_32+0x3f2/0xf05 [ 52.737101] entry_SYSENTER_compat+0x51/0x60 [ 52.741473] [ 52.743071] The buggy address belongs to the object at ffff8801ccfe8340 [ 52.743071] which belongs to the cache kmalloc-16384 of size 16384 [ 52.756039] The buggy address is located 13312 bytes inside of [ 52.756039] 16384-byte region [ffff8801ccfe8340, ffff8801ccfec340) [ 52.768228] The buggy address belongs to the page: [ 52.773125] page:ffffea000733fa00 count:1 mapcount:0 mapping:ffff8801ccfe8340 index:0x0 compound_mapcount: 0 [ 52.783067] flags: 0x200000000008100(slab|head) [ 52.787708] raw: 0200000000008100 ffff8801ccfe8340 0000000000000000 0000000100000001 [ 52.795555] raw: ffffea000735ea20 ffff8801dac01c50 ffff8801dac02200 0000000000000000 [ 52.803400] page dumped because: kasan: bad access detected [ 52.809075] [ 52.810669] Memory state around the buggy address: [ 52.815563] ffff8801ccfeb600: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 52.822892] ffff8801ccfeb680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 52.830218] >ffff8801ccfeb700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 52.837543] ^ [ 52.842959] ffff8801ccfeb780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 52.850286] ffff8801ccfeb800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 52.857612] ================================================================== [ 52.864935] Disabling lock debugging due to kernel taint [ 52.870348] Kernel panic - not syncing: panic_on_warn set ... [ 52.870348] [ 52.877674] CPU: 1 PID: 2983 Comm: syzkaller407269 Tainted: G B 4.14.0-rc3+ #30 [ 52.886215] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 52.895532] Call Trace: [ 52.898087] dump_stack+0x194/0x257 [ 52.901679] ? arch_local_irq_restore+0x53/0x53 [ 52.906311] ? vprintk_default+0x28/0x30 [ 52.910338] ? detach_if_pending+0x540/0x610 [ 52.914711] panic+0x1e4/0x417 [ 52.917866] ? __warn+0x1d9/0x1d9 [ 52.921290] ? detach_if_pending+0x557/0x610 [ 52.925661] kasan_end_report+0x50/0x50 [ 52.929596] kasan_report+0x144/0x340 [ 52.933364] __asan_report_store8_noabort+0x17/0x20 [ 52.938342] detach_if_pending+0x557/0x610 [ 52.942541] ? trace_raw_output_tick_stop+0x130/0x130 [ 52.947694] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 52.952324] ? lock_timer_base+0x1a3/0x2b0 [ 52.956521] ? lock_timer_base+0x1eb/0x2b0 [ 52.960719] ? __internal_add_timer+0x2d0/0x2d0 [ 52.965351] ? trace_hardirqs_on+0xd/0x10 [ 52.969468] try_to_del_timer_sync+0xa2/0x120 [ 52.973927] ? del_timer+0x130/0x130 [ 52.977603] ? del_timer_sync+0xeb/0x240 [ 52.981629] del_timer_sync+0x18a/0x240 [ 52.985568] tun_free_netdev+0x105/0x1b0 [ 52.989592] ? tun_xdp+0x410/0x410 [ 52.993096] ? cpumask_next+0x24/0x30 [ 52.996859] ? netdev_refcnt_read+0xed/0x150 [ 53.001230] ? tun_xdp+0x410/0x410 [ 53.004732] netdev_run_todo+0x870/0xca0 [ 53.008756] ? do_group_exit+0x149/0x400 [ 53.012781] ? register_netdev+0x30/0x30 [ 53.016807] ? lock_downgrade+0x990/0x990 [ 53.020918] ? trace_hardirqs_on+0xd/0x10 [ 53.025040] ? refcount_sub_and_test+0x115/0x1b0 [ 53.029759] ? refcount_inc+0x50/0x50 [ 53.033526] ? refcount_inc+0x50/0x50 [ 53.037302] ? sk_destruct+0x4c/0x80 [ 53.040979] ? __sk_free+0x5c/0x230 [ 53.044568] ? sk_free+0x2f/0x40 [ 53.047897] ? __tun_detach+0x176/0x1390 [ 53.051929] ? tun_attach+0xf90/0xf90 [ 53.055695] ? do_raw_spin_trylock+0x190/0x190 [ 53.060243] ? locks_remove_file+0x3fa/0x5a0 [ 53.064618] ? fcntl_setlk+0x10d0/0x10d0 [ 53.068647] ? __fsnotify_parent+0xb4/0x3a0 [ 53.072931] ? fsnotify+0x1af0/0x1af0 [ 53.076696] ? __tun_detach+0x1390/0x1390 [ 53.080807] ? __tun_detach+0x1390/0x1390 [ 53.084920] rtnl_unlock+0xe/0x10 [ 53.088337] tun_chr_close+0x49/0x60 [ 53.092016] __fput+0x333/0x7f0 [ 53.095263] ? fput+0x140/0x140 [ 53.098507] ? check_same_owner+0x320/0x320 [ 53.102790] ? _raw_spin_unlock_irq+0x27/0x70 [ 53.107252] ____fput+0x15/0x20 [ 53.110495] task_work_run+0x199/0x270 [ 53.114346] ? task_work_cancel+0x210/0x210 [ 53.118630] ? _raw_spin_unlock+0x22/0x30 [ 53.122744] ? switch_task_namespaces+0x87/0xc0 [ 53.127380] do_exit+0x9d2/0x1af0 [ 53.130799] ? __handle_mm_fault+0xf07/0x39c0 [ 53.135261] ? mm_update_next_owner+0x930/0x930 [ 53.139893] ? lock_release+0xd70/0xd70 [ 53.143829] ? check_noncircular+0x20/0x20 [ 53.148026] ? kfree+0xe4/0x250 [ 53.151269] ? kvfree+0x36/0x60 [ 53.154516] ? check_noncircular+0x20/0x20 [ 53.158717] ? __handle_mm_fault+0x587/0x39c0 [ 53.163179] ? __pmd_alloc+0x4e0/0x4e0 [ 53.167035] ? find_held_lock+0x39/0x1d0 [ 53.171069] ? lock_downgrade+0x990/0x990 [ 53.175192] ? handle_mm_fault+0x410/0x8d0 [ 53.179391] ? down_read_trylock+0xdb/0x170 [ 53.183675] ? __do_page_fault+0x31e/0xd60