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.208' (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: [ 46.266530] ================================================================== [ 46.267744] BUG: KASAN: use-after-free in detach_if_pending+0x557/0x610 [ 46.268766] Write of size 8 at addr ffff8801d07f3738 by task syzkaller680977/3005 [ 46.269801] [ 46.270036] CPU: 0 PID: 3005 Comm: syzkaller680977 Not tainted 4.13.0-rc7+ #57 [ 46.271112] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 46.272473] Call Trace: [ 46.272860] dump_stack+0x194/0x257 [ 46.273386] ? arch_local_irq_restore+0x53/0x53 [ 46.274029] ? show_regs_print_info+0x65/0x65 [ 46.274672] ? lock_timer_base+0x1a3/0x2b0 [ 46.275258] ? detach_if_pending+0x557/0x610 [ 46.275878] print_address_description+0x73/0x250 [ 46.276524] ? detach_if_pending+0x557/0x610 [ 46.277114] kasan_report+0x24e/0x340 [ 46.277675] __asan_report_store8_noabort+0x17/0x20 [ 46.278374] detach_if_pending+0x557/0x610 [ 46.278971] ? __next_timer_interrupt+0x150/0x150 [ 46.279617] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 46.280238] ? lock_timer_base+0x1a3/0x2b0 [ 46.280850] ? lock_timer_base+0x1eb/0x2b0 [ 46.281422] ? __internal_add_timer+0x2d0/0x2d0 [ 46.282110] ? lock_downgrade+0x990/0x990 [ 46.282677] try_to_del_timer_sync+0xa2/0x120 [ 46.283277] ? del_timer+0x130/0x130 [ 46.283797] ? del_timer_sync+0xeb/0x240 [ 46.284363] del_timer_sync+0x18a/0x240 [ 46.284902] tun_free_netdev+0x105/0x1b0 [ 46.285548] ? tun_show_group+0x170/0x170 [ 46.286125] ? netdev_refcnt_read+0xf4/0x160 [ 46.286719] ? tun_show_group+0x170/0x170 [ 46.287346] netdev_run_todo+0x870/0xca0 [ 46.291382] ? do_group_exit+0x149/0x400 [ 46.295431] ? mark_held_locks+0xaf/0x100 [ 46.299559] ? register_netdev+0x30/0x30 [ 46.303595] ? find_held_lock+0x35/0x1d0 [ 46.307651] ? lock_downgrade+0x990/0x990 [ 46.311774] ? refcount_sub_and_test+0x115/0x1b0 [ 46.316499] ? refcount_inc+0x50/0x50 [ 46.320269] ? refcount_inc+0x50/0x50 [ 46.324043] ? sk_destruct+0x4c/0x80 [ 46.327726] ? __sk_free+0x5c/0x230 [ 46.331329] ? sk_free+0x2f/0x40 [ 46.334663] ? __tun_detach+0x176/0x1390 [ 46.338712] ? tun_attach+0xfa0/0xfa0 [ 46.342504] ? locks_remove_file+0x414/0x560 [ 46.346884] ? fcntl_setlk+0x10c0/0x10c0 [ 46.350919] ? __fsnotify_parent+0xb4/0x3a0 [ 46.355219] ? fsnotify+0x1af0/0x1af0 [ 46.358995] ? __tun_detach+0x1390/0x1390 [ 46.363113] rtnl_unlock+0xe/0x10 [ 46.366536] tun_chr_close+0x49/0x60 [ 46.370221] __fput+0x327/0x7e0 [ 46.373475] ? fput+0x140/0x140 [ 46.376725] ? check_same_owner+0x320/0x320 [ 46.381023] ____fput+0x15/0x20 [ 46.384282] task_work_run+0x18a/0x260 [ 46.388149] ? task_work_cancel+0x210/0x210 [ 46.392456] ? free_nsproxy+0x185/0x1f0 [ 46.396398] ? switch_task_namespaces+0xa2/0xc0 [ 46.401039] do_exit+0xa3a/0x1b10 [ 46.404468] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 46.409467] ? lock_acquire+0x1d5/0x580 [ 46.413409] ? kvfree+0x3b/0x60 [ 46.416658] ? __handle_mm_fault+0x11a1/0x3860 [ 46.421207] ? mm_update_next_owner+0x930/0x930 [ 46.425847] ? lock_release+0xa40/0xa40 [ 46.429800] ? tun_select_queue+0x580/0x580 [ 46.434103] ? __handle_mm_fault+0x577/0x3860 [ 46.438566] ? check_noncircular+0x20/0x20 [ 46.442776] ? check_noncircular+0x20/0x20 [ 46.446978] ? __pmd_alloc+0x4e0/0x4e0 [ 46.450831] ? find_held_lock+0x35/0x1d0 [ 46.454876] ? find_held_lock+0x35/0x1d0 [ 46.458913] ? handle_mm_fault+0x23e/0x860 [ 46.463119] ? find_held_lock+0x35/0x1d0 [ 46.467163] ? __do_page_fault+0x51b/0xb60 [ 46.471366] ? lock_downgrade+0x990/0x990 [ 46.475488] ? handle_mm_fault+0x4a2/0x860 [ 46.479688] ? down_read_trylock+0xdb/0x170 [ 46.483979] ? __handle_mm_fault+0x3860/0x3860 [ 46.488529] ? vmacache_find+0x61/0x270 [ 46.492476] do_group_exit+0x149/0x400 [ 46.496332] ? SyS_exit+0x30/0x30 [ 46.499756] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 46.504740] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 46.510136] SyS_exit_group+0x1d/0x20 [ 46.513909] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 46.518632] RIP: 0033:0x445119 [ 46.521791] RSP: 002b:00000000007efe48 EFLAGS: 00000206 ORIG_RAX: 00000000000000e7 [ 46.529468] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 0000000000445119 [ 46.536707] RDX: 0000000000445119 RSI: 0000000020029000 RDI: 0000000000000001 [ 46.543944] RBP: 0000000000000086 R08: 0000000000000000 R09: 0000000000000000 [ 46.551183] R10: 0000000000000000 R11: 0000000000000206 R12: 0000000000402770 [ 46.558422] R13: 0000000000402800 R14: 0000000000000000 R15: 0000000000000000 [ 46.565861] [ 46.567459] Allocated by task 3005: [ 46.571057] save_stack_trace+0x16/0x20 [ 46.575003] save_stack+0x43/0xd0 [ 46.578519] kasan_kmalloc+0xad/0xe0 [ 46.582209] __kmalloc_node+0x47/0x70 [ 46.585979] kvmalloc_node+0x64/0xd0 [ 46.589672] alloc_netdev_mqs+0x16e/0xed0 [ 46.593791] __tun_chr_ioctl+0x12b2/0x3d60 [ 46.598001] tun_chr_ioctl+0x2a/0x40 [ 46.601683] do_vfs_ioctl+0x1b1/0x1520 [ 46.605542] SyS_ioctl+0x8f/0xc0 [ 46.608876] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 46.613598] [ 46.615195] Freed by task 3005: [ 46.618445] save_stack_trace+0x16/0x20 [ 46.622387] save_stack+0x43/0xd0 [ 46.625807] kasan_slab_free+0x71/0xc0 [ 46.629661] kfree+0xca/0x250 [ 46.632734] kvfree+0x36/0x60 [ 46.635807] free_netdev+0x2cf/0x360 [ 46.639491] __tun_chr_ioctl+0x2d24/0x3d60 [ 46.643692] tun_chr_ioctl+0x2a/0x40 [ 46.647373] do_vfs_ioctl+0x1b1/0x1520 [ 46.651226] SyS_ioctl+0x8f/0xc0 [ 46.654571] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 46.659300] [ 46.660899] The buggy address belongs to the object at ffff8801d07f0400 [ 46.660899] which belongs to the cache kmalloc-16384 of size 16384 [ 46.673883] The buggy address is located 13112 bytes inside of [ 46.673883] 16384-byte region [ffff8801d07f0400, ffff8801d07f4400) [ 46.686087] The buggy address belongs to the page: [ 46.690985] page:ffffea000741fc00 count:1 mapcount:0 mapping:ffff8801d07f0400 index:0x0 compound_mapcount: 0 [ 46.700942] flags: 0x200000000008100(slab|head) [ 46.705583] raw: 0200000000008100 ffff8801d07f0400 0000000000000000 0000000100000001 [ 46.713433] raw: ffffea0007418420 ffff8801dac01c48 ffff8801dac02200 0000000000000000 [ 46.721279] page dumped because: kasan: bad access detected [ 46.726967] [ 46.728585] Memory state around the buggy address: [ 46.733483] ffff8801d07f3600: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 46.740829] ffff8801d07f3680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 46.748163] >ffff8801d07f3700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 46.755499] ^ [ 46.760656] ffff8801d07f3780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 46.767983] ffff8801d07f3800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 46.775308] ================================================================== [ 46.782644] Disabling lock debugging due to kernel taint [ 46.788059] Kernel panic - not syncing: panic_on_warn set ... [ 46.788059] [ 46.795391] CPU: 0 PID: 3005 Comm: syzkaller680977 Tainted: G B 4.13.0-rc7+ #57 [ 46.804018] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 46.813339] Call Trace: [ 46.815895] dump_stack+0x194/0x257 [ 46.819493] ? arch_local_irq_restore+0x53/0x53 [ 46.824134] ? kasan_end_report+0x32/0x50 [ 46.828255] ? lock_downgrade+0x990/0x990 [ 46.832387] ? detach_if_pending+0x490/0x610 [ 46.836762] panic+0x1e4/0x417 [ 46.839929] ? __warn+0x1d9/0x1d9 [ 46.843363] ? detach_if_pending+0x557/0x610 [ 46.847738] kasan_end_report+0x50/0x50 [ 46.851678] kasan_report+0x137/0x340 [ 46.855456] __asan_report_store8_noabort+0x17/0x20 [ 46.860449] detach_if_pending+0x557/0x610 [ 46.864653] ? __next_timer_interrupt+0x150/0x150 [ 46.869549] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 46.874184] ? lock_timer_base+0x1a3/0x2b0 [ 46.878386] ? lock_timer_base+0x1eb/0x2b0 [ 46.882600] ? __internal_add_timer+0x2d0/0x2d0 [ 46.887495] ? lock_downgrade+0x990/0x990 [ 46.891613] try_to_del_timer_sync+0xa2/0x120 [ 46.896076] ? del_timer+0x130/0x130 [ 46.899762] ? del_timer_sync+0xeb/0x240 [ 46.903791] del_timer_sync+0x18a/0x240 [ 46.907739] tun_free_netdev+0x105/0x1b0 [ 46.911772] ? tun_show_group+0x170/0x170 [ 46.915899] ? netdev_refcnt_read+0xf4/0x160 [ 46.920300] ? tun_show_group+0x170/0x170 [ 46.924432] netdev_run_todo+0x870/0xca0 [ 46.928464] ? do_group_exit+0x149/0x400 [ 46.932495] ? mark_held_locks+0xaf/0x100 [ 46.936706] ? register_netdev+0x30/0x30 [ 46.940736] ? find_held_lock+0x35/0x1d0 [ 46.944768] ? lock_downgrade+0x990/0x990 [ 46.948889] ? refcount_sub_and_test+0x115/0x1b0 [ 46.953613] ? refcount_inc+0x50/0x50 [ 46.957390] ? refcount_inc+0x50/0x50 [ 46.961161] ? sk_destruct+0x4c/0x80 [ 46.964850] ? __sk_free+0x5c/0x230 [ 46.968461] ? sk_free+0x2f/0x40 [ 46.971795] ? __tun_detach+0x176/0x1390 [ 46.975830] ? tun_attach+0xfa0/0xfa0 [ 46.979603] ? locks_remove_file+0x414/0x560 [ 46.983980] ? fcntl_setlk+0x10c0/0x10c0 [ 46.988008] ? __fsnotify_parent+0xb4/0x3a0 [ 46.992296] ? fsnotify+0x1af0/0x1af0 [ 46.996078] ? __tun_detach+0x1390/0x1390 [ 47.000203] rtnl_unlock+0xe/0x10 [ 47.003625] tun_chr_close+0x49/0x60 [ 47.007308] __fput+0x327/0x7e0 [ 47.010573] ? fput+0x140/0x140 [ 47.013828] ? check_same_owner+0x320/0x320 [ 47.018123] ____fput+0x15/0x20 [ 47.021370] task_work_run+0x18a/0x260 [ 47.025224] ? task_work_cancel+0x210/0x210 [ 47.029514] ? free_nsproxy+0x185/0x1f0 [ 47.033454] ? switch_task_namespaces+0xa2/0xc0 [ 47.038094] do_exit+0xa3a/0x1b10 [ 47.041516] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 47.046504] ? lock_acquire+0x1d5/0x580 [ 47.050446] ? kvfree+0x3b/0x60 [ 47.053696] ? __handle_mm_fault+0x11a1/0x3860 [ 47.058244] ? mm_update_next_owner+0x930/0x930 [ 47.062881] ? lock_release+0xa40/0xa40 [ 47.066837] ? tun_select_queue+0x580/0x580 [ 47.071132] ? __handle_mm_fault+0x577/0x3860 [ 47.075596] ? check_noncircular+0x20/0x20 [ 47.079801] ? check_noncircular+0x20/0x20 [ 47.084003] ? __pmd_alloc+0x4e0/0x4e0 [ 47.087944] ? find_held_lock+0x35/0x1d0 [ 47.091975] ? find_held_lock+0x35/0x1d0 [ 47.096014] ? handle_mm_fault+0x23e/0x860 [ 47.100218] ? find_held_lock+0x35/0x1d0 [ 47.104255] ? __do_page_fault+0x51b/0xb60 [ 47.108472] ? lock_downgrade+0x990/0x990 [ 47.112595] ? handle_mm_fault+0x4a2/0x860 [ 47.116802] ? down_read_trylock+0xdb/0x170 [ 47.121095] ? __handle_mm_fault+0x3860/0x3860 [ 47.125732] ? vmacache_find+0x61/0x270 [ 47.129676] do_group_exit+0x149/0x400 [ 47.133533] ? SyS_exit+0x30/0x30 [ 47.136966] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 47.141951] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 47.146678] SyS_exit_group+0x1d/0x20 [ 47.150447] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 47.155169] RIP: 0033:0x445119 [ 47.158324] RSP: 002b:00000000007efe48 EFLAGS: 00000206 ORIG_RAX: 00000000000000e7 [ 47.165998] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 0000000000445119 [ 47.173233] RDX: 0000000000445119 RSI: 0000000020029000 RDI: 0000000000000001 [ 47.180481] RBP: 0000000000000086 R08: 0000000000000000 R09: 0000000000000000 [ 47.187718] R10: 0000000000000000 R11: 0000000000000206 R12: 0000000000402770 [ 47.194956] R13: 0000000000402800 R14: 0000000000000000 R15: 0000000000000000 [ 47.202243] Dumping ftrace buffer: [ 47.205750] (ftrace buffer empty) [ 47.209426] Kernel Offset: disabled [ 47.213041] Rebooting in 86400 seconds..