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.0.53' (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.021429] ================================================================== [ 47.028876] BUG: KASAN: use-after-free in detach_if_pending+0x557/0x610 [ 47.035606] Write of size 8 at addr ffff8801cebcb780 by task syzkaller265592/2987 [ 47.043199] [ 47.044802] CPU: 0 PID: 2987 Comm: syzkaller265592 Not tainted 4.13.0+ #83 [ 47.051793] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 47.061122] Call Trace: [ 47.063686] dump_stack+0x194/0x257 [ 47.067290] ? arch_local_irq_restore+0x53/0x53 [ 47.071929] ? show_regs_print_info+0x65/0x65 [ 47.076399] ? lock_timer_base+0x1a3/0x2b0 [ 47.080607] ? detach_if_pending+0x557/0x610 [ 47.084989] print_address_description+0x73/0x250 [ 47.089803] ? detach_if_pending+0x557/0x610 [ 47.094185] kasan_report+0x24e/0x340 [ 47.097960] __asan_report_store8_noabort+0x17/0x20 [ 47.102949] detach_if_pending+0x557/0x610 [ 47.107155] ? trace_raw_output_tick_stop+0x130/0x130 [ 47.112319] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 47.116957] ? lock_timer_base+0x1a3/0x2b0 [ 47.121164] ? lock_timer_base+0x1eb/0x2b0 [ 47.125373] ? __internal_add_timer+0x2d0/0x2d0 [ 47.130016] ? trace_hardirqs_on+0xd/0x10 [ 47.134152] try_to_del_timer_sync+0xa2/0x120 [ 47.138705] ? del_timer+0x130/0x130 [ 47.142398] ? del_timer_sync+0xeb/0x240 [ 47.146461] del_timer_sync+0x18a/0x240 [ 47.150414] tun_free_netdev+0x105/0x1b0 [ 47.154454] ? tun_xdp+0x410/0x410 [ 47.157965] ? cpumask_next+0x24/0x30 [ 47.161740] ? netdev_refcnt_read+0xed/0x150 [ 47.166128] ? tun_xdp+0x410/0x410 [ 47.169640] netdev_run_todo+0x870/0xca0 [ 47.173673] ? do_group_exit+0x149/0x400 [ 47.177710] ? register_netdev+0x30/0x30 [ 47.181743] ? lock_downgrade+0x990/0x990 [ 47.185863] ? trace_hardirqs_on+0xd/0x10 [ 47.189998] ? refcount_sub_and_test+0x115/0x1b0 [ 47.194724] ? refcount_inc+0x50/0x50 [ 47.198494] ? refcount_inc+0x50/0x50 [ 47.202270] ? sk_destruct+0x4c/0x80 [ 47.205952] ? __sk_free+0x5c/0x230 [ 47.209549] ? sk_free+0x2f/0x40 [ 47.212887] ? __tun_detach+0x176/0x1390 [ 47.216929] ? tun_attach+0xf90/0xf90 [ 47.220718] ? locks_remove_file+0x3fa/0x5a0 [ 47.225099] ? fcntl_setlk+0x10d0/0x10d0 [ 47.229135] ? __fsnotify_parent+0xb4/0x3a0 [ 47.233435] ? fsnotify+0x1af0/0x1af0 [ 47.237217] ? __tun_detach+0x1390/0x1390 [ 47.241339] ? __tun_detach+0x1390/0x1390 [ 47.245457] rtnl_unlock+0xe/0x10 [ 47.248878] tun_chr_close+0x49/0x60 [ 47.252570] __fput+0x333/0x7f0 [ 47.255844] ? fput+0x140/0x140 [ 47.259095] ? check_same_owner+0x320/0x320 [ 47.263394] ____fput+0x15/0x20 [ 47.266652] task_work_run+0x199/0x270 [ 47.270520] ? task_work_cancel+0x210/0x210 [ 47.274812] ? free_nsproxy+0x185/0x1f0 [ 47.278758] ? switch_task_namespaces+0xa2/0xc0 [ 47.283401] do_exit+0xa52/0x1b40 [ 47.286834] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 47.291825] ? check_noncircular+0x20/0x20 [ 47.296041] ? mm_update_next_owner+0x930/0x930 [ 47.300683] ? __pmd_alloc+0x4e0/0x4e0 [ 47.304556] ? find_held_lock+0x39/0x1d0 [ 47.308601] ? lock_downgrade+0x990/0x990 [ 47.312739] ? handle_mm_fault+0x410/0x8d0 [ 47.316952] ? down_read_trylock+0xdb/0x170 [ 47.321247] ? __handle_mm_fault+0x39c0/0x39c0 [ 47.325798] ? vmacache_find+0x61/0x270 [ 47.329743] ? vmacache_update+0xfe/0x130 [ 47.333872] ? up_read+0x1a/0x40 [ 47.337209] ? __do_page_fault+0x35b/0xb60 [ 47.341462] ? do_vfs_ioctl+0x492/0x1530 [ 47.345510] ? do_page_fault+0xee/0x720 [ 47.349465] ? __do_page_fault+0xb60/0xb60 [ 47.353670] ? putname+0xf3/0x130 [ 47.357108] do_group_exit+0x149/0x400 [ 47.360966] ? lockdep_sys_exit+0x47/0xf0 [ 47.365091] ? SyS_exit+0x30/0x30 [ 47.368517] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 47.373507] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 47.378240] SyS_exit_group+0x1d/0x20 [ 47.382020] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 47.386744] RIP: 0033:0x444ec9 [ 47.389905] RSP: 002b:00007ffdfcfee898 EFLAGS: 00000206 ORIG_RAX: 00000000000000e7 [ 47.397589] RAX: ffffffffffffffda RBX: 00007ffdfcfee8e0 RCX: 0000000000444ec9 [ 47.404835] RDX: 0000000000444ec9 RSI: 0000000020822000 RDI: 0000000000000001 [ 47.412087] RBP: 0000000000000082 R08: 0000000000000000 R09: 00007ffdfcfee8e0 [ 47.419330] R10: 0000000000000000 R11: 0000000000000206 R12: 0000000000402210 [ 47.426572] R13: 00000000004022a0 R14: 0000000000000000 R15: 0000000000000000 [ 47.433991] [ 47.435592] Allocated by task 2987: [ 47.439196] save_stack_trace+0x16/0x20 [ 47.443154] save_stack+0x43/0xd0 [ 47.446577] kasan_kmalloc+0xad/0xe0 [ 47.450262] __kmalloc_node+0x47/0x70 [ 47.454029] kvmalloc_node+0x64/0xd0 [ 47.457714] alloc_netdev_mqs+0x16e/0xed0 [ 47.461833] __tun_chr_ioctl+0x12be/0x3d20 [ 47.466035] tun_chr_ioctl+0x2a/0x40 [ 47.469717] do_vfs_ioctl+0x1b1/0x1530 [ 47.473573] SyS_ioctl+0x8f/0xc0 [ 47.476909] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 47.481630] [ 47.483229] Freed by task 2987: [ 47.486476] save_stack_trace+0x16/0x20 [ 47.490419] save_stack+0x43/0xd0 [ 47.493857] kasan_slab_free+0x71/0xc0 [ 47.497712] kfree+0xca/0x250 [ 47.500787] kvfree+0x36/0x60 [ 47.503862] free_netdev+0x2cf/0x360 [ 47.507543] __tun_chr_ioctl+0x2cf6/0x3d20 [ 47.511747] tun_chr_ioctl+0x2a/0x40 [ 47.515430] do_vfs_ioctl+0x1b1/0x1530 [ 47.519286] SyS_ioctl+0x8f/0xc0 [ 47.522621] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 47.527344] [ 47.528944] The buggy address belongs to the object at ffff8801cebc8380 [ 47.528944] which belongs to the cache kmalloc-16384 of size 16384 [ 47.541916] The buggy address is located 13312 bytes inside of [ 47.541916] 16384-byte region [ffff8801cebc8380, ffff8801cebcc380) [ 47.554129] The buggy address belongs to the page: [ 47.559033] page:ffffea00073af200 count:1 mapcount:0 mapping:ffff8801cebc8380 index:0x0 compound_mapcount: 0 [ 47.568984] flags: 0x200000000008100(slab|head) [ 47.573622] raw: 0200000000008100 ffff8801cebc8380 0000000000000000 0000000100000001 [ 47.581474] raw: ffffea0007382620 ffff8801dac01c50 ffff8801dac02200 0000000000000000 [ 47.589323] page dumped because: kasan: bad access detected [ 47.594998] [ 47.596595] Memory state around the buggy address: [ 47.601491] ffff8801cebcb680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 47.608819] ffff8801cebcb700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 47.616148] >ffff8801cebcb780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 47.623475] ^ [ 47.626812] ffff8801cebcb800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 47.634142] ffff8801cebcb880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 47.641470] ================================================================== [ 47.648797] Disabling lock debugging due to kernel taint [ 47.654213] Kernel panic - not syncing: panic_on_warn set ... [ 47.654213] [ 47.661542] CPU: 0 PID: 2987 Comm: syzkaller265592 Tainted: G B 4.13.0+ #83 [ 47.669732] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 47.679051] Call Trace: [ 47.681608] dump_stack+0x194/0x257 [ 47.685200] ? arch_local_irq_restore+0x53/0x53 [ 47.689836] ? vprintk_default+0x28/0x30 [ 47.693862] ? detach_if_pending+0x500/0x610 [ 47.698236] panic+0x1e4/0x417 [ 47.701394] ? __warn+0x1d9/0x1d9 [ 47.704829] ? detach_if_pending+0x557/0x610 [ 47.709206] kasan_end_report+0x50/0x50 [ 47.713143] kasan_report+0x137/0x340 [ 47.716909] __asan_report_store8_noabort+0x17/0x20 [ 47.721887] detach_if_pending+0x557/0x610 [ 47.726088] ? trace_raw_output_tick_stop+0x130/0x130 [ 47.731244] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 47.735878] ? lock_timer_base+0x1a3/0x2b0 [ 47.740077] ? lock_timer_base+0x1eb/0x2b0 [ 47.744283] ? __internal_add_timer+0x2d0/0x2d0 [ 47.748917] ? trace_hardirqs_on+0xd/0x10 [ 47.753035] try_to_del_timer_sync+0xa2/0x120 [ 47.757500] ? del_timer+0x130/0x130 [ 47.761181] ? del_timer_sync+0xeb/0x240 [ 47.765212] del_timer_sync+0x18a/0x240 [ 47.769153] tun_free_netdev+0x105/0x1b0 [ 47.773178] ? tun_xdp+0x410/0x410 [ 47.776683] ? cpumask_next+0x24/0x30 [ 47.780450] ? netdev_refcnt_read+0xed/0x150 [ 47.784825] ? tun_xdp+0x410/0x410 [ 47.788344] netdev_run_todo+0x870/0xca0 [ 47.792368] ? do_group_exit+0x149/0x400 [ 47.796394] ? register_netdev+0x30/0x30 [ 47.800419] ? lock_downgrade+0x990/0x990 [ 47.804537] ? trace_hardirqs_on+0xd/0x10 [ 47.808660] ? refcount_sub_and_test+0x115/0x1b0 [ 47.813379] ? refcount_inc+0x50/0x50 [ 47.817143] ? refcount_inc+0x50/0x50 [ 47.820910] ? sk_destruct+0x4c/0x80 [ 47.824587] ? __sk_free+0x5c/0x230 [ 47.828179] ? sk_free+0x2f/0x40 [ 47.831508] ? __tun_detach+0x176/0x1390 [ 47.835624] ? tun_attach+0xf90/0xf90 [ 47.839393] ? locks_remove_file+0x3fa/0x5a0 [ 47.843766] ? fcntl_setlk+0x10d0/0x10d0 [ 47.847794] ? __fsnotify_parent+0xb4/0x3a0 [ 47.852088] ? fsnotify+0x1af0/0x1af0 [ 47.855853] ? __tun_detach+0x1390/0x1390 [ 47.859964] ? __tun_detach+0x1390/0x1390 [ 47.864075] rtnl_unlock+0xe/0x10 [ 47.867490] tun_chr_close+0x49/0x60 [ 47.871168] __fput+0x333/0x7f0 [ 47.874415] ? fput+0x140/0x140 [ 47.877659] ? check_same_owner+0x320/0x320 [ 47.881946] ____fput+0x15/0x20 [ 47.885190] task_work_run+0x199/0x270 [ 47.889044] ? task_work_cancel+0x210/0x210 [ 47.893329] ? free_nsproxy+0x185/0x1f0 [ 47.897308] ? switch_task_namespaces+0xa2/0xc0 [ 47.901951] do_exit+0xa52/0x1b40 [ 47.905368] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 47.910351] ? check_noncircular+0x20/0x20 [ 47.914556] ? mm_update_next_owner+0x930/0x930 [ 47.919188] ? __pmd_alloc+0x4e0/0x4e0 [ 47.923049] ? find_held_lock+0x39/0x1d0 [ 47.927079] ? lock_downgrade+0x990/0x990 [ 47.931204] ? handle_mm_fault+0x410/0x8d0 [ 47.935402] ? down_read_trylock+0xdb/0x170 [ 47.939688] ? __handle_mm_fault+0x39c0/0x39c0 [ 47.944241] ? vmacache_find+0x61/0x270 [ 47.948178] ? vmacache_update+0xfe/0x130 [ 47.952294] ? up_read+0x1a/0x40 [ 47.955626] ? __do_page_fault+0x35b/0xb60 [ 47.959823] ? do_vfs_ioctl+0x492/0x1530 [ 47.963852] ? do_page_fault+0xee/0x720 [ 47.967790] ? __do_page_fault+0xb60/0xb60 [ 47.971989] ? putname+0xf3/0x130 [ 47.975409] do_group_exit+0x149/0x400 [ 47.979260] ? lockdep_sys_exit+0x47/0xf0 [ 47.983371] ? SyS_exit+0x30/0x30 [ 47.986790] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 47.991865] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 47.996604] SyS_exit_group+0x1d/0x20 [ 48.000375] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 48.005101] RIP: 0033:0x444ec9 [ 48.008257] RSP: 002b:00007ffdfcfee898 EFLAGS: 00000206 ORIG_RAX: 00000000000000e7 [ 48.015928] RAX: ffffffffffffffda RBX: 00007ffdfcfee8e0 RCX: 0000000000444ec9