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-mmots-kasan-gce-4,10.128.0.56' (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: [ 31.299370] ================================================================== [ 31.306811] BUG: KASAN: use-after-free in detach_if_pending+0x557/0x610 [ 31.313540] Write of size 8 at addr ffff8801cde83780 by task syzkaller102937/2984 [ 31.321132] [ 31.322738] CPU: 1 PID: 2984 Comm: syzkaller102937 Not tainted 4.13.0-mm1+ #7 [ 31.329993] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 31.339317] Call Trace: [ 31.341880] dump_stack+0x194/0x257 [ 31.345489] ? arch_local_irq_restore+0x53/0x53 [ 31.350133] ? show_regs_print_info+0x65/0x65 [ 31.354603] ? lock_timer_base+0x1a3/0x2b0 [ 31.358813] ? detach_if_pending+0x557/0x610 [ 31.363206] print_address_description+0x73/0x250 [ 31.368036] ? detach_if_pending+0x557/0x610 [ 31.372420] kasan_report+0x24e/0x340 [ 31.376198] __asan_report_store8_noabort+0x17/0x20 [ 31.381184] detach_if_pending+0x557/0x610 [ 31.385401] ? trace_raw_output_tick_stop+0x130/0x130 [ 31.390564] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 31.395204] ? lock_timer_base+0x1a3/0x2b0 [ 31.399410] ? lock_timer_base+0x1eb/0x2b0 [ 31.403632] ? __internal_add_timer+0x2d0/0x2d0 [ 31.408276] ? trace_hardirqs_on+0xd/0x10 [ 31.412414] try_to_del_timer_sync+0xa2/0x120 [ 31.416900] ? del_timer+0x130/0x130 [ 31.420589] ? del_timer_sync+0xeb/0x240 [ 31.424631] del_timer_sync+0x18a/0x240 [ 31.428584] tun_free_netdev+0x105/0x1b0 [ 31.432620] ? tun_xdp+0x410/0x410 [ 31.436140] ? cpumask_next+0x24/0x30 [ 31.439918] ? netdev_refcnt_read+0xed/0x150 [ 31.444303] ? tun_xdp+0x410/0x410 [ 31.447817] netdev_run_todo+0x870/0xca0 [ 31.451849] ? do_group_exit+0x149/0x400 [ 31.455903] ? register_netdev+0x30/0x30 [ 31.459942] ? lock_downgrade+0x990/0x990 [ 31.464063] ? trace_hardirqs_on+0xd/0x10 [ 31.468221] ? refcount_sub_and_test+0x115/0x1b0 [ 31.472952] ? refcount_inc+0x50/0x50 [ 31.476727] ? refcount_inc+0x50/0x50 [ 31.480505] ? sk_destruct+0x4c/0x80 [ 31.484193] ? __sk_free+0x5c/0x230 [ 31.487806] ? sk_free+0x2f/0x40 [ 31.491155] ? __tun_detach+0x176/0x1390 [ 31.495210] ? tun_attach+0xf90/0xf90 [ 31.498996] ? locks_remove_file+0x3fa/0x5a0 [ 31.503382] ? fcntl_setlk+0x10d0/0x10d0 [ 31.507421] ? __fsnotify_parent+0xb4/0x3a0 [ 31.511719] ? fsnotify+0x1af0/0x1af0 [ 31.515497] ? __tun_detach+0x1390/0x1390 [ 31.519618] ? __tun_detach+0x1390/0x1390 [ 31.523742] rtnl_unlock+0xe/0x10 [ 31.527177] tun_chr_close+0x49/0x60 [ 31.530868] __fput+0x333/0x7f0 [ 31.534126] ? fput+0x140/0x140 [ 31.537380] ? check_same_owner+0x320/0x320 [ 31.541679] ____fput+0x15/0x20 [ 31.544930] task_work_run+0x199/0x270 [ 31.548793] ? task_work_cancel+0x210/0x210 [ 31.553087] ? free_nsproxy+0x185/0x1f0 [ 31.557033] ? switch_task_namespaces+0xa2/0xc0 [ 31.561692] do_exit+0xa52/0x1b40 [ 31.565121] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 31.570113] ? check_noncircular+0x20/0x20 [ 31.574329] ? mm_update_next_owner+0x930/0x930 [ 31.578971] ? __pmd_alloc+0x4e0/0x4e0 [ 31.582842] ? find_held_lock+0x39/0x1d0 [ 31.586890] ? lock_downgrade+0x990/0x990 [ 31.591033] ? handle_mm_fault+0x410/0x8d0 [ 31.595239] ? down_read_trylock+0xdb/0x170 [ 31.599534] ? __handle_mm_fault+0x39c0/0x39c0 [ 31.604089] ? vmacache_find+0x61/0x270 [ 31.608043] ? up_read+0x1a/0x40 [ 31.611382] ? __do_page_fault+0x35b/0xb60 [ 31.615588] ? do_vfs_ioctl+0x492/0x1530 [ 31.619628] ? do_page_fault+0xee/0x720 [ 31.623575] ? __do_page_fault+0xb60/0xb60 [ 31.627783] ? iterate_fd+0x3f0/0x3f0 [ 31.631553] ? putname+0xf3/0x130 [ 31.634987] do_group_exit+0x149/0x400 [ 31.638851] ? lockdep_sys_exit+0x47/0xf0 [ 31.642969] ? SyS_exit+0x30/0x30 [ 31.646396] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 31.651383] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 31.656114] SyS_exit_group+0x1d/0x20 [ 31.659890] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 31.664616] RIP: 0033:0x444ea9 [ 31.667779] RSP: 002b:00007ffc87f3bac8 EFLAGS: 00000202 ORIG_RAX: 00000000000000e7 [ 31.675462] RAX: ffffffffffffffda RBX: 00007ffc87f3bb10 RCX: 0000000000444ea9 [ 31.682703] RDX: 0000000000444ea9 RSI: 0000000020029000 RDI: 0000000000000001 [ 31.689945] RBP: 0000000000000082 R08: 0000000000000000 R09: 00007ffc87f3bb10 [ 31.697187] R10: 0000000000000000 R11: 0000000000000202 R12: 00000000004021f0 [ 31.704429] R13: 0000000000402280 R14: 0000000000000000 R15: 0000000000000000 [ 31.711687] [ 31.713287] Allocated by task 2984: [ 31.716888] save_stack_trace+0x16/0x20 [ 31.720835] save_stack+0x43/0xd0 [ 31.724260] kasan_kmalloc+0xad/0xe0 [ 31.727946] __kmalloc_node+0x47/0x70 [ 31.731720] kvmalloc_node+0x64/0xd0 [ 31.735409] alloc_netdev_mqs+0x16e/0xed0 [ 31.739526] __tun_chr_ioctl+0x12be/0x3d20 [ 31.743733] tun_chr_ioctl+0x2a/0x40 [ 31.747416] do_vfs_ioctl+0x1b1/0x1530 [ 31.751273] SyS_ioctl+0x8f/0xc0 [ 31.754610] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 31.759333] [ 31.760939] Freed by task 2984: [ 31.764188] save_stack_trace+0x16/0x20 [ 31.768133] save_stack+0x43/0xd0 [ 31.771555] kasan_slab_free+0x71/0xc0 [ 31.775413] kfree+0xca/0x250 [ 31.778490] kvfree+0x36/0x60 [ 31.781569] free_netdev+0x2cf/0x360 [ 31.785253] __tun_chr_ioctl+0x2cf6/0x3d20 [ 31.789459] tun_chr_ioctl+0x2a/0x40 [ 31.793151] do_vfs_ioctl+0x1b1/0x1530 [ 31.797012] SyS_ioctl+0x8f/0xc0 [ 31.800349] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 31.805072] [ 31.806672] The buggy address belongs to the object at ffff8801cde80380 [ 31.806672] which belongs to the cache kmalloc-16384 of size 16384 [ 31.819656] The buggy address is located 13312 bytes inside of [ 31.819656] 16384-byte region [ffff8801cde80380, ffff8801cde84380) [ 31.831860] The buggy address belongs to the page: [ 31.836759] page:ffffea000737a000 count:1 mapcount:0 mapping:ffff8801cde80380 index:0x0 compound_mapcount: 0 [ 31.846704] flags: 0x200000000008100(slab|head) [ 31.851344] raw: 0200000000008100 ffff8801cde80380 0000000000000000 0000000100000001 [ 31.859195] raw: ffffea000733e020 ffff8801dac01c50 ffff8801dac02200 0000000000000000 [ 31.867047] page dumped because: kasan: bad access detected [ 31.872726] [ 31.874321] Memory state around the buggy address: [ 31.879219] ffff8801cde83680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 31.886550] ffff8801cde83700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 31.893892] >ffff8801cde83780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 31.901222] ^ [ 31.904586] ffff8801cde83800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 31.911926] ffff8801cde83880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 31.919257] ================================================================== [ 31.926586] Disabling lock debugging due to kernel taint [ 31.932001] Kernel panic - not syncing: panic_on_warn set ... [ 31.932001] [ 31.939329] CPU: 1 PID: 2984 Comm: syzkaller102937 Tainted: G B 4.13.0-mm1+ #7 [ 31.947784] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 31.957104] Call Trace: [ 31.959667] dump_stack+0x194/0x257 [ 31.963261] ? arch_local_irq_restore+0x53/0x53 [ 31.967897] ? vprintk_default+0x28/0x30 [ 31.971934] ? detach_if_pending+0x550/0x610 [ 31.976311] panic+0x1e4/0x417 [ 31.979470] ? __warn+0x1d9/0x1d9 [ 31.982894] ? detach_if_pending+0x557/0x610 [ 31.987268] kasan_end_report+0x50/0x50 [ 31.991207] kasan_report+0x137/0x340 [ 31.994975] __asan_report_store8_noabort+0x17/0x20 [ 31.999955] detach_if_pending+0x557/0x610 [ 32.004155] ? trace_raw_output_tick_stop+0x130/0x130 [ 32.009319] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 32.013950] ? lock_timer_base+0x1a3/0x2b0 [ 32.018148] ? lock_timer_base+0x1eb/0x2b0 [ 32.022349] ? __internal_add_timer+0x2d0/0x2d0 [ 32.026984] ? trace_hardirqs_on+0xd/0x10 [ 32.031100] try_to_del_timer_sync+0xa2/0x120 [ 32.035558] ? del_timer+0x130/0x130 [ 32.039237] ? del_timer_sync+0xeb/0x240 [ 32.043266] del_timer_sync+0x18a/0x240 [ 32.047206] tun_free_netdev+0x105/0x1b0 [ 32.051231] ? tun_xdp+0x410/0x410 [ 32.054735] ? cpumask_next+0x24/0x30 [ 32.058503] ? netdev_refcnt_read+0xed/0x150 [ 32.062878] ? tun_xdp+0x410/0x410 [ 32.066382] netdev_run_todo+0x870/0xca0 [ 32.070407] ? do_group_exit+0x149/0x400 [ 32.074435] ? register_netdev+0x30/0x30 [ 32.078463] ? lock_downgrade+0x990/0x990 [ 32.082576] ? trace_hardirqs_on+0xd/0x10 [ 32.086698] ? refcount_sub_and_test+0x115/0x1b0 [ 32.091417] ? refcount_inc+0x50/0x50 [ 32.095181] ? refcount_inc+0x50/0x50 [ 32.098950] ? sk_destruct+0x4c/0x80 [ 32.102628] ? __sk_free+0x5c/0x230 [ 32.106220] ? sk_free+0x2f/0x40 [ 32.109552] ? __tun_detach+0x176/0x1390 [ 32.113584] ? tun_attach+0xf90/0xf90 [ 32.117355] ? locks_remove_file+0x3fa/0x5a0 [ 32.121731] ? fcntl_setlk+0x10d0/0x10d0 [ 32.125758] ? __fsnotify_parent+0xb4/0x3a0 [ 32.130056] ? fsnotify+0x1af0/0x1af0 [ 32.133824] ? __tun_detach+0x1390/0x1390 [ 32.137938] ? __tun_detach+0x1390/0x1390 [ 32.142052] rtnl_unlock+0xe/0x10 [ 32.145470] tun_chr_close+0x49/0x60 [ 32.149151] __fput+0x333/0x7f0 [ 32.152398] ? fput+0x140/0x140 [ 32.155643] ? check_same_owner+0x320/0x320 [ 32.159932] ____fput+0x15/0x20 [ 32.163178] task_work_run+0x199/0x270 [ 32.167029] ? task_work_cancel+0x210/0x210 [ 32.171316] ? free_nsproxy+0x185/0x1f0 [ 32.175261] ? switch_task_namespaces+0xa2/0xc0 [ 32.179906] do_exit+0xa52/0x1b40 [ 32.183326] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 32.188310] ? check_noncircular+0x20/0x20 [ 32.192526] ? mm_update_next_owner+0x930/0x930 [ 32.197161] ? __pmd_alloc+0x4e0/0x4e0 [ 32.201018] ? find_held_lock+0x39/0x1d0 [ 32.205050] ? lock_downgrade+0x990/0x990 [ 32.209172] ? handle_mm_fault+0x410/0x8d0 [ 32.213371] ? down_read_trylock+0xdb/0x170 [ 32.217657] ? __handle_mm_fault+0x39c0/0x39c0 [ 32.222213] ? vmacache_find+0x61/0x270 [ 32.226154] ? up_read+0x1a/0x40 [ 32.229485] ? __do_page_fault+0x35b/0xb60 [ 32.233686] ? do_vfs_ioctl+0x492/0x1530 [ 32.237719] ? do_page_fault+0xee/0x720 [ 32.241659] ? __do_page_fault+0xb60/0xb60 [ 32.245870] ? iterate_fd+0x3f0/0x3f0 [ 32.249636] ? putname+0xf3/0x130 [ 32.253057] do_group_exit+0x149/0x400 [ 32.256912] ? lockdep_sys_exit+0x47/0xf0 [ 32.261023] ? SyS_exit+0x30/0x30 [ 32.264444] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 32.269437] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 32.274158] SyS_exit_group+0x1d/0x20 [ 32.277926] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 32.282647] RIP: 0033:0x444ea9 [ 32.285800] RSP: 002b:00007ffc87f3bac8 EFLAGS: 00000202 ORIG_RAX: 00000000000000e7 [ 32.293473] RAX: ffffffffffffffda RBX: 00007ffc87f3bb10 RCX: 0000000000444ea9