net.ipv6.conf.syz0.accept_dad = 0 net.ipv6.conf.syz0.router_solicitations = 0 executing program syzkaller login: [ 29.401350] ================================================================== [ 29.402246] BUG: KASAN: use-after-free in detach_if_pending+0x557/0x610 [ 29.402937] Write of size 8 at addr ffff88003cdf3840 by task syzkaller857226/2974 [ 29.403869] [ 29.404131] CPU: 1 PID: 2974 Comm: syzkaller857226 Not tainted 4.13.0-next-20170905+ #15 [ 29.405461] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS Bochs 01/01/2011 [ 29.406652] Call Trace: [ 29.406940] dump_stack+0x194/0x257 [ 29.407308] ? arch_local_irq_restore+0x53/0x53 [ 29.407723] ? show_regs_print_info+0x65/0x65 [ 29.408141] ? lock_timer_base+0x1a3/0x2b0 [ 29.408525] ? detach_if_pending+0x557/0x610 [ 29.408918] print_address_description+0x73/0x250 [ 29.413065] ? detach_if_pending+0x557/0x610 [ 29.413504] kasan_report+0x24e/0x340 [ 29.413968] __asan_report_store8_noabort+0x17/0x20 [ 29.414486] detach_if_pending+0x557/0x610 [ 29.414932] ? trace_raw_output_tick_stop+0x130/0x130 [ 29.415469] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 29.415941] ? lock_timer_base+0x1a3/0x2b0 [ 29.416381] ? lock_timer_base+0x1eb/0x2b0 [ 29.416818] ? __internal_add_timer+0x2d0/0x2d0 [ 29.417306] ? trace_hardirqs_on+0xd/0x10 [ 29.417783] try_to_del_timer_sync+0xa2/0x120 [ 29.424391] ? del_timer+0x130/0x130 [ 29.424798] ? del_timer_sync+0xeb/0x240 [ 29.425243] del_timer_sync+0x18a/0x240 [ 29.425739] tun_free_netdev+0x105/0x1b0 [ 29.426170] ? tun_xdp+0x410/0x410 [ 29.426614] ? cpumask_next+0x24/0x30 [ 29.427044] ? netdev_refcnt_read+0xed/0x150 [ 29.427511] ? tun_xdp+0x410/0x410 [ 29.427895] netdev_run_todo+0x870/0xca0 [ 29.428326] ? do_group_exit+0x149/0x400 [ 29.428761] ? register_netdev+0x30/0x30 [ 29.430049] ? lock_downgrade+0x990/0x990 [ 29.430544] ? trace_hardirqs_on+0xd/0x10 [ 29.431030] ? refcount_sub_and_test+0x115/0x1b0 [ 29.431581] ? refcount_inc+0x50/0x50 [ 29.432094] ? refcount_inc+0x50/0x50 [ 29.432550] ? sk_destruct+0x4c/0x80 [ 29.433036] ? __sk_free+0x5c/0x230 [ 29.433426] ? sk_free+0x2f/0x40 [ 29.433782] ? __tun_detach+0x176/0x1390 [ 29.434223] ? tun_attach+0xf90/0xf90 [ 29.434636] ? do_raw_spin_trylock+0x190/0x190 [ 29.435226] ? locks_remove_file+0x3fa/0x5a0 [ 29.435707] ? fcntl_setlk+0x10d0/0x10d0 [ 29.436176] ? __fsnotify_parent+0xb4/0x3a0 [ 29.436619] ? fsnotify+0x1af0/0x1af0 [ 29.437142] ? __tun_detach+0x1390/0x1390 [ 29.437577] ? __tun_detach+0x1390/0x1390 [ 29.438027] rtnl_unlock+0xe/0x10 [ 29.438390] tun_chr_close+0x49/0x60 [ 29.438777] __fput+0x333/0x7f0 [ 29.439160] ? fput+0x140/0x140 [ 29.439525] ? check_same_owner+0x320/0x320 [ 29.439980] ? _raw_spin_unlock_irq+0x27/0x70 [ 29.440463] ____fput+0x15/0x20 [ 29.440814] task_work_run+0x199/0x270 [ 29.441229] ? task_work_cancel+0x210/0x210 [ 29.441823] ? _raw_spin_unlock+0x22/0x30 [ 29.442293] ? switch_task_namespaces+0x87/0xc0 [ 29.442819] do_exit+0xa52/0x1b40 [ 29.443184] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 29.443713] ? check_noncircular+0x20/0x20 [ 29.444165] ? __handle_mm_fault+0x587/0x39c0 [ 29.444647] ? mm_update_next_owner+0x930/0x930 [ 29.445224] ? __pmd_alloc+0x4e0/0x4e0 [ 29.445688] ? find_held_lock+0x39/0x1d0 [ 29.446135] ? lock_downgrade+0x990/0x990 [ 29.446616] ? handle_mm_fault+0x4a2/0x860 [ 29.447114] ? down_read_trylock+0xdb/0x170 [ 29.447599] ? __handle_mm_fault+0x39c0/0x39c0 [ 29.448135] ? vmacache_find+0x61/0x270 [ 29.448584] ? up_read+0x1a/0x40 [ 29.449047] ? __do_page_fault+0x35b/0xb60 [ 29.449590] ? do_page_fault+0xee/0x720 [ 29.450831] ? __do_page_fault+0xb60/0xb60 [ 29.451307] ? putname+0xf3/0x130 [ 29.451708] do_group_exit+0x149/0x400 [ 29.452146] ? lockdep_sys_exit+0x47/0xf0 [ 29.452585] ? SyS_exit+0x30/0x30 [ 29.452957] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 29.453550] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 29.454056] SyS_exit_group+0x1d/0x20 [ 29.454456] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 29.454936] RIP: 0033:0x438d09 [ 29.455264] RSP: 002b:00007ffd3582c668 EFLAGS: 00000246 ORIG_RAX: 00000000000000e7 [ 29.456047] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 0000000000438d09 [ 29.456804] RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000 [ 29.457564] RBP: 0000000000000082 R08: 000000000000003c R09: 00000000000000e7 [ 29.458366] R10: ffffffffffffffcc R11: 0000000000000246 R12: 0000000000000001 [ 29.459144] R13: 00000000006cc300 R14: 0000000000402800 R15: 0000000000000000 [ 29.459967] [ 29.460148] Allocated by task 2974: [ 29.460538] save_stack_trace+0x16/0x20 [ 29.460957] save_stack+0x43/0xd0 [ 29.461329] kasan_kmalloc+0xad/0xe0 [ 29.461721] __kmalloc_node+0x47/0x70 [ 29.462123] kvmalloc_node+0x64/0xd0 [ 29.462514] alloc_netdev_mqs+0x16e/0xed0 [ 29.462994] __tun_chr_ioctl+0x12be/0x3d20 [ 29.463435] tun_chr_ioctl+0x2a/0x40 [ 29.463853] do_vfs_ioctl+0x1b1/0x1530 [ 29.464259] SyS_ioctl+0x8f/0xc0 [ 29.464613] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 29.464995] [ 29.465138] Freed by task 2974: [ 29.465417] save_stack_trace+0x16/0x20 [ 29.465769] save_stack+0x43/0xd0 [ 29.466115] kasan_slab_free+0x71/0xc0 [ 29.466485] kfree+0xca/0x250 [ 29.466702] kvfree+0x36/0x60 [ 29.466911] free_netdev+0x2cf/0x360 [ 29.467243] __tun_chr_ioctl+0x2cf6/0x3d20 [ 29.467637] tun_chr_ioctl+0x2a/0x40 [ 29.467981] do_vfs_ioctl+0x1b1/0x1530 [ 29.468271] SyS_ioctl+0x8f/0xc0 [ 29.468516] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 29.468848] [ 29.468969] The buggy address belongs to the object at ffff88003cdf0440 [ 29.468969] which belongs to the cache kmalloc-16384 of size 16384 [ 29.469875] The buggy address is located 13312 bytes inside of [ 29.469875] 16384-byte region [ffff88003cdf0440, ffff88003cdf4440) [ 29.470993] The buggy address belongs to the page: [ 29.471446] page:ffffea0000f37c00 count:1 mapcount:0 mapping:ffff88003cdf0440 index:0x0 compound_mapcount: 0 [ 29.472772] flags: 0x100000000008100(slab|head) [ 29.473173] raw: 0100000000008100 ffff88003cdf0440 0000000000000000 0000000100000001 [ 29.473928] raw: ffffea0000f45820 ffff88003e801c50 ffff88003e802200 0000000000000000 [ 29.474655] page dumped because: kasan: bad access detected [ 29.475184] [ 29.475339] Memory state around the buggy address: [ 29.475790] ffff88003cdf3700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 29.476474] ffff88003cdf3780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 29.477004] >ffff88003cdf3800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 29.477695] ^ [ 29.478099] ffff88003cdf3880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 29.478678] ffff88003cdf3900: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 29.479332] ================================================================== [ 29.480005] Disabling lock debugging due to kernel taint [ 29.480480] Kernel panic - not syncing: panic_on_warn set ... [ 29.480480] [ 29.480984] CPU: 1 PID: 2974 Comm: syzkaller857226 Tainted: G B 4.13.0-next-20170905+ #15 [ 29.481861] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS Bochs 01/01/2011 [ 29.482615] Call Trace: [ 29.482861] dump_stack+0x194/0x257 [ 29.483199] ? arch_local_irq_restore+0x53/0x53 [ 29.483630] ? vprintk_default+0x28/0x30 [ 29.483922] ? detach_if_pending+0x530/0x610 [ 29.484328] panic+0x1e4/0x417 [ 29.484626] ? __warn+0x1d9/0x1d9 [ 29.484881] ? detach_if_pending+0x557/0x610 [ 29.485192] kasan_end_report+0x50/0x50 [ 29.485565] kasan_report+0x137/0x340 [ 29.485837] __asan_report_store8_noabort+0x17/0x20 [ 29.486173] detach_if_pending+0x557/0x610 [ 29.486564] ? trace_raw_output_tick_stop+0x130/0x130 [ 29.486924] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 29.487239] ? lock_timer_base+0x1a3/0x2b0 [ 29.487536] ? lock_timer_base+0x1eb/0x2b0 [ 29.487834] ? __internal_add_timer+0x2d0/0x2d0 [ 29.488164] ? trace_hardirqs_on+0xd/0x10 [ 29.488455] try_to_del_timer_sync+0xa2/0x120 [ 29.488775] ? del_timer+0x130/0x130 [ 29.489034] ? del_timer_sync+0xeb/0x240 [ 29.489320] del_timer_sync+0x18a/0x240 [ 29.489595] tun_free_netdev+0x105/0x1b0 [ 29.489883] ? tun_xdp+0x410/0x410 [ 29.490132] ? cpumask_next+0x24/0x30 [ 29.490397] ? netdev_refcnt_read+0xed/0x150 [ 29.490701] ? tun_xdp+0x410/0x410 [ 29.490952] netdev_run_todo+0x870/0xca0 [ 29.491229] ? do_group_exit+0x149/0x400 [ 29.497519] ? register_netdev+0x30/0x30 [ 29.497895] ? lock_downgrade+0x990/0x990 [ 29.498294] ? trace_hardirqs_on+0xd/0x10 [ 29.498718] ? refcount_sub_and_test+0x115/0x1b0 [ 29.499178] ? refcount_inc+0x50/0x50 [ 29.499542] ? refcount_inc+0x50/0x50 [ 29.499917] ? sk_destruct+0x4c/0x80 [ 29.500258] ? __sk_free+0x5c/0x230 [ 29.500612] ? sk_free+0x2f/0x40 [ 29.500941] ? __tun_detach+0x176/0x1390 [ 29.501350] ? tun_attach+0xf90/0xf90 [ 29.501707] ? do_raw_spin_trylock+0x190/0x190 [ 29.502141] ? locks_remove_file+0x3fa/0x5a0 [ 29.502569] ? fcntl_setlk+0x10d0/0x10d0 [ 29.502968] ? __fsnotify_parent+0xb4/0x3a0 [ 29.503376] ? fsnotify+0x1af0/0x1af0 [ 29.503729] ? __tun_detach+0x1390/0x1390 [ 29.504121] ? __tun_detach+0x1390/0x1390 [ 29.504513] rtnl_unlock+0xe/0x10 [ 29.504845] tun_chr_close+0x49/0x60 [ 29.505196] __fput+0x333/0x7f0 [ 29.505526] ? fput+0x140/0x140 [ 29.505862] ? check_same_owner+0x320/0x320 [ 29.506301] ? _raw_spin_unlock_irq+0x27/0x70 [ 29.506744] ____fput+0x15/0x20 [ 29.507058] task_work_run+0x199/0x270 [ 29.507444] ? task_work_cancel+0x210/0x210 [ 29.507876] ? _raw_spin_unlock+0x22/0x30 [ 29.508276] ? switch_task_namespaces+0x87/0xc0 [ 29.508722] do_exit+0xa52/0x1b40 [ 29.509057] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 29.509549] ? check_noncircular+0x20/0x20 [ 29.509966] ? __handle_mm_fault+0x587/0x39c0 [ 29.510399] ? mm_update_next_owner+0x930/0x930 [ 29.510853] ? __pmd_alloc+0x4e0/0x4e0 [ 29.511252] ? find_held_lock+0x39/0x1d0 [ 29.511657] ? lock_downgrade+0x990/0x990 [ 29.512064] ? handle_mm_fault+0x4a2/0x860 [ 29.512471] ? down_read_trylock+0xdb/0x170 [ 29.512892] ? __handle_mm_fault+0x39c0/0x39c0 [ 29.513346] ? vmacache_find+0x61/0x270 [ 29.513743] ? up_read+0x1a/0x40 [ 29.514071] ? __do_page_fault+0x35b/0xb60 [ 29.514746] ? do_page_fault+0xee/0x720 [ 29.515115] ? __do_page_fault+0xb60/0xb60 [ 29.515533] ? putname+0xf3/0x130 [ 29.515863] do_group_exit+0x149/0x400 [ 29.516239] ? lockdep_sys_exit+0x47/0xf0 [ 29.516645] ? SyS_exit+0x30/0x30 [ 29.517028] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 29.517599] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 29.518258] SyS_exit_group+0x1d/0x20 [ 29.518648] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 29.519189] RIP: 0033:0x438d09 [ 29.519556] RSP: 002b:00007ffd3582c668 EFLAGS: 00000246 ORIG_RAX: 00000000000000e7 [ 29.520327] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 0000000000438d09 [ 29.521029] RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000 [ 29.521730] RBP: 0000000000000082 R08: 000000000000003c R09: 00000000000000e7 [ 29.522430] R10: ffffffffffffffcc R11: 0000000000000246 R12: 0000000000000001 [ 29.523236] R13: 00000000006cc300 R14: 0000000000402800 R15: 0000000000000000 [ 29.524054] Dumping ftrace buffer: [ 29.524396] (ftrace buffer empty) [ 29.524767] Kernel Offset: disabled [ 29.525144] Rebooting in 86400 seconds..