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-0,10.128.15.193' (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: [ 57.409265] ================================================================== [ 57.416716] BUG: KASAN: use-after-free in detach_if_pending+0x557/0x610 [ 57.423446] Write of size 8 at addr ffff8801cd8a3780 by task syzkaller296499/2983 [ 57.431047] [ 57.432680] CPU: 1 PID: 2983 Comm: syzkaller296499 Not tainted 4.13.0+ #73 [ 57.439671] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 57.449000] Call Trace: [ 57.451567] dump_stack+0x194/0x257 [ 57.455176] ? arch_local_irq_restore+0x53/0x53 [ 57.459819] ? show_regs_print_info+0x65/0x65 [ 57.464293] ? lock_timer_base+0x1a3/0x2b0 [ 57.468502] ? detach_if_pending+0x557/0x610 [ 57.472890] print_address_description+0x73/0x250 [ 57.477709] ? detach_if_pending+0x557/0x610 [ 57.482095] kasan_report+0x24e/0x340 [ 57.485874] __asan_report_store8_noabort+0x17/0x20 [ 57.490866] detach_if_pending+0x557/0x610 [ 57.495079] ? __next_timer_interrupt+0x150/0x150 [ 57.499899] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 57.504540] ? lock_timer_base+0x1a3/0x2b0 [ 57.508748] ? lock_timer_base+0x1eb/0x2b0 [ 57.512965] ? __internal_add_timer+0x2d0/0x2d0 [ 57.517610] ? trace_hardirqs_on+0xd/0x10 [ 57.521741] try_to_del_timer_sync+0xa2/0x120 [ 57.526212] ? del_timer+0x130/0x130 [ 57.529900] ? del_timer_sync+0xeb/0x240 [ 57.533956] del_timer_sync+0x18a/0x240 [ 57.537915] tun_free_netdev+0x105/0x1b0 [ 57.541952] ? tun_xdp+0x410/0x410 [ 57.545472] ? netdev_refcnt_read+0xf4/0x160 [ 57.549868] ? tun_xdp+0x410/0x410 [ 57.553394] netdev_run_todo+0x870/0xca0 [ 57.557433] ? do_group_exit+0x149/0x400 [ 57.561476] ? register_netdev+0x30/0x30 [ 57.565515] ? lock_downgrade+0x990/0x990 [ 57.569637] ? trace_hardirqs_on+0xd/0x10 [ 57.573780] ? refcount_sub_and_test+0x115/0x1b0 [ 57.578521] ? refcount_inc+0x50/0x50 [ 57.582305] ? refcount_inc+0x50/0x50 [ 57.586086] ? sk_destruct+0x4c/0x80 [ 57.589787] ? __sk_free+0x5c/0x230 [ 57.593391] ? sk_free+0x2f/0x40 [ 57.596735] ? __tun_detach+0x176/0x1390 [ 57.600785] ? tun_attach+0xf90/0xf90 [ 57.604577] ? do_raw_spin_trylock+0x190/0x190 [ 57.609138] ? locks_remove_file+0x3fa/0x5a0 [ 57.613523] ? fcntl_setlk+0x10d0/0x10d0 [ 57.617564] ? __fsnotify_parent+0xb4/0x3a0 [ 57.621862] ? fsnotify+0x1af0/0x1af0 [ 57.625642] ? __tun_detach+0x1390/0x1390 [ 57.629769] ? __tun_detach+0x1390/0x1390 [ 57.633897] rtnl_unlock+0xe/0x10 [ 57.637325] tun_chr_close+0x49/0x60 [ 57.641018] __fput+0x333/0x7f0 [ 57.644278] ? fput+0x140/0x140 [ 57.647543] ? check_same_owner+0x320/0x320 [ 57.651861] ? _raw_spin_unlock_irq+0x27/0x70 [ 57.656337] ____fput+0x15/0x20 [ 57.659617] task_work_run+0x199/0x270 [ 57.663486] ? task_work_cancel+0x210/0x210 [ 57.667785] ? _raw_spin_unlock+0x22/0x30 [ 57.671907] ? switch_task_namespaces+0x87/0xc0 [ 57.676557] do_exit+0xa52/0x1b40 [ 57.679989] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 57.684988] ? check_noncircular+0x20/0x20 [ 57.689211] ? mm_update_next_owner+0x930/0x930 [ 57.693867] ? __pmd_alloc+0x4e0/0x4e0 [ 57.697739] ? find_held_lock+0x39/0x1d0 [ 57.701788] ? lock_downgrade+0x990/0x990 [ 57.705933] ? handle_mm_fault+0x4a2/0x860 [ 57.710180] ? down_read_trylock+0xdb/0x170 [ 57.714483] ? __handle_mm_fault+0x3840/0x3840 [ 57.719041] ? vmacache_find+0x61/0x270 [ 57.723013] ? up_read+0x1a/0x40 [ 57.726391] ? __do_page_fault+0x35b/0xb60 [ 57.730602] ? do_vfs_ioctl+0x492/0x1530 [ 57.734646] ? do_page_fault+0xee/0x720 [ 57.738597] ? __do_page_fault+0xb60/0xb60 [ 57.742827] ? putname+0xf3/0x130 [ 57.746263] do_group_exit+0x149/0x400 [ 57.750126] ? lockdep_sys_exit+0x47/0xf0 [ 57.754249] ? SyS_exit+0x30/0x30 [ 57.757703] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 57.762698] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 57.767435] SyS_exit_group+0x1d/0x20 [ 57.771216] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 57.775944] RIP: 0033:0x443bb8 [ 57.779108] RSP: 002b:00007ffe7c303138 EFLAGS: 00000246 ORIG_RAX: 00000000000000e7 [ 57.786795] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 0000000000443bb8 [ 57.794048] RDX: 0000000000000000 RSI: 000000000000003c RDI: 0000000000000000 [ 57.801298] RBP: 0000000000000082 R08: 00000000000000e7 R09: ffffffffffffffd4 [ 57.808543] R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000001 [ 57.815798] R13: 00000000006d6180 R14: 0000000000000000 R15: 0000000000000000 [ 57.823064] [ 57.824666] Allocated by task 2983: [ 57.828273] save_stack_trace+0x16/0x20 [ 57.832313] save_stack+0x43/0xd0 [ 57.835748] kasan_kmalloc+0xad/0xe0 [ 57.839434] __kmalloc_node+0x47/0x70 [ 57.843210] kvmalloc_node+0x64/0xd0 [ 57.846899] alloc_netdev_mqs+0x16e/0xed0 [ 57.851028] __tun_chr_ioctl+0x12be/0x3d40 [ 57.855234] tun_chr_ioctl+0x2a/0x40 [ 57.858935] do_vfs_ioctl+0x1b1/0x1530 [ 57.862796] SyS_ioctl+0x8f/0xc0 [ 57.866138] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 57.870860] [ 57.872459] Freed by task 2983: [ 57.875714] save_stack_trace+0x16/0x20 [ 57.879659] save_stack+0x43/0xd0 [ 57.883093] kasan_slab_free+0x71/0xc0 [ 57.886955] kfree+0xca/0x250 [ 57.890034] kvfree+0x36/0x60 [ 57.893112] free_netdev+0x2cf/0x360 [ 57.896803] __tun_chr_ioctl+0x2cff/0x3d40 [ 57.901016] tun_chr_ioctl+0x2a/0x40 [ 57.904708] do_vfs_ioctl+0x1b1/0x1530 [ 57.908575] SyS_ioctl+0x8f/0xc0 [ 57.911924] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 57.916659] [ 57.918268] The buggy address belongs to the object at ffff8801cd8a0380 [ 57.918268] which belongs to the cache kmalloc-16384 of size 16384 [ 57.931258] The buggy address is located 13312 bytes inside of [ 57.931258] 16384-byte region [ffff8801cd8a0380, ffff8801cd8a4380) [ 57.943463] The buggy address belongs to the page: [ 57.948368] page:ffffea0007362800 count:1 mapcount:0 mapping:ffff8801cd8a0380 index:0x0 compound_mapcount: 0 [ 57.958320] flags: 0x200000000008100(slab|head) [ 57.962965] raw: 0200000000008100 ffff8801cd8a0380 0000000000000000 0000000100000001 [ 57.970819] raw: ffffea0007365a20 ffff8801dac01c50 ffff8801dac02200 0000000000000000 [ 57.978675] page dumped because: kasan: bad access detected [ 57.984356] [ 57.985955] Memory state around the buggy address: [ 57.990864] ffff8801cd8a3680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 57.998199] ffff8801cd8a3700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 58.005532] >ffff8801cd8a3780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 58.012862] ^ [ 58.016201] ffff8801cd8a3800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 58.023548] ffff8801cd8a3880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 58.030884] ================================================================== [ 58.038219] Disabling lock debugging due to kernel taint [ 58.043645] Kernel panic - not syncing: panic_on_warn set ... [ 58.043645] [ 58.050994] CPU: 1 PID: 2983 Comm: syzkaller296499 Tainted: G B 4.13.0+ #73 [ 58.059193] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 58.068516] Call Trace: [ 58.071082] dump_stack+0x194/0x257 [ 58.074689] ? arch_local_irq_restore+0x53/0x53 [ 58.080043] ? vprintk_default+0x28/0x30 [ 58.084106] ? detach_if_pending+0x470/0x610 [ 58.088487] panic+0x1e4/0x417 [ 58.091647] ? __warn+0x1d9/0x1d9 [ 58.095077] ? detach_if_pending+0x557/0x610 [ 58.099452] kasan_end_report+0x50/0x50 [ 58.103396] kasan_report+0x137/0x340 [ 58.107168] __asan_report_store8_noabort+0x17/0x20 [ 58.112151] detach_if_pending+0x557/0x610 [ 58.116354] ? __next_timer_interrupt+0x150/0x150 [ 58.121166] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 58.125800] ? lock_timer_base+0x1a3/0x2b0 [ 58.130006] ? lock_timer_base+0x1eb/0x2b0 [ 58.134211] ? __internal_add_timer+0x2d0/0x2d0 [ 58.138847] ? trace_hardirqs_on+0xd/0x10 [ 58.142967] try_to_del_timer_sync+0xa2/0x120 [ 58.147430] ? del_timer+0x130/0x130 [ 58.151112] ? del_timer_sync+0xeb/0x240 [ 58.155160] del_timer_sync+0x18a/0x240 [ 58.159108] tun_free_netdev+0x105/0x1b0 [ 58.163137] ? tun_xdp+0x410/0x410 [ 58.166648] ? netdev_refcnt_read+0xf4/0x160 [ 58.171027] ? tun_xdp+0x410/0x410 [ 58.174534] netdev_run_todo+0x870/0xca0 [ 58.178563] ? do_group_exit+0x149/0x400 [ 58.182595] ? register_netdev+0x30/0x30 [ 58.186629] ? lock_downgrade+0x990/0x990 [ 58.190746] ? trace_hardirqs_on+0xd/0x10 [ 58.194871] ? refcount_sub_and_test+0x115/0x1b0 [ 58.199592] ? refcount_inc+0x50/0x50 [ 58.203360] ? refcount_inc+0x50/0x50 [ 58.207139] ? sk_destruct+0x4c/0x80 [ 58.210820] ? __sk_free+0x5c/0x230 [ 58.214414] ? sk_free+0x2f/0x40 [ 58.217747] ? __tun_detach+0x176/0x1390 [ 58.221778] ? tun_attach+0xf90/0xf90 [ 58.225576] ? do_raw_spin_trylock+0x190/0x190 [ 58.230144] ? locks_remove_file+0x3fa/0x5a0 [ 58.234521] ? fcntl_setlk+0x10d0/0x10d0 [ 58.238552] ? __fsnotify_parent+0xb4/0x3a0 [ 58.242843] ? fsnotify+0x1af0/0x1af0 [ 58.246618] ? __tun_detach+0x1390/0x1390 [ 58.250733] ? __tun_detach+0x1390/0x1390 [ 58.254850] rtnl_unlock+0xe/0x10 [ 58.258285] tun_chr_close+0x49/0x60 [ 58.261965] __fput+0x333/0x7f0 [ 58.265222] ? fput+0x140/0x140 [ 58.268487] ? check_same_owner+0x320/0x320 [ 58.272789] ? _raw_spin_unlock_irq+0x27/0x70 [ 58.277258] ____fput+0x15/0x20 [ 58.280507] task_work_run+0x199/0x270 [ 58.284366] ? task_work_cancel+0x210/0x210 [ 58.288655] ? _raw_spin_unlock+0x22/0x30 [ 58.292769] ? switch_task_namespaces+0x87/0xc0 [ 58.297425] do_exit+0xa52/0x1b40 [ 58.300845] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 58.305841] ? check_noncircular+0x20/0x20 [ 58.310045] ? mm_update_next_owner+0x930/0x930 [ 58.314684] ? __pmd_alloc+0x4e0/0x4e0 [ 58.318556] ? find_held_lock+0x39/0x1d0 [ 58.322592] ? lock_downgrade+0x990/0x990 [ 58.326716] ? handle_mm_fault+0x4a2/0x860 [ 58.330940] ? down_read_trylock+0xdb/0x170 [ 58.335228] ? __handle_mm_fault+0x3840/0x3840 [ 58.339797] ? vmacache_find+0x61/0x270 [ 58.343742] ? up_read+0x1a/0x40 [ 58.347079] ? __do_page_fault+0x35b/0xb60 [ 58.351291] ? do_vfs_ioctl+0x492/0x1530 [ 58.355322] ? do_page_fault+0xee/0x720 [ 58.359264] ? __do_page_fault+0xb60/0xb60 [ 58.363466] ? putname+0xf3/0x130 [ 58.366890] do_group_exit+0x149/0x400 [ 58.370747] ? lockdep_sys_exit+0x47/0xf0 [ 58.374862] ? SyS_exit+0x30/0x30 [ 58.378283] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 58.383275] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 58.388036] SyS_exit_group+0x1d/0x20 [ 58.391809] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 58.396531] RIP: 0033:0x443bb8 [ 58.399688] RSP: 002b:00007ffe7c303138 EFLAGS: 00000246 ORIG_RAX: 00000000000000e7