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-7,10.128.15.217' (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: [ 40.962435] ================================================================== [ 40.969854] BUG: KASAN: use-after-free in detach_if_pending+0x557/0x610 [ 40.976664] Write of size 8 at addr ffff8801cd853740 by task syzkaller731982/2983 [ 40.984268] [ 40.985872] CPU: 1 PID: 2983 Comm: syzkaller731982 Not tainted 4.14.0-rc2-mm1+ #9 [ 40.993462] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 41.002785] Call Trace: [ 41.005352] dump_stack+0x194/0x257 [ 41.008962] ? arch_local_irq_restore+0x53/0x53 [ 41.013614] ? show_regs_print_info+0x65/0x65 [ 41.018086] ? lock_timer_base+0x1a3/0x2b0 [ 41.022296] ? detach_if_pending+0x557/0x610 [ 41.026680] print_address_description+0x73/0x250 [ 41.031496] ? detach_if_pending+0x557/0x610 [ 41.035875] kasan_report+0x25b/0x340 [ 41.039659] __asan_report_store8_noabort+0x17/0x20 [ 41.044644] detach_if_pending+0x557/0x610 [ 41.048863] ? trace_raw_output_tick_stop+0x130/0x130 [ 41.054028] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 41.058937] ? lock_timer_base+0x1a3/0x2b0 [ 41.063148] ? lock_timer_base+0x1eb/0x2b0 [ 41.067357] ? __internal_add_timer+0x2d0/0x2d0 [ 41.072000] ? trace_hardirqs_on+0xd/0x10 [ 41.076143] try_to_del_timer_sync+0xa2/0x120 [ 41.080622] ? del_timer+0x130/0x130 [ 41.084307] ? del_timer_sync+0xeb/0x240 [ 41.088345] del_timer_sync+0x18a/0x240 [ 41.092307] tun_free_netdev+0x105/0x1b0 [ 41.096341] ? tun_xdp+0x410/0x410 [ 41.099936] ? cpumask_next+0x24/0x30 [ 41.103707] ? netdev_refcnt_read+0xed/0x150 [ 41.108459] ? tun_xdp+0x410/0x410 [ 41.111971] netdev_run_todo+0x870/0xca0 [ 41.116005] ? do_group_exit+0x149/0x400 [ 41.120040] ? register_netdev+0x30/0x30 [ 41.124073] ? lock_downgrade+0x990/0x990 [ 41.128191] ? trace_hardirqs_on+0xd/0x10 [ 41.132327] ? refcount_sub_and_test+0x115/0x1b0 [ 41.137056] ? refcount_inc+0x50/0x50 [ 41.140827] ? refcount_inc+0x50/0x50 [ 41.144601] ? sk_destruct+0x4c/0x80 [ 41.148286] ? __sk_free+0x5c/0x230 [ 41.151884] ? sk_free+0x2f/0x40 [ 41.155222] ? __tun_detach+0x176/0x1390 [ 41.159265] ? tun_attach+0xfa0/0xfa0 [ 41.163041] ? do_raw_spin_trylock+0x190/0x190 [ 41.167596] ? locks_remove_file+0x3fa/0x5a0 [ 41.171976] ? fcntl_setlk+0x10d0/0x10d0 [ 41.176010] ? __fsnotify_parent+0xb4/0x3a0 [ 41.180306] ? fsnotify+0x1af0/0x1af0 [ 41.184079] ? rcu_note_context_switch+0x710/0x710 [ 41.188990] ? __tun_detach+0x1390/0x1390 [ 41.193108] rtnl_unlock+0xe/0x10 [ 41.196529] tun_chr_close+0x49/0x60 [ 41.200227] __fput+0x333/0x7f0 [ 41.203484] ? fput+0x140/0x140 [ 41.206733] ? trace_event_raw_event_sched_switch+0x770/0x770 [ 41.212594] ? _raw_spin_unlock_irq+0x27/0x70 [ 41.217078] ____fput+0x15/0x20 [ 41.220333] task_work_run+0x199/0x270 [ 41.224195] ? task_work_cancel+0x210/0x210 [ 41.228490] ? _raw_spin_unlock+0x22/0x30 [ 41.232611] ? switch_task_namespaces+0x87/0xc0 [ 41.237257] do_exit+0x9c8/0x1b00 [ 41.240694] ? mm_update_next_owner+0x930/0x930 [ 41.245344] ? __pmd_alloc+0x4e0/0x4e0 [ 41.249226] ? find_held_lock+0x39/0x1d0 [ 41.253270] ? lock_downgrade+0x990/0x990 [ 41.257411] ? handle_mm_fault+0x410/0x8d0 [ 41.261614] ? down_read_trylock+0xdb/0x170 [ 41.265933] ? __handle_mm_fault+0x39c0/0x39c0 [ 41.270503] ? vmacache_find+0x5f/0x280 [ 41.274471] ? up_read+0x1a/0x40 [ 41.277818] ? __do_page_fault+0x35b/0xb60 [ 41.282118] ? do_vfs_ioctl+0x492/0x1530 [ 41.286168] ? do_page_fault+0xee/0x720 [ 41.290125] ? __do_page_fault+0xb60/0xb60 [ 41.294432] ? putname+0xf3/0x130 [ 41.297966] do_group_exit+0x149/0x400 [ 41.301830] ? lockdep_sys_exit+0x47/0xf0 [ 41.305953] ? SyS_exit+0x30/0x30 [ 41.309382] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 41.314369] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 41.319096] SyS_exit_group+0x1d/0x20 [ 41.322872] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 41.327601] RIP: 0033:0x4436a8 [ 41.330761] RSP: 002b:00007ffe1e65ac08 EFLAGS: 00000246 ORIG_RAX: 00000000000000e7 [ 41.338441] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00000000004436a8 [ 41.345679] RDX: 0000000000000000 RSI: 000000000000003c RDI: 0000000000000000 [ 41.352917] RBP: 0000000000000086 R08: 00000000000000e7 R09: ffffffffffffffd0 [ 41.360170] R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000001 [ 41.367408] R13: 00000000006d6180 R14: 0000000000000000 R15: 0000000000000000 [ 41.374665] [ 41.376263] Allocated by task 2983: [ 41.379868] save_stack_trace+0x16/0x20 [ 41.383815] save_stack+0x43/0xd0 [ 41.387243] kasan_kmalloc+0xad/0xe0 [ 41.390924] __kmalloc_node+0x47/0x70 [ 41.394696] kvmalloc_node+0x64/0xd0 [ 41.398380] alloc_netdev_mqs+0x16d/0xed0 [ 41.402511] __tun_chr_ioctl+0x12be/0x3d20 [ 41.406716] tun_chr_ioctl+0x2a/0x40 [ 41.410402] do_vfs_ioctl+0x1b1/0x1530 [ 41.414257] SyS_ioctl+0x8f/0xc0 [ 41.417597] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 41.422318] [ 41.423914] Freed by task 2983: [ 41.427177] save_stack_trace+0x16/0x20 [ 41.431122] save_stack+0x43/0xd0 [ 41.434642] kasan_slab_free+0x71/0xc0 [ 41.438498] kfree+0xca/0x250 [ 41.441582] kvfree+0x36/0x60 [ 41.444658] free_netdev+0x2cf/0x360 [ 41.448345] __tun_chr_ioctl+0x2cf6/0x3d20 [ 41.452550] tun_chr_ioctl+0x2a/0x40 [ 41.456234] do_vfs_ioctl+0x1b1/0x1530 [ 41.460177] SyS_ioctl+0x8f/0xc0 [ 41.463515] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 41.468238] [ 41.469838] The buggy address belongs to the object at ffff8801cd850340 [ 41.469838] which belongs to the cache kmalloc-16384 of size 16384 [ 41.482811] The buggy address is located 13312 bytes inside of [ 41.482811] 16384-byte region [ffff8801cd850340, ffff8801cd854340) [ 41.495002] The buggy address belongs to the page: [ 41.499902] page:ffffea0007361400 count:1 mapcount:0 mapping:ffff8801cd850340 index:0x0 compound_mapcount: 0 [ 41.509844] flags: 0x200000000008100(slab|head) [ 41.514576] raw: 0200000000008100 ffff8801cd850340 0000000000000000 0000000100000001 [ 41.522514] raw: ffffea0007364a20 ffff8801dac01c50 ffff8801dac02200 0000000000000000 [ 41.530365] page dumped because: kasan: bad access detected [ 41.536040] [ 41.537634] Memory state around the buggy address: [ 41.542536] ffff8801cd853600: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 41.549871] ffff8801cd853680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 41.557201] >ffff8801cd853700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 41.564529] ^ [ 41.569947] ffff8801cd853780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 41.577275] ffff8801cd853800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 41.584604] ================================================================== [ 41.591929] Disabling lock debugging due to kernel taint [ 41.597339] Kernel panic - not syncing: panic_on_warn set ... [ 41.597339] [ 41.604671] CPU: 1 PID: 2983 Comm: syzkaller731982 Tainted: G B 4.14.0-rc2-mm1+ #9 [ 41.613558] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 41.622876] Call Trace: [ 41.625437] dump_stack+0x194/0x257 [ 41.629035] ? arch_local_irq_restore+0x53/0x53 [ 41.633671] ? vprintk_default+0x28/0x30 [ 41.637705] ? detach_if_pending+0x490/0x610 [ 41.642078] panic+0x1e4/0x417 [ 41.645233] ? __warn+0x1d9/0x1d9 [ 41.648657] ? detach_if_pending+0x557/0x610 [ 41.653034] kasan_end_report+0x50/0x50 [ 41.656973] kasan_report+0x144/0x340 [ 41.660740] __asan_report_store8_noabort+0x17/0x20 [ 41.665726] detach_if_pending+0x557/0x610 [ 41.669926] ? trace_raw_output_tick_stop+0x130/0x130 [ 41.675086] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 41.679719] ? lock_timer_base+0x1a3/0x2b0 [ 41.683917] ? lock_timer_base+0x1eb/0x2b0 [ 41.688118] ? __internal_add_timer+0x2d0/0x2d0 [ 41.692760] ? trace_hardirqs_on+0xd/0x10 [ 41.696882] try_to_del_timer_sync+0xa2/0x120 [ 41.701339] ? del_timer+0x130/0x130 [ 41.705016] ? del_timer_sync+0xeb/0x240 [ 41.709044] del_timer_sync+0x18a/0x240 [ 41.712985] tun_free_netdev+0x105/0x1b0 [ 41.717013] ? tun_xdp+0x410/0x410 [ 41.720515] ? cpumask_next+0x24/0x30 [ 41.724280] ? netdev_refcnt_read+0xed/0x150 [ 41.728654] ? tun_xdp+0x410/0x410 [ 41.732157] netdev_run_todo+0x870/0xca0 [ 41.736189] ? do_group_exit+0x149/0x400 [ 41.740217] ? register_netdev+0x30/0x30 [ 41.744250] ? lock_downgrade+0x990/0x990 [ 41.748361] ? trace_hardirqs_on+0xd/0x10 [ 41.752483] ? refcount_sub_and_test+0x115/0x1b0 [ 41.757207] ? refcount_inc+0x50/0x50 [ 41.760978] ? refcount_inc+0x50/0x50 [ 41.764755] ? sk_destruct+0x4c/0x80 [ 41.768433] ? __sk_free+0x5c/0x230 [ 41.772024] ? sk_free+0x2f/0x40 [ 41.775353] ? __tun_detach+0x176/0x1390 [ 41.779384] ? tun_attach+0xfa0/0xfa0 [ 41.783149] ? do_raw_spin_trylock+0x190/0x190 [ 41.787696] ? locks_remove_file+0x3fa/0x5a0 [ 41.792070] ? fcntl_setlk+0x10d0/0x10d0 [ 41.796103] ? __fsnotify_parent+0xb4/0x3a0 [ 41.800403] ? fsnotify+0x1af0/0x1af0 [ 41.804186] ? rcu_note_context_switch+0x710/0x710 [ 41.809087] ? __tun_detach+0x1390/0x1390 [ 41.813200] rtnl_unlock+0xe/0x10 [ 41.816617] tun_chr_close+0x49/0x60 [ 41.820300] __fput+0x333/0x7f0 [ 41.823544] ? fput+0x140/0x140 [ 41.826790] ? trace_event_raw_event_sched_switch+0x770/0x770 [ 41.832639] ? _raw_spin_unlock_irq+0x27/0x70 [ 41.837107] ____fput+0x15/0x20 [ 41.840356] task_work_run+0x199/0x270 [ 41.844213] ? task_work_cancel+0x210/0x210 [ 41.848586] ? _raw_spin_unlock+0x22/0x30 [ 41.852698] ? switch_task_namespaces+0x87/0xc0 [ 41.857338] do_exit+0x9c8/0x1b00 [ 41.860761] ? mm_update_next_owner+0x930/0x930 [ 41.865392] ? __pmd_alloc+0x4e0/0x4e0 [ 41.869250] ? find_held_lock+0x39/0x1d0 [ 41.873280] ? lock_downgrade+0x990/0x990 [ 41.877427] ? handle_mm_fault+0x410/0x8d0 [ 41.881634] ? down_read_trylock+0xdb/0x170 [ 41.885923] ? __handle_mm_fault+0x39c0/0x39c0 [ 41.890469] ? vmacache_find+0x5f/0x280 [ 41.894412] ? up_read+0x1a/0x40 [ 41.897760] ? __do_page_fault+0x35b/0xb60 [ 41.901976] ? do_vfs_ioctl+0x492/0x1530 [ 41.906027] ? do_page_fault+0xee/0x720 [ 41.909987] ? __do_page_fault+0xb60/0xb60 [ 41.914294] ? putname+0xf3/0x130 [ 41.917729] do_group_exit+0x149/0x400 [ 41.921586] ? lockdep_sys_exit+0x47/0xf0 [ 41.926062] ? SyS_exit+0x30/0x30 [ 41.929497] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 41.934489] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 41.939753] SyS_exit_group+0x1d/0x20 [ 41.943528] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 41.948250] RIP: 0033:0x4436a8 [ 41.951405] RSP: 002b:00007ffe1e65ac08 EFLAGS: 00000246 ORIG_RAX: 00000000000000e7 [ 41.959077] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00000000004436a8