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-3,10.128.15.214' (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: [ 56.591314] ================================================================== [ 56.598730] BUG: KASAN: use-after-free in detach_if_pending+0x557/0x610 [ 56.605452] Write of size 8 at addr ffff8801ceb63740 by task syzkaller347373/2981 [ 56.613038] [ 56.614637] CPU: 1 PID: 2981 Comm: syzkaller347373 Not tainted 4.13.0+ #85 [ 56.621624] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 56.630951] Call Trace: [ 56.633510] dump_stack+0x194/0x257 [ 56.637111] ? arch_local_irq_restore+0x53/0x53 [ 56.641750] ? show_regs_print_info+0x65/0x65 [ 56.646218] ? lock_timer_base+0x1a3/0x2b0 [ 56.650426] ? detach_if_pending+0x557/0x610 [ 56.654816] print_address_description+0x73/0x250 [ 56.659629] ? detach_if_pending+0x557/0x610 [ 56.664014] kasan_report+0x24e/0x340 [ 56.667789] __asan_report_store8_noabort+0x17/0x20 [ 56.672787] detach_if_pending+0x557/0x610 [ 56.676999] ? trace_raw_output_tick_stop+0x130/0x130 [ 56.682162] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 56.686797] ? lock_timer_base+0x1a3/0x2b0 [ 56.691002] ? lock_timer_base+0x1eb/0x2b0 [ 56.695212] ? __internal_add_timer+0x2d0/0x2d0 [ 56.699857] ? trace_hardirqs_on+0xd/0x10 [ 56.703984] try_to_del_timer_sync+0xa2/0x120 [ 56.708448] ? del_timer+0x130/0x130 [ 56.712143] ? del_timer_sync+0xeb/0x240 [ 56.716183] del_timer_sync+0x18a/0x240 [ 56.720131] tun_free_netdev+0x105/0x1b0 [ 56.724164] ? tun_xdp+0x410/0x410 [ 56.727674] ? cpumask_next+0x24/0x30 [ 56.731449] ? netdev_refcnt_read+0xed/0x150 [ 56.735838] ? tun_xdp+0x410/0x410 [ 56.739349] netdev_run_todo+0x870/0xca0 [ 56.743391] ? do_group_exit+0x149/0x400 [ 56.747426] ? register_netdev+0x30/0x30 [ 56.751459] ? lock_downgrade+0x990/0x990 [ 56.755579] ? trace_hardirqs_on+0xd/0x10 [ 56.759712] ? refcount_sub_and_test+0x115/0x1b0 [ 56.764440] ? refcount_inc+0x50/0x50 [ 56.768210] ? refcount_inc+0x50/0x50 [ 56.771987] ? sk_destruct+0x4c/0x80 [ 56.775670] ? __sk_free+0x5c/0x230 [ 56.779267] ? sk_free+0x2f/0x40 [ 56.782603] ? __tun_detach+0x176/0x1390 [ 56.786645] ? tun_attach+0xf90/0xf90 [ 56.790419] ? do_raw_spin_trylock+0x190/0x190 [ 56.794973] ? locks_remove_file+0x3fa/0x5a0 [ 56.799352] ? fcntl_setlk+0x10d0/0x10d0 [ 56.803387] ? __fsnotify_parent+0xb4/0x3a0 [ 56.807680] ? fsnotify+0x1af0/0x1af0 [ 56.811454] ? __tun_detach+0x1390/0x1390 [ 56.815573] ? __tun_detach+0x1390/0x1390 [ 56.819692] rtnl_unlock+0xe/0x10 [ 56.823121] tun_chr_close+0x49/0x60 [ 56.826808] __fput+0x333/0x7f0 [ 56.830073] ? fput+0x140/0x140 [ 56.833325] ? check_same_owner+0x320/0x320 [ 56.837615] ? _raw_spin_unlock_irq+0x27/0x70 [ 56.842086] ____fput+0x15/0x20 [ 56.845338] task_work_run+0x199/0x270 [ 56.849199] ? task_work_cancel+0x210/0x210 [ 56.853491] ? _raw_spin_unlock+0x22/0x30 [ 56.857610] ? switch_task_namespaces+0x87/0xc0 [ 56.862257] do_exit+0xa52/0x1b40 [ 56.865684] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 56.870675] ? check_noncircular+0x20/0x20 [ 56.874889] ? mm_update_next_owner+0x930/0x930 [ 56.879531] ? __pmd_alloc+0x4e0/0x4e0 [ 56.883418] ? find_held_lock+0x39/0x1d0 [ 56.887462] ? lock_downgrade+0x990/0x990 [ 56.891601] ? handle_mm_fault+0x410/0x8d0 [ 56.895804] ? down_read_trylock+0xdb/0x170 [ 56.900108] ? __handle_mm_fault+0x39c0/0x39c0 [ 56.904661] ? vmacache_find+0x61/0x270 [ 56.908620] ? up_read+0x1a/0x40 [ 56.911958] ? __do_page_fault+0x35b/0xb60 [ 56.916163] ? do_vfs_ioctl+0x492/0x1530 [ 56.920202] ? do_page_fault+0xee/0x720 [ 56.924149] ? __do_page_fault+0xb60/0xb60 [ 56.928354] ? putname+0xf3/0x130 [ 56.931785] do_group_exit+0x149/0x400 [ 56.935644] ? lockdep_sys_exit+0x47/0xf0 [ 56.939762] ? SyS_exit+0x30/0x30 [ 56.943186] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 56.948173] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 56.952902] SyS_exit_group+0x1d/0x20 [ 56.956677] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 56.961401] RIP: 0033:0x443a48 [ 56.964560] RSP: 002b:00007ffdfa1f5198 EFLAGS: 00000246 ORIG_RAX: 00000000000000e7 [ 56.972240] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 0000000000443a48 [ 56.979480] RDX: 0000000000000000 RSI: 000000000000003c RDI: 0000000000000000 [ 56.986719] RBP: 0000000000000082 R08: 00000000000000e7 R09: ffffffffffffffd4 [ 56.993959] R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000001 [ 57.001533] R13: 00000000006d6180 R14: 0000000000000000 R15: 0000000000000000 [ 57.008808] [ 57.010410] Allocated by task 2981: [ 57.014009] save_stack_trace+0x16/0x20 [ 57.017955] save_stack+0x43/0xd0 [ 57.021379] kasan_kmalloc+0xad/0xe0 [ 57.025059] __kmalloc_node+0x47/0x70 [ 57.028828] kvmalloc_node+0x64/0xd0 [ 57.032515] alloc_netdev_mqs+0x16e/0xed0 [ 57.036630] __tun_chr_ioctl+0x12be/0x3d20 [ 57.040842] tun_chr_ioctl+0x2a/0x40 [ 57.044524] do_vfs_ioctl+0x1b1/0x1530 [ 57.048376] SyS_ioctl+0x8f/0xc0 [ 57.051713] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 57.056434] [ 57.058030] Freed by task 2981: [ 57.061283] save_stack_trace+0x16/0x20 [ 57.065229] save_stack+0x43/0xd0 [ 57.068650] kasan_slab_free+0x71/0xc0 [ 57.072505] kfree+0xca/0x250 [ 57.075581] kvfree+0x36/0x60 [ 57.078657] free_netdev+0x2cf/0x360 [ 57.082338] __tun_chr_ioctl+0x2cf6/0x3d20 [ 57.086538] tun_chr_ioctl+0x2a/0x40 [ 57.090219] do_vfs_ioctl+0x1b1/0x1530 [ 57.094075] SyS_ioctl+0x8f/0xc0 [ 57.097409] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 57.102128] [ 57.103727] The buggy address belongs to the object at ffff8801ceb60340 [ 57.103727] which belongs to the cache kmalloc-16384 of size 16384 [ 57.116703] The buggy address is located 13312 bytes inside of [ 57.116703] 16384-byte region [ffff8801ceb60340, ffff8801ceb64340) [ 57.128893] The buggy address belongs to the page: [ 57.133792] page:ffffea00073ad800 count:1 mapcount:0 mapping:ffff8801ceb60340 index:0x0 compound_mapcount: 0 [ 57.143736] flags: 0x200000000008100(slab|head) [ 57.148373] raw: 0200000000008100 ffff8801ceb60340 0000000000000000 0000000100000001 [ 57.156222] raw: ffffea000737a420 ffff8801dac01c50 ffff8801dac02200 0000000000000000 [ 57.164070] page dumped because: kasan: bad access detected [ 57.169745] [ 57.171341] Memory state around the buggy address: [ 57.176243] ffff8801ceb63600: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 57.183569] ffff8801ceb63680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 57.190899] >ffff8801ceb63700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 57.198253] ^ [ 57.203679] ffff8801ceb63780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 57.211009] ffff8801ceb63800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 57.218334] ================================================================== [ 57.225659] Disabling lock debugging due to kernel taint [ 57.231070] Kernel panic - not syncing: panic_on_warn set ... [ 57.231070] [ 57.238394] CPU: 1 PID: 2981 Comm: syzkaller347373 Tainted: G B 4.13.0+ #85 [ 57.246583] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 57.255900] Call Trace: [ 57.258455] dump_stack+0x194/0x257 [ 57.262046] ? arch_local_irq_restore+0x53/0x53 [ 57.266681] ? vprintk_default+0x28/0x30 [ 57.270711] ? detach_if_pending+0x500/0x610 [ 57.275084] panic+0x1e4/0x417 [ 57.278239] ? __warn+0x1d9/0x1d9 [ 57.281661] ? detach_if_pending+0x557/0x610 [ 57.286032] kasan_end_report+0x50/0x50 [ 57.289967] kasan_report+0x137/0x340 [ 57.293733] __asan_report_store8_noabort+0x17/0x20 [ 57.298710] detach_if_pending+0x557/0x610 [ 57.302908] ? trace_raw_output_tick_stop+0x130/0x130 [ 57.308061] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 57.312695] ? lock_timer_base+0x1a3/0x2b0 [ 57.316894] ? lock_timer_base+0x1eb/0x2b0 [ 57.321094] ? __internal_add_timer+0x2d0/0x2d0 [ 57.325730] ? trace_hardirqs_on+0xd/0x10 [ 57.329851] try_to_del_timer_sync+0xa2/0x120 [ 57.334310] ? del_timer+0x130/0x130 [ 57.337987] ? del_timer_sync+0xeb/0x240 [ 57.342014] del_timer_sync+0x18a/0x240 [ 57.345954] tun_free_netdev+0x105/0x1b0 [ 57.349979] ? tun_xdp+0x410/0x410 [ 57.353481] ? cpumask_next+0x24/0x30 [ 57.357247] ? netdev_refcnt_read+0xed/0x150 [ 57.361619] ? tun_xdp+0x410/0x410 [ 57.365122] netdev_run_todo+0x870/0xca0 [ 57.369146] ? do_group_exit+0x149/0x400 [ 57.373175] ? register_netdev+0x30/0x30 [ 57.377200] ? lock_downgrade+0x990/0x990 [ 57.381312] ? trace_hardirqs_on+0xd/0x10 [ 57.385433] ? refcount_sub_and_test+0x115/0x1b0 [ 57.390152] ? refcount_inc+0x50/0x50 [ 57.393917] ? refcount_inc+0x50/0x50 [ 57.397689] ? sk_destruct+0x4c/0x80 [ 57.401380] ? __sk_free+0x5c/0x230 [ 57.404974] ? sk_free+0x2f/0x40 [ 57.408320] ? __tun_detach+0x176/0x1390 [ 57.412386] ? tun_attach+0xf90/0xf90 [ 57.416168] ? do_raw_spin_trylock+0x190/0x190 [ 57.420720] ? locks_remove_file+0x3fa/0x5a0 [ 57.425093] ? fcntl_setlk+0x10d0/0x10d0 [ 57.429119] ? __fsnotify_parent+0xb4/0x3a0 [ 57.433405] ? fsnotify+0x1af0/0x1af0 [ 57.437171] ? __tun_detach+0x1390/0x1390 [ 57.441281] ? __tun_detach+0x1390/0x1390 [ 57.445395] rtnl_unlock+0xe/0x10 [ 57.448811] tun_chr_close+0x49/0x60 [ 57.452488] __fput+0x333/0x7f0 [ 57.455732] ? fput+0x140/0x140 [ 57.458975] ? check_same_owner+0x320/0x320 [ 57.463261] ? _raw_spin_unlock_irq+0x27/0x70 [ 57.467720] ____fput+0x15/0x20 [ 57.470964] task_work_run+0x199/0x270 [ 57.474815] ? task_work_cancel+0x210/0x210 [ 57.479102] ? _raw_spin_unlock+0x22/0x30 [ 57.483212] ? switch_task_namespaces+0x87/0xc0 [ 57.487845] do_exit+0xa52/0x1b40 [ 57.491262] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 57.496242] ? check_noncircular+0x20/0x20 [ 57.500443] ? mm_update_next_owner+0x930/0x930 [ 57.505077] ? __pmd_alloc+0x4e0/0x4e0 [ 57.508931] ? find_held_lock+0x39/0x1d0 [ 57.512961] ? lock_downgrade+0x990/0x990 [ 57.517095] ? handle_mm_fault+0x410/0x8d0 [ 57.521292] ? down_read_trylock+0xdb/0x170 [ 57.525575] ? __handle_mm_fault+0x39c0/0x39c0 [ 57.530120] ? vmacache_find+0x61/0x270 [ 57.534063] ? up_read+0x1a/0x40 [ 57.537394] ? __do_page_fault+0x35b/0xb60 [ 57.541591] ? do_vfs_ioctl+0x492/0x1530 [ 57.545620] ? do_page_fault+0xee/0x720 [ 57.549559] ? __do_page_fault+0xb60/0xb60 [ 57.553756] ? putname+0xf3/0x130 [ 57.557174] do_group_exit+0x149/0x400 [ 57.561024] ? lockdep_sys_exit+0x47/0xf0 [ 57.565134] ? SyS_exit+0x30/0x30 [ 57.568551] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 57.573531] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 57.578250] SyS_exit_group+0x1d/0x20 [ 57.582014] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 57.586735] RIP: 0033:0x443a48