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-9,10.128.0.59' (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: [ 45.028364] ================================================================== [ 45.029518] BUG: KASAN: use-after-free in detach_if_pending+0x557/0x610 [ 45.030443] Write of size 8 at addr ffff8801d20836b8 by task syzkaller877576/2975 [ 45.031458] [ 45.031701] CPU: 1 PID: 2975 Comm: syzkaller877576 Not tainted 4.14.0-rc5+ #134 [ 45.032676] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 45.033976] Call Trace: [ 45.034350] dump_stack+0x194/0x257 [ 45.034842] ? arch_local_irq_restore+0x53/0x53 [ 45.035492] ? show_regs_print_info+0x65/0x65 [ 45.036098] ? lock_timer_base+0x1a3/0x2b0 [ 45.036669] ? detach_if_pending+0x557/0x610 [ 45.037259] print_address_description+0x73/0x250 [ 45.037920] ? detach_if_pending+0x557/0x610 [ 45.038509] kasan_report+0x25b/0x340 [ 45.039022] __asan_report_store8_noabort+0x17/0x20 [ 45.039689] detach_if_pending+0x557/0x610 [ 45.040258] ? trace_raw_output_tick_stop+0x130/0x130 [ 45.040949] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 45.041568] ? lock_timer_base+0x1a3/0x2b0 [ 45.042167] ? lock_timer_base+0x1eb/0x2b0 [ 45.042780] ? __internal_add_timer+0x2d0/0x2d0 [ 45.043401] ? lock_downgrade+0x990/0x990 [ 45.043954] ? trace_hardirqs_on+0xd/0x10 [ 45.044517] try_to_del_timer_sync+0xa2/0x120 [ 45.045129] ? del_timer+0x130/0x130 [ 45.045650] ? del_timer_sync+0xeb/0x240 [ 45.046201] del_timer_sync+0x18a/0x240 [ 45.046736] tun_free_netdev+0x105/0x1b0 [ 45.047282] ? tun_xdp+0x410/0x410 [ 45.047757] ? cpumask_next+0x24/0x30 [ 45.048271] ? netdev_refcnt_read+0xed/0x150 [ 45.051018] ? tun_xdp+0x410/0x410 [ 45.054529] netdev_run_todo+0x870/0xca0 [ 45.058556] ? do_group_exit+0x149/0x400 [ 45.062586] ? mark_held_locks+0xaf/0x100 [ 45.066702] ? register_netdev+0x30/0x30 [ 45.070734] ? find_held_lock+0x35/0x1d0 [ 45.074771] ? lock_downgrade+0x990/0x990 [ 45.078890] ? refcount_sub_and_test+0x115/0x1b0 [ 45.083611] ? refcount_inc+0x50/0x50 [ 45.087376] ? refcount_inc+0x50/0x50 [ 45.091146] ? sk_destruct+0x4c/0x80 [ 45.094825] ? __sk_free+0x5c/0x230 [ 45.098419] ? sk_free+0x2f/0x40 [ 45.101750] ? __tun_detach+0x176/0x1390 [ 45.105789] ? tun_attach+0xfa0/0xfa0 [ 45.109560] ? lock_downgrade+0x990/0x990 [ 45.113675] ? locks_remove_file+0x3fa/0x5a0 [ 45.118054] ? fcntl_setlk+0x10c0/0x10c0 [ 45.122082] ? __fsnotify_parent+0xb4/0x3a0 [ 45.126371] ? fsnotify+0x1af0/0x1af0 [ 45.130146] ? __tun_detach+0x1390/0x1390 [ 45.134262] rtnl_unlock+0xe/0x10 [ 45.137682] tun_chr_close+0x49/0x60 [ 45.141362] __fput+0x327/0x7e0 [ 45.144612] ? fput+0x140/0x140 [ 45.147862] ? check_same_owner+0x320/0x320 [ 45.152150] ? _raw_spin_unlock_irq+0x27/0x70 [ 45.156628] ____fput+0x15/0x20 [ 45.159887] task_work_run+0x199/0x270 [ 45.163745] ? task_work_cancel+0x210/0x210 [ 45.168046] ? _raw_spin_unlock+0x22/0x30 [ 45.172162] ? switch_task_namespaces+0x87/0xc0 [ 45.176800] do_exit+0x9b5/0x1ad0 [ 45.180222] ? kvfree+0x3b/0x60 [ 45.183469] ? mm_update_next_owner+0x930/0x930 [ 45.188105] ? find_held_lock+0x35/0x1d0 [ 45.192140] ? handle_mm_fault+0x248/0x8d0 [ 45.196344] ? find_held_lock+0x35/0x1d0 [ 45.200382] ? __do_page_fault+0x64c/0xd60 [ 45.204586] ? lock_downgrade+0x990/0x990 [ 45.208708] ? handle_mm_fault+0x410/0x8d0 [ 45.212906] ? __do_page_fault+0x31e/0xd60 [ 45.217109] ? __handle_mm_fault+0x39c0/0x39c0 [ 45.221657] ? vmacache_find+0x5f/0x280 [ 45.225606] ? up_read+0x1a/0x40 [ 45.228950] ? __do_page_fault+0x3d6/0xd60 [ 45.233162] ? mm_fault_error+0x2c0/0x2c0 [ 45.237280] ? do_vfs_ioctl+0x486/0x1520 [ 45.241313] ? do_page_fault+0xee/0x720 [ 45.245255] ? __do_page_fault+0xd60/0xd60 [ 45.249458] ? putname+0xf3/0x130 [ 45.252882] do_group_exit+0x149/0x400 [ 45.256737] ? SyS_exit+0x30/0x30 [ 45.260157] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 45.265139] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 45.269862] SyS_exit_group+0x1d/0x20 [ 45.273631] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 45.278352] RIP: 0033:0x443cc8 [ 45.281509] RSP: 002b:00007fff9302b488 EFLAGS: 00000246 ORIG_RAX: 00000000000000e7 [ 45.289183] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 0000000000443cc8 [ 45.296419] RDX: 0000000000000000 RSI: 000000000000003c RDI: 0000000000000000 [ 45.303657] RBP: 0000000000000082 R08: 00000000000000e7 R09: ffffffffffffffd4 [ 45.310901] R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000001 [ 45.318139] R13: 00000000006d6180 R14: 0000000000000000 R15: 0000000000000000 [ 45.325390] [ 45.326984] Allocated by task 2975: [ 45.330579] save_stack_trace+0x16/0x20 [ 45.334520] save_stack+0x43/0xd0 [ 45.337936] kasan_kmalloc+0xad/0xe0 [ 45.341611] __kmalloc_node+0x47/0x70 [ 45.345379] kvmalloc_node+0x64/0xd0 [ 45.349060] alloc_netdev_mqs+0x16e/0xed0 [ 45.353173] __tun_chr_ioctl+0x12b2/0x3d20 [ 45.357369] tun_chr_ioctl+0x2a/0x40 [ 45.361045] do_vfs_ioctl+0x1b1/0x1520 [ 45.364895] SyS_ioctl+0x8f/0xc0 [ 45.368228] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 45.372944] [ 45.374535] Freed by task 2975: [ 45.377780] save_stack_trace+0x16/0x20 [ 45.381719] save_stack+0x43/0xd0 [ 45.385138] kasan_slab_free+0x71/0xc0 [ 45.388989] kfree+0xca/0x250 [ 45.392059] kvfree+0x36/0x60 [ 45.395128] free_netdev+0x2cf/0x360 [ 45.398805] __tun_chr_ioctl+0x2cea/0x3d20 [ 45.403003] tun_chr_ioctl+0x2a/0x40 [ 45.406681] do_vfs_ioctl+0x1b1/0x1520 [ 45.410534] SyS_ioctl+0x8f/0xc0 [ 45.413866] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 45.418591] [ 45.420190] The buggy address belongs to the object at ffff8801d2080380 [ 45.420190] which belongs to the cache kmalloc-16384 of size 16384 [ 45.433164] The buggy address is located 13112 bytes inside of [ 45.433164] 16384-byte region [ffff8801d2080380, ffff8801d2084380) [ 45.445350] The buggy address belongs to the page: [ 45.450243] page:ffffea0007482000 count:1 mapcount:0 mapping:ffff8801d2080380 index:0x0 compound_mapcount: 0 [ 45.460175] flags: 0x200000000008100(slab|head) [ 45.464810] raw: 0200000000008100 ffff8801d2080380 0000000000000000 0000000100000001 [ 45.472657] raw: ffffea00074b6620 ffff8801dac01c48 ffff8801dac02200 0000000000000000 [ 45.480500] page dumped because: kasan: bad access detected [ 45.486173] [ 45.487766] Memory state around the buggy address: [ 45.492661] ffff8801d2083580: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 45.499981] ffff8801d2083600: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 45.507305] >ffff8801d2083680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 45.514631] ^ [ 45.519782] ffff8801d2083700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 45.527105] ffff8801d2083780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 45.534424] ================================================================== [ 45.541745] Disabling lock debugging due to kernel taint [ 45.547157] Kernel panic - not syncing: panic_on_warn set ... [ 45.547157] [ 45.554484] CPU: 1 PID: 2975 Comm: syzkaller877576 Tainted: G B 4.14.0-rc5+ #134 [ 45.563108] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 45.572426] Call Trace: [ 45.574982] dump_stack+0x194/0x257 [ 45.578574] ? arch_local_irq_restore+0x53/0x53 [ 45.583208] ? kasan_end_report+0x32/0x50 [ 45.587320] ? lock_downgrade+0x990/0x990 [ 45.591436] ? detach_if_pending+0x510/0x610 [ 45.595813] panic+0x1e4/0x417 [ 45.598973] ? __warn+0x1d9/0x1d9 [ 45.602399] ? detach_if_pending+0x557/0x610 [ 45.606772] kasan_end_report+0x50/0x50 [ 45.610710] kasan_report+0x144/0x340 [ 45.614476] __asan_report_store8_noabort+0x17/0x20 [ 45.619455] detach_if_pending+0x557/0x610 [ 45.623653] ? trace_raw_output_tick_stop+0x130/0x130 [ 45.628809] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 45.633441] ? lock_timer_base+0x1a3/0x2b0 [ 45.637637] ? lock_timer_base+0x1eb/0x2b0 [ 45.641836] ? __internal_add_timer+0x2d0/0x2d0 [ 45.646468] ? lock_downgrade+0x990/0x990 [ 45.650579] ? trace_hardirqs_on+0xd/0x10 [ 45.654693] try_to_del_timer_sync+0xa2/0x120 [ 45.659154] ? del_timer+0x130/0x130 [ 45.662832] ? del_timer_sync+0xeb/0x240 [ 45.666859] del_timer_sync+0x18a/0x240 [ 45.670797] tun_free_netdev+0x105/0x1b0 [ 45.674821] ? tun_xdp+0x410/0x410 [ 45.678327] ? cpumask_next+0x24/0x30 [ 45.682091] ? netdev_refcnt_read+0xed/0x150 [ 45.686475] ? tun_xdp+0x410/0x410 [ 45.689980] netdev_run_todo+0x870/0xca0 [ 45.694010] ? do_group_exit+0x149/0x400 [ 45.698036] ? mark_held_locks+0xaf/0x100 [ 45.702149] ? register_netdev+0x30/0x30 [ 45.706177] ? find_held_lock+0x35/0x1d0 [ 45.710207] ? lock_downgrade+0x990/0x990 [ 45.714324] ? refcount_sub_and_test+0x115/0x1b0 [ 45.719045] ? refcount_inc+0x50/0x50 [ 45.722808] ? refcount_inc+0x50/0x50 [ 45.726574] ? sk_destruct+0x4c/0x80 [ 45.730252] ? __sk_free+0x5c/0x230 [ 45.733842] ? sk_free+0x2f/0x40 [ 45.737175] ? __tun_detach+0x176/0x1390 [ 45.741220] ? tun_attach+0xfa0/0xfa0 [ 45.744988] ? lock_downgrade+0x990/0x990 [ 45.749102] ? locks_remove_file+0x3fa/0x5a0 [ 45.753477] ? fcntl_setlk+0x10c0/0x10c0 [ 45.757503] ? __fsnotify_parent+0xb4/0x3a0 [ 45.761789] ? fsnotify+0x1af0/0x1af0 [ 45.765556] ? __tun_detach+0x1390/0x1390 [ 45.769668] rtnl_unlock+0xe/0x10 [ 45.773095] tun_chr_close+0x49/0x60 [ 45.776774] __fput+0x327/0x7e0 [ 45.780022] ? fput+0x140/0x140 [ 45.783267] ? check_same_owner+0x320/0x320 [ 45.787552] ? _raw_spin_unlock_irq+0x27/0x70 [ 45.792014] ____fput+0x15/0x20 [ 45.795268] task_work_run+0x199/0x270 [ 45.799123] ? task_work_cancel+0x210/0x210 [ 45.803408] ? _raw_spin_unlock+0x22/0x30 [ 45.807521] ? switch_task_namespaces+0x87/0xc0 [ 45.812155] do_exit+0x9b5/0x1ad0 [ 45.815575] ? kvfree+0x3b/0x60 [ 45.818823] ? mm_update_next_owner+0x930/0x930 [ 45.823455] ? find_held_lock+0x35/0x1d0 [ 45.827484] ? handle_mm_fault+0x248/0x8d0 [ 45.831686] ? find_held_lock+0x35/0x1d0 [ 45.835718] ? __do_page_fault+0x64c/0xd60 [ 45.839919] ? lock_downgrade+0x990/0x990 [ 45.844033] ? handle_mm_fault+0x410/0x8d0 [ 45.848329] ? __do_page_fault+0x31e/0xd60 [ 45.852543] ? __handle_mm_fault+0x39c0/0x39c0 [ 45.857097] ? vmacache_find+0x5f/0x280 [ 45.861048] ? up_read+0x1a/0x40 [ 45.864387] ? __do_page_fault+0x3d6/0xd60 [ 45.868600] ? mm_fault_error+0x2c0/0x2c0 [ 45.872714] ? do_vfs_ioctl+0x486/0x1520 [ 45.876743] ? do_page_fault+0xee/0x720 [ 45.880682] ? __do_page_fault+0xd60/0xd60 [ 45.884882] ? putname+0xf3/0x130 [ 45.888303] do_group_exit+0x149/0x400 [ 45.892156] ? SyS_exit+0x30/0x30 [ 45.895581] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 45.900565] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 45.905288] SyS_exit_group+0x1d/0x20 [ 45.909057] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 45.913774] RIP: 0033:0x443cc8 [ 45.916928] RSP: 002b:00007fff9302b488 EFLAGS: 00000246 ORIG_RAX: 00000000000000e7 [ 45.924599] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 0000000000443cc8 [ 45.931834] RDX: 0000000000000000 RSI: 000000000000003c RDI: 0000000000000000 [ 45.939074] RBP: 0000000000000082 R08: 00000000000000e7 R09: ffffffffffffffd4 [ 45.946307] R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000001 [ 45.953540] R13: 00000000006d6180 R14: 0000000000000000 R15: 0000000000000000