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-1,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: [ 47.444324] ================================================================== [ 47.445464] BUG: KASAN: use-after-free in detach_if_pending+0x557/0x610 [ 47.446374] Write of size 8 at addr ffff8801d27bb678 by task syzkaller575355/2990 [ 47.447419] [ 47.447653] CPU: 1 PID: 2990 Comm: syzkaller575355 Not tainted 4.14.0-rc5+ #142 [ 47.448667] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 47.449887] Call Trace: [ 47.450246] dump_stack+0x194/0x257 [ 47.450738] ? arch_local_irq_restore+0x53/0x53 [ 47.451389] ? show_regs_print_info+0x65/0x65 [ 47.452002] ? lock_timer_base+0x1a3/0x2b0 [ 47.452570] ? detach_if_pending+0x557/0x610 [ 47.453161] print_address_description+0x73/0x250 [ 47.453805] ? detach_if_pending+0x557/0x610 [ 47.454396] kasan_report+0x25b/0x340 [ 47.454952] __asan_report_store8_noabort+0x17/0x20 [ 47.455618] detach_if_pending+0x557/0x610 [ 47.456204] ? trace_raw_output_tick_stop+0x130/0x130 [ 47.456894] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 47.457513] ? lock_timer_base+0x1a3/0x2b0 [ 47.458098] ? lock_timer_base+0x1eb/0x2b0 [ 47.458667] ? __internal_add_timer+0x2d0/0x2d0 [ 47.459290] ? lock_downgrade+0x990/0x990 [ 47.459966] ? trace_hardirqs_on+0xd/0x10 [ 47.460529] try_to_del_timer_sync+0xa2/0x120 [ 47.461129] ? del_timer+0x130/0x130 [ 47.461631] ? del_timer_sync+0xeb/0x240 [ 47.462218] del_timer_sync+0x18a/0x240 [ 47.462757] tun_free_netdev+0x105/0x1b0 [ 47.463301] ? tun_xdp+0x410/0x410 [ 47.463778] ? cpumask_next+0x24/0x30 [ 47.464308] ? netdev_refcnt_read+0xed/0x150 [ 47.467574] ? tun_xdp+0x410/0x410 [ 47.471081] netdev_run_todo+0x870/0xca0 [ 47.475108] ? do_group_exit+0x149/0x400 [ 47.479138] ? mark_held_locks+0xaf/0x100 [ 47.483253] ? register_netdev+0x30/0x30 [ 47.487284] ? find_held_lock+0x35/0x1d0 [ 47.491321] ? lock_downgrade+0x990/0x990 [ 47.495441] ? refcount_sub_and_test+0x115/0x1b0 [ 47.500166] ? refcount_inc+0x50/0x50 [ 47.503934] ? refcount_inc+0x50/0x50 [ 47.507707] ? sk_destruct+0x4c/0x80 [ 47.511389] ? __sk_free+0x5c/0x230 [ 47.514986] ? sk_free+0x2f/0x40 [ 47.518317] ? __tun_detach+0x176/0x1390 [ 47.522356] ? tun_attach+0xfa0/0xfa0 [ 47.526134] ? locks_remove_file+0x3fa/0x5a0 [ 47.530512] ? fcntl_setlk+0x10c0/0x10c0 [ 47.534544] ? __fsnotify_parent+0xb4/0x3a0 [ 47.538837] ? fsnotify+0x1af0/0x1af0 [ 47.542611] ? __tun_detach+0x1390/0x1390 [ 47.546728] rtnl_unlock+0xe/0x10 [ 47.550147] tun_chr_close+0x49/0x60 [ 47.553830] __fput+0x327/0x7e0 [ 47.557082] ? fput+0x140/0x140 [ 47.560329] ? check_same_owner+0x320/0x320 [ 47.564623] ____fput+0x15/0x20 [ 47.567871] task_work_run+0x199/0x270 [ 47.571729] ? task_work_cancel+0x210/0x210 [ 47.576019] ? free_nsproxy+0x185/0x1f0 [ 47.579961] ? switch_task_namespaces+0xa2/0xc0 [ 47.584599] do_exit+0x9b5/0x1ad0 [ 47.588023] ? kvfree+0x3b/0x60 [ 47.591272] ? mm_update_next_owner+0x930/0x930 [ 47.595907] ? find_held_lock+0x35/0x1d0 [ 47.599940] ? handle_mm_fault+0x248/0x8d0 [ 47.604145] ? find_held_lock+0x35/0x1d0 [ 47.608182] ? __do_page_fault+0x64c/0xd60 [ 47.612382] ? lock_downgrade+0x990/0x990 [ 47.616503] ? handle_mm_fault+0x410/0x8d0 [ 47.620703] ? __do_page_fault+0x31e/0xd60 [ 47.624905] ? __handle_mm_fault+0x39c0/0x39c0 [ 47.629451] ? vmacache_find+0x5f/0x280 [ 47.633397] ? up_read+0x1a/0x40 [ 47.636728] ? __do_page_fault+0x3d6/0xd60 [ 47.640935] ? mm_fault_error+0x2c0/0x2c0 [ 47.645048] ? do_vfs_ioctl+0x486/0x1520 [ 47.649081] ? do_page_fault+0xee/0x720 [ 47.653021] ? __do_page_fault+0xd60/0xd60 [ 47.657222] ? putname+0xf3/0x130 [ 47.660645] do_group_exit+0x149/0x400 [ 47.664498] ? SyS_exit+0x30/0x30 [ 47.667916] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 47.672900] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 47.677624] SyS_exit_group+0x1d/0x20 [ 47.681391] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 47.686111] RIP: 0033:0x444e29 [ 47.689268] RSP: 002b:00007ffceefc70c8 EFLAGS: 00000202 ORIG_RAX: 00000000000000e7 [ 47.696940] RAX: ffffffffffffffda RBX: 00007ffceefc7110 RCX: 0000000000444e29 [ 47.704175] RDX: 0000000000444e29 RSI: 0000000020927fd8 RDI: 0000000000000001 [ 47.711411] RBP: 0000000000000082 R08: 0000000000000000 R09: 00007ffceefc7110 [ 47.718646] R10: 0000000000000000 R11: 0000000000000202 R12: 00000000004021d0 [ 47.725881] R13: 0000000000402260 R14: 0000000000000000 R15: 0000000000000000 [ 47.733132] [ 47.734730] Allocated by task 2990: [ 47.738325] save_stack_trace+0x16/0x20 [ 47.742263] save_stack+0x43/0xd0 [ 47.745680] kasan_kmalloc+0xad/0xe0 [ 47.749357] __kmalloc_node+0x47/0x70 [ 47.753120] kvmalloc_node+0x64/0xd0 [ 47.756800] alloc_netdev_mqs+0x16e/0xed0 [ 47.760910] __tun_chr_ioctl+0x12b2/0x3d20 [ 47.765106] tun_chr_ioctl+0x2a/0x40 [ 47.768785] do_vfs_ioctl+0x1b1/0x1520 [ 47.772638] SyS_ioctl+0x8f/0xc0 [ 47.775967] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 47.780686] [ 47.782276] Freed by task 2990: [ 47.785520] save_stack_trace+0x16/0x20 [ 47.789460] save_stack+0x43/0xd0 [ 47.792879] kasan_slab_free+0x71/0xc0 [ 47.796730] kfree+0xca/0x250 [ 47.799805] kvfree+0x36/0x60 [ 47.802875] free_netdev+0x2cf/0x360 [ 47.806552] __tun_chr_ioctl+0x2cea/0x3d20 [ 47.810750] tun_chr_ioctl+0x2a/0x40 [ 47.814429] do_vfs_ioctl+0x1b1/0x1520 [ 47.818281] SyS_ioctl+0x8f/0xc0 [ 47.821613] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 47.826329] [ 47.827922] The buggy address belongs to the object at ffff8801d27b8340 [ 47.827922] which belongs to the cache kmalloc-16384 of size 16384 [ 47.840888] The buggy address is located 13112 bytes inside of [ 47.840888] 16384-byte region [ffff8801d27b8340, ffff8801d27bc340) [ 47.853071] The buggy address belongs to the page: [ 47.857965] page:ffffea000749ee00 count:1 mapcount:0 mapping:ffff8801d27b8340 index:0x0 compound_mapcount: 0 [ 47.867897] flags: 0x200000000008100(slab|head) [ 47.872531] raw: 0200000000008100 ffff8801d27b8340 0000000000000000 0000000100000001 [ 47.880375] raw: ffffea000703ea20 ffff8801dac01c48 ffff8801dac02200 0000000000000000 [ 47.888218] page dumped because: kasan: bad access detected [ 47.893889] [ 47.895481] Memory state around the buggy address: [ 47.900375] ffff8801d27bb500: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 47.907699] ffff8801d27bb580: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 47.915019] >ffff8801d27bb600: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 47.922339] ^ [ 47.929576] ffff8801d27bb680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 47.936900] ffff8801d27bb700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 47.944221] ================================================================== [ 47.951541] Disabling lock debugging due to kernel taint [ 47.956953] Kernel panic - not syncing: panic_on_warn set ... [ 47.956953] [ 47.964278] CPU: 1 PID: 2990 Comm: syzkaller575355 Tainted: G B 4.14.0-rc5+ #142 [ 47.972903] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 47.982220] Call Trace: [ 47.984775] dump_stack+0x194/0x257 [ 47.988366] ? arch_local_irq_restore+0x53/0x53 [ 47.992998] ? kasan_end_report+0x32/0x50 [ 47.997115] ? lock_downgrade+0x990/0x990 [ 48.001227] ? detach_if_pending+0x540/0x610 [ 48.005600] panic+0x1e4/0x417 [ 48.008758] ? __warn+0x1d9/0x1d9 [ 48.012185] ? detach_if_pending+0x557/0x610 [ 48.016555] kasan_end_report+0x50/0x50 [ 48.020491] kasan_report+0x144/0x340 [ 48.024255] __asan_report_store8_noabort+0x17/0x20 [ 48.029235] detach_if_pending+0x557/0x610 [ 48.033435] ? trace_raw_output_tick_stop+0x130/0x130 [ 48.038588] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 48.043220] ? lock_timer_base+0x1a3/0x2b0 [ 48.047417] ? lock_timer_base+0x1eb/0x2b0 [ 48.051617] ? __internal_add_timer+0x2d0/0x2d0 [ 48.056250] ? lock_downgrade+0x990/0x990 [ 48.060359] ? trace_hardirqs_on+0xd/0x10 [ 48.064473] try_to_del_timer_sync+0xa2/0x120 [ 48.068933] ? del_timer+0x130/0x130 [ 48.072611] ? del_timer_sync+0xeb/0x240 [ 48.076637] del_timer_sync+0x18a/0x240 [ 48.080577] tun_free_netdev+0x105/0x1b0 [ 48.084603] ? tun_xdp+0x410/0x410 [ 48.088105] ? cpumask_next+0x24/0x30 [ 48.091871] ? netdev_refcnt_read+0xed/0x150 [ 48.096245] ? tun_xdp+0x410/0x410 [ 48.099750] netdev_run_todo+0x870/0xca0 [ 48.103776] ? do_group_exit+0x149/0x400 [ 48.107801] ? mark_held_locks+0xaf/0x100 [ 48.111911] ? register_netdev+0x30/0x30 [ 48.115937] ? find_held_lock+0x35/0x1d0 [ 48.119968] ? lock_downgrade+0x990/0x990 [ 48.124083] ? refcount_sub_and_test+0x115/0x1b0 [ 48.128804] ? refcount_inc+0x50/0x50 [ 48.132568] ? refcount_inc+0x50/0x50 [ 48.136335] ? sk_destruct+0x4c/0x80 [ 48.140012] ? __sk_free+0x5c/0x230 [ 48.143601] ? sk_free+0x2f/0x40 [ 48.146930] ? __tun_detach+0x176/0x1390 [ 48.150960] ? tun_attach+0xfa0/0xfa0 [ 48.154730] ? locks_remove_file+0x3fa/0x5a0 [ 48.159104] ? fcntl_setlk+0x10c0/0x10c0 [ 48.163131] ? __fsnotify_parent+0xb4/0x3a0 [ 48.167416] ? fsnotify+0x1af0/0x1af0 [ 48.171184] ? __tun_detach+0x1390/0x1390 [ 48.175297] rtnl_unlock+0xe/0x10 [ 48.178715] tun_chr_close+0x49/0x60 [ 48.182393] __fput+0x327/0x7e0 [ 48.185638] ? fput+0x140/0x140 [ 48.188883] ? check_same_owner+0x320/0x320 [ 48.193170] ____fput+0x15/0x20 [ 48.196413] task_work_run+0x199/0x270 [ 48.200265] ? task_work_cancel+0x210/0x210 [ 48.204550] ? free_nsproxy+0x185/0x1f0 [ 48.208487] ? switch_task_namespaces+0xa2/0xc0 [ 48.213123] do_exit+0x9b5/0x1ad0 [ 48.216541] ? kvfree+0x3b/0x60 [ 48.219789] ? mm_update_next_owner+0x930/0x930 [ 48.224418] ? find_held_lock+0x35/0x1d0 [ 48.228449] ? handle_mm_fault+0x248/0x8d0 [ 48.232650] ? find_held_lock+0x35/0x1d0 [ 48.236679] ? __do_page_fault+0x64c/0xd60 [ 48.240880] ? lock_downgrade+0x990/0x990 [ 48.244996] ? handle_mm_fault+0x410/0x8d0 [ 48.249194] ? __do_page_fault+0x31e/0xd60 [ 48.253393] ? __handle_mm_fault+0x39c0/0x39c0 [ 48.257939] ? vmacache_find+0x5f/0x280 [ 48.261879] ? up_read+0x1a/0x40 [ 48.265208] ? __do_page_fault+0x3d6/0xd60 [ 48.269418] ? mm_fault_error+0x2c0/0x2c0 [ 48.273532] ? do_vfs_ioctl+0x486/0x1520 [ 48.277560] ? do_page_fault+0xee/0x720 [ 48.281500] ? __do_page_fault+0xd60/0xd60 [ 48.285701] ? putname+0xf3/0x130 [ 48.289121] do_group_exit+0x149/0x400 [ 48.292974] ? SyS_exit+0x30/0x30 [ 48.296392] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 48.301375] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 48.306098] SyS_exit_group+0x1d/0x20 [ 48.309866] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 48.314594] RIP: 0033:0x444e29 [ 48.317751] RSP: 002b:00007ffceefc70c8 EFLAGS: 00000202 ORIG_RAX: 00000000000000e7 [ 48.325424] RAX: ffffffffffffffda RBX: 00007ffceefc7110 RCX: 0000000000444e29 [ 48.332658] RDX: 0000000000444e29 RSI: 0000000020927fd8 RDI: 0000000000000001 [ 48.339892] RBP: 0000000000000082 R08: 0000000000000000 R09: 00007ffceefc7110 [ 48.347127] R10: 0000000000000000 R11: 0000000000000202 R12: 00000000004021d0 [ 48.354359] R13: 0000000000402260 R14: 0000000000000000 R15: 0000000000000000