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.223' (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: [ 42.437405] ================================================================== [ 42.438574] BUG: KASAN: use-after-free in detach_if_pending+0x557/0x610 [ 42.439475] Write of size 8 at addr ffff8801d29db6b8 by task syzkaller455446/2982 [ 42.440471] [ 42.440707] CPU: 0 PID: 2982 Comm: syzkaller455446 Not tainted 4.14.0-rc5+ #136 [ 42.441716] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 42.442948] Call Trace: [ 42.443310] dump_stack+0x194/0x257 [ 42.443802] ? arch_local_irq_restore+0x53/0x53 [ 42.444655] ? show_regs_print_info+0x65/0x65 [ 42.445258] ? lock_timer_base+0x1a3/0x2b0 [ 42.445826] ? detach_if_pending+0x557/0x610 [ 42.446549] print_address_description+0x73/0x250 [ 42.447197] ? detach_if_pending+0x557/0x610 [ 42.447789] kasan_report+0x25b/0x340 [ 42.448303] __asan_report_store8_noabort+0x17/0x20 [ 42.448970] detach_if_pending+0x557/0x610 [ 42.449539] ? trace_raw_output_tick_stop+0x130/0x130 [ 42.450231] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 42.450850] ? lock_timer_base+0x1a3/0x2b0 [ 42.451477] ? lock_timer_base+0x1eb/0x2b0 [ 42.452072] ? __internal_add_timer+0x2d0/0x2d0 [ 42.452695] ? lock_downgrade+0x990/0x990 [ 42.453260] ? trace_hardirqs_on+0xd/0x10 [ 42.453821] try_to_del_timer_sync+0xa2/0x120 [ 42.454423] ? del_timer+0x130/0x130 [ 42.455019] ? del_timer_sync+0xeb/0x240 [ 42.455571] del_timer_sync+0x18a/0x240 [ 42.456127] tun_free_netdev+0x105/0x1b0 [ 42.456672] ? tun_xdp+0x410/0x410 [ 42.457150] ? cpumask_next+0x24/0x30 [ 42.458074] ? netdev_refcnt_read+0xed/0x150 [ 42.462457] ? tun_xdp+0x410/0x410 [ 42.465969] netdev_run_todo+0x870/0xca0 [ 42.470000] ? do_group_exit+0x149/0x400 [ 42.474034] ? mark_held_locks+0xaf/0x100 [ 42.478153] ? register_netdev+0x30/0x30 [ 42.482190] ? find_held_lock+0x35/0x1d0 [ 42.486244] ? lock_downgrade+0x990/0x990 [ 42.490368] ? refcount_sub_and_test+0x115/0x1b0 [ 42.495096] ? refcount_inc+0x50/0x50 [ 42.498865] ? refcount_inc+0x50/0x50 [ 42.502638] ? sk_destruct+0x4c/0x80 [ 42.506317] ? __sk_free+0x5c/0x230 [ 42.509910] ? sk_free+0x2f/0x40 [ 42.513244] ? __tun_detach+0x176/0x1390 [ 42.517282] ? tun_attach+0xfa0/0xfa0 [ 42.521052] ? lock_downgrade+0x990/0x990 [ 42.525168] ? locks_remove_file+0x3fa/0x5a0 [ 42.529544] ? fcntl_setlk+0x10c0/0x10c0 [ 42.533573] ? __fsnotify_parent+0xb4/0x3a0 [ 42.537864] ? fsnotify+0x1af0/0x1af0 [ 42.541638] ? __tun_detach+0x1390/0x1390 [ 42.545755] rtnl_unlock+0xe/0x10 [ 42.549175] tun_chr_close+0x49/0x60 [ 42.552855] __fput+0x327/0x7e0 [ 42.556105] ? fput+0x140/0x140 [ 42.559352] ? check_same_owner+0x320/0x320 [ 42.563638] ? _raw_spin_unlock_irq+0x27/0x70 [ 42.568102] ____fput+0x15/0x20 [ 42.571348] task_work_run+0x199/0x270 [ 42.575203] ? task_work_cancel+0x210/0x210 [ 42.579490] ? _raw_spin_unlock+0x22/0x30 [ 42.583604] ? switch_task_namespaces+0x87/0xc0 [ 42.588244] do_exit+0x9b5/0x1ad0 [ 42.591666] ? kvfree+0x3b/0x60 [ 42.594913] ? mm_update_next_owner+0x930/0x930 [ 42.599561] ? find_held_lock+0x35/0x1d0 [ 42.603593] ? handle_mm_fault+0x248/0x8d0 [ 42.607797] ? find_held_lock+0x35/0x1d0 [ 42.611834] ? __do_page_fault+0x64c/0xd60 [ 42.616037] ? lock_downgrade+0x990/0x990 [ 42.620159] ? handle_mm_fault+0x410/0x8d0 [ 42.624358] ? __do_page_fault+0x31e/0xd60 [ 42.628560] ? __handle_mm_fault+0x39c0/0x39c0 [ 42.633105] ? vmacache_find+0x5f/0x280 [ 42.637053] ? up_read+0x1a/0x40 [ 42.640384] ? __do_page_fault+0x3d6/0xd60 [ 42.644591] ? mm_fault_error+0x2c0/0x2c0 [ 42.648708] ? do_vfs_ioctl+0x486/0x1520 [ 42.652741] ? do_page_fault+0xee/0x720 [ 42.656682] ? __do_page_fault+0xd60/0xd60 [ 42.660884] ? putname+0xf3/0x130 [ 42.664309] do_group_exit+0x149/0x400 [ 42.668163] ? SyS_exit+0x30/0x30 [ 42.671582] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 42.676566] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 42.681289] SyS_exit_group+0x1d/0x20 [ 42.685054] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 42.689774] RIP: 0033:0x443b88 [ 42.692935] RSP: 002b:00007fffad66eec8 EFLAGS: 00000246 ORIG_RAX: 00000000000000e7 [ 42.700608] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 0000000000443b88 [ 42.707852] RDX: 0000000000000000 RSI: 000000000000003c RDI: 0000000000000000 [ 42.715087] RBP: 0000000000000082 R08: 00000000000000e7 R09: ffffffffffffffd4 [ 42.722323] R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000001 [ 42.729558] R13: 00000000006d6180 R14: 0000000000000000 R15: 0000000000000000 [ 42.736810] [ 42.738405] Allocated by task 2982: [ 42.742002] save_stack_trace+0x16/0x20 [ 42.745944] save_stack+0x43/0xd0 [ 42.749361] kasan_kmalloc+0xad/0xe0 [ 42.753039] __kmalloc_node+0x47/0x70 [ 42.756803] kvmalloc_node+0x64/0xd0 [ 42.760482] alloc_netdev_mqs+0x16e/0xed0 [ 42.764593] __tun_chr_ioctl+0x12b2/0x3d20 [ 42.768794] tun_chr_ioctl+0x2a/0x40 [ 42.772472] do_vfs_ioctl+0x1b1/0x1520 [ 42.776323] SyS_ioctl+0x8f/0xc0 [ 42.779654] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 42.784371] [ 42.785965] Freed by task 2982: [ 42.789208] save_stack_trace+0x16/0x20 [ 42.793146] save_stack+0x43/0xd0 [ 42.796563] kasan_slab_free+0x71/0xc0 [ 42.800420] kfree+0xca/0x250 [ 42.803491] kvfree+0x36/0x60 [ 42.806561] free_netdev+0x2cf/0x360 [ 42.810239] __tun_chr_ioctl+0x2cea/0x3d20 [ 42.814438] tun_chr_ioctl+0x2a/0x40 [ 42.818116] do_vfs_ioctl+0x1b1/0x1520 [ 42.821989] SyS_ioctl+0x8f/0xc0 [ 42.825322] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 42.830041] [ 42.831637] The buggy address belongs to the object at ffff8801d29d8380 [ 42.831637] which belongs to the cache kmalloc-16384 of size 16384 [ 42.844606] The buggy address is located 13112 bytes inside of [ 42.844606] 16384-byte region [ffff8801d29d8380, ffff8801d29dc380) [ 42.856790] The buggy address belongs to the page: [ 42.861682] page:ffffea00074a7600 count:1 mapcount:0 mapping:ffff8801d29d8380 index:0x0 compound_mapcount: 0 [ 42.871618] flags: 0x200000000008100(slab|head) [ 42.876253] raw: 0200000000008100 ffff8801d29d8380 0000000000000000 0000000100000001 [ 42.884098] raw: ffffea000744e020 ffff8801dac01c48 ffff8801dac02200 0000000000000000 [ 42.891943] page dumped because: kasan: bad access detected [ 42.897617] [ 42.899207] Memory state around the buggy address: [ 42.904101] ffff8801d29db580: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 42.911425] ffff8801d29db600: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 42.918748] >ffff8801d29db680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 42.926070] ^ [ 42.931222] ffff8801d29db700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 42.938546] ffff8801d29db780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 42.945868] ================================================================== [ 42.953190] Disabling lock debugging due to kernel taint [ 42.958602] Kernel panic - not syncing: panic_on_warn set ... [ 42.958602] [ 42.965933] CPU: 0 PID: 2982 Comm: syzkaller455446 Tainted: G B 4.14.0-rc5+ #136 [ 42.974557] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 42.983876] Call Trace: [ 42.986435] dump_stack+0x194/0x257 [ 42.990030] ? arch_local_irq_restore+0x53/0x53 [ 42.994663] ? kasan_end_report+0x32/0x50 [ 42.998777] ? lock_downgrade+0x990/0x990 [ 43.002894] ? detach_if_pending+0x510/0x610 [ 43.007268] panic+0x1e4/0x417 [ 43.010425] ? __warn+0x1d9/0x1d9 [ 43.013850] ? detach_if_pending+0x557/0x610 [ 43.018223] kasan_end_report+0x50/0x50 [ 43.022161] kasan_report+0x144/0x340 [ 43.025932] __asan_report_store8_noabort+0x17/0x20 [ 43.030912] detach_if_pending+0x557/0x610 [ 43.035112] ? trace_raw_output_tick_stop+0x130/0x130 [ 43.040270] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 43.044904] ? lock_timer_base+0x1a3/0x2b0 [ 43.049109] ? lock_timer_base+0x1eb/0x2b0 [ 43.053308] ? __internal_add_timer+0x2d0/0x2d0 [ 43.057942] ? lock_downgrade+0x990/0x990 [ 43.062055] ? trace_hardirqs_on+0xd/0x10 [ 43.066171] try_to_del_timer_sync+0xa2/0x120 [ 43.070629] ? del_timer+0x130/0x130 [ 43.074308] ? del_timer_sync+0xeb/0x240 [ 43.078334] del_timer_sync+0x18a/0x240 [ 43.082277] tun_free_netdev+0x105/0x1b0 [ 43.086300] ? tun_xdp+0x410/0x410 [ 43.089804] ? cpumask_next+0x24/0x30 [ 43.093570] ? netdev_refcnt_read+0xed/0x150 [ 43.097942] ? tun_xdp+0x410/0x410 [ 43.101447] netdev_run_todo+0x870/0xca0 [ 43.105472] ? do_group_exit+0x149/0x400 [ 43.109498] ? mark_held_locks+0xaf/0x100 [ 43.113608] ? register_netdev+0x30/0x30 [ 43.117634] ? find_held_lock+0x35/0x1d0 [ 43.121664] ? lock_downgrade+0x990/0x990 [ 43.125794] ? refcount_sub_and_test+0x115/0x1b0 [ 43.130512] ? refcount_inc+0x50/0x50 [ 43.134275] ? refcount_inc+0x50/0x50 [ 43.138042] ? sk_destruct+0x4c/0x80 [ 43.141719] ? __sk_free+0x5c/0x230 [ 43.145311] ? sk_free+0x2f/0x40 [ 43.148640] ? __tun_detach+0x176/0x1390 [ 43.152669] ? tun_attach+0xfa0/0xfa0 [ 43.156437] ? lock_downgrade+0x990/0x990 [ 43.160550] ? locks_remove_file+0x3fa/0x5a0 [ 43.164926] ? fcntl_setlk+0x10c0/0x10c0 [ 43.168952] ? __fsnotify_parent+0xb4/0x3a0 [ 43.173238] ? fsnotify+0x1af0/0x1af0 [ 43.177020] ? __tun_detach+0x1390/0x1390 [ 43.181135] rtnl_unlock+0xe/0x10 [ 43.184553] tun_chr_close+0x49/0x60 [ 43.188233] __fput+0x327/0x7e0 [ 43.191478] ? fput+0x140/0x140 [ 43.194726] ? check_same_owner+0x320/0x320 [ 43.199012] ? _raw_spin_unlock_irq+0x27/0x70 [ 43.203475] ____fput+0x15/0x20 [ 43.206720] task_work_run+0x199/0x270 [ 43.210572] ? task_work_cancel+0x210/0x210 [ 43.214874] ? _raw_spin_unlock+0x22/0x30 [ 43.218987] ? switch_task_namespaces+0x87/0xc0 [ 43.223622] do_exit+0x9b5/0x1ad0 [ 43.227041] ? kvfree+0x3b/0x60 [ 43.230287] ? mm_update_next_owner+0x930/0x930 [ 43.234921] ? find_held_lock+0x35/0x1d0 [ 43.238950] ? handle_mm_fault+0x248/0x8d0 [ 43.243152] ? find_held_lock+0x35/0x1d0 [ 43.247183] ? __do_page_fault+0x64c/0xd60 [ 43.251382] ? lock_downgrade+0x990/0x990 [ 43.255498] ? handle_mm_fault+0x410/0x8d0 [ 43.259695] ? __do_page_fault+0x31e/0xd60 [ 43.263894] ? __handle_mm_fault+0x39c0/0x39c0 [ 43.268442] ? vmacache_find+0x5f/0x280 [ 43.272383] ? up_read+0x1a/0x40 [ 43.275715] ? __do_page_fault+0x3d6/0xd60 [ 43.279921] ? mm_fault_error+0x2c0/0x2c0 [ 43.284033] ? do_vfs_ioctl+0x486/0x1520 [ 43.288148] ? do_page_fault+0xee/0x720 [ 43.292086] ? __do_page_fault+0xd60/0xd60 [ 43.296284] ? putname+0xf3/0x130 [ 43.299703] do_group_exit+0x149/0x400 [ 43.303553] ? SyS_exit+0x30/0x30 [ 43.306972] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 43.311953] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 43.316675] SyS_exit_group+0x1d/0x20 [ 43.320530] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 43.325251] RIP: 0033:0x443b88 [ 43.328406] RSP: 002b:00007fffad66eec8 EFLAGS: 00000246 ORIG_RAX: 00000000000000e7 [ 43.336077] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 0000000000443b88 [ 43.343312] RDX: 0000000000000000 RSI: 000000000000003c RDI: 0000000000000000 [ 43.350546] RBP: 0000000000000082 R08: 00000000000000e7 R09: ffffffffffffffd4 [ 43.357789] R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000001 [ 43.365032] R13: 00000000006d6180 R14: 0000000000000000 R15: 0000000000000000