net.ipv6.conf.syz0.accept_dad = 0 net.ipv6.conf.syz0.router_solicitations = 0 executing program syzkaller login: [ 18.312322] ================================================================== [ 18.313100] BUG: KASAN: use-after-free in detach_if_pending+0x557/0x610 [ 18.313778] Write of size 8 at addr ffff880068efb700 by task syzkaller376605/2994 [ 18.314541] [ 18.314735] CPU: 2 PID: 2994 Comm: syzkaller376605 Not tainted 4.13.0-next-20170908+ #18 [ 18.315559] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS Bochs 01/01/2011 [ 18.316401] Call Trace: [ 18.316665] dump_stack+0x194/0x257 [ 18.317020] ? arch_local_irq_restore+0x53/0x53 [ 18.317506] ? show_regs_print_info+0x65/0x65 [ 18.317949] ? lock_timer_base+0x1a3/0x2b0 [ 18.318370] ? detach_if_pending+0x557/0x610 [ 18.318777] print_address_description+0x73/0x250 [ 18.319298] ? detach_if_pending+0x557/0x610 [ 18.319699] kasan_report+0x24e/0x340 [ 18.320089] __asan_report_store8_noabort+0x17/0x20 [ 18.320547] detach_if_pending+0x557/0x610 [ 18.320849] ? trace_raw_output_tick_stop+0x130/0x130 [ 18.321227] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 18.321563] ? lock_timer_base+0x1a3/0x2b0 [ 18.321857] ? lock_timer_base+0x1eb/0x2b0 [ 18.322199] ? __internal_add_timer+0x2d0/0x2d0 [ 18.322550] ? trace_hardirqs_on+0xd/0x10 [ 18.322842] try_to_del_timer_sync+0xa2/0x120 [ 18.323199] ? del_timer+0x130/0x130 [ 18.323478] ? del_timer_sync+0xeb/0x240 [ 18.323782] del_timer_sync+0x18a/0x240 [ 18.324090] tun_free_netdev+0x105/0x1b0 [ 18.324385] ? tun_xdp+0x410/0x410 [ 18.324660] ? cpumask_next+0x24/0x30 [ 18.324926] ? netdev_refcnt_read+0xed/0x150 [ 18.325263] ? tun_xdp+0x410/0x410 [ 18.325523] netdev_run_todo+0x870/0xca0 [ 18.325837] ? do_group_exit+0x149/0x400 [ 18.326507] ? register_netdev+0x30/0x30 [ 18.326849] ? lock_downgrade+0x990/0x990 [ 18.327183] ? trace_hardirqs_on+0xd/0x10 [ 18.327517] ? refcount_sub_and_test+0x115/0x1b0 [ 18.327870] ? refcount_inc+0x50/0x50 [ 18.328199] ? refcount_inc+0x50/0x50 [ 18.328504] ? sk_destruct+0x4c/0x80 [ 18.328774] ? __sk_free+0x5c/0x230 [ 18.329118] ? sk_free+0x2f/0x40 [ 18.329363] ? __tun_detach+0x176/0x1390 [ 18.329700] ? tun_attach+0xf90/0xf90 [ 18.330006] ? do_raw_spin_trylock+0x190/0x190 [ 18.330357] ? locks_remove_file+0x3fa/0x5a0 [ 18.330733] ? fcntl_setlk+0x10d0/0x10d0 [ 18.331079] ? __fsnotify_parent+0xb4/0x3a0 [ 18.331403] ? fsnotify+0x1af0/0x1af0 [ 18.331728] ? __tun_detach+0x1390/0x1390 [ 18.332080] ? __tun_detach+0x1390/0x1390 [ 18.332376] rtnl_unlock+0xe/0x10 [ 18.332645] tun_chr_close+0x49/0x60 [ 18.332929] __fput+0x333/0x7f0 [ 18.333233] ? fput+0x140/0x140 [ 18.333488] ? check_same_owner+0x320/0x320 [ 18.333863] ? _raw_spin_unlock_irq+0x27/0x70 [ 18.334209] ____fput+0x15/0x20 [ 18.334455] task_work_run+0x199/0x270 [ 18.334745] ? task_work_cancel+0x210/0x210 [ 18.335113] ? _raw_spin_unlock+0x22/0x30 [ 18.335403] ? switch_task_namespaces+0x87/0xc0 [ 18.335745] do_exit+0xa52/0x1b40 [ 18.335989] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 18.336350] ? check_noncircular+0x20/0x20 [ 18.336676] ? __handle_mm_fault+0x587/0x39c0 [ 18.336993] ? mm_update_next_owner+0x930/0x930 [ 18.337383] ? __pmd_alloc+0x4e0/0x4e0 [ 18.337821] ? find_held_lock+0x39/0x1d0 [ 18.338182] ? lock_downgrade+0x990/0x990 [ 18.338501] ? handle_mm_fault+0x410/0x8d0 [ 18.338807] ? down_read_trylock+0xdb/0x170 [ 18.339119] ? __do_page_fault+0x2b8/0xb60 [ 18.339417] ? __handle_mm_fault+0x39c0/0x39c0 [ 18.339753] ? vmacache_find+0x61/0x270 [ 18.340046] ? up_read+0x1a/0x40 [ 18.340283] ? __do_page_fault+0x35b/0xb60 [ 18.340600] ? do_page_fault+0xee/0x720 [ 18.340881] ? __do_page_fault+0xb60/0xb60 [ 18.341189] ? putname+0xf3/0x130 [ 18.341437] do_group_exit+0x149/0x400 [ 18.341725] ? lockdep_sys_exit+0x47/0xf0 [ 18.342019] ? SyS_exit+0x30/0x30 [ 18.342283] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 18.342684] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 18.343042] SyS_exit_group+0x1d/0x20 [ 18.343351] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 18.343705] RIP: 0033:0x438d19 [ 18.343982] RSP: 002b:00007ffca81966f8 EFLAGS: 00000246 ORIG_RAX: 00000000000000e7 [ 18.344554] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 0000000000438d19 [ 18.345078] RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000 [ 18.345623] RBP: 0000000000000082 R08: 000000000000003c R09: 00000000000000e7 [ 18.346160] R10: ffffffffffffffcc R11: 0000000000000246 R12: 0000000000000001 [ 18.346972] R13: 00000000006cd300 R14: 0000000000402810 R15: 0000000000000000 [ 18.348091] [ 18.348221] Allocated by task 2994: [ 18.348470] save_stack_trace+0x16/0x20 [ 18.348741] save_stack+0x43/0xd0 [ 18.348977] kasan_kmalloc+0xad/0xe0 [ 18.349283] __kmalloc_node+0x47/0x70 [ 18.349549] kvmalloc_node+0x64/0xd0 [ 18.349802] alloc_netdev_mqs+0x16e/0xed0 [ 18.350142] __tun_chr_ioctl+0x12be/0x3d20 [ 18.350463] tun_chr_ioctl+0x2a/0x40 [ 18.350723] do_vfs_ioctl+0x1b1/0x1530 [ 18.350999] SyS_ioctl+0x8f/0xc0 [ 18.351282] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 18.351634] [ 18.351775] Freed by task 2994: [ 18.352050] save_stack_trace+0x16/0x20 [ 18.352334] save_stack+0x43/0xd0 [ 18.352595] kasan_slab_free+0x71/0xc0 [ 18.352885] kfree+0xca/0x250 [ 18.353149] kvfree+0x36/0x60 [ 18.353381] free_netdev+0x2cf/0x360 [ 18.353640] __tun_chr_ioctl+0x2cf6/0x3d20 [ 18.353941] tun_chr_ioctl+0x2a/0x40 [ 18.354232] do_vfs_ioctl+0x1b1/0x1530 [ 18.354523] SyS_ioctl+0x8f/0xc0 [ 18.354781] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 18.355194] [ 18.355338] The buggy address belongs to the object at ffff880068ef8300 [ 18.355338] which belongs to the cache kmalloc-16384 of size 16384 [ 18.356291] The buggy address is located 13312 bytes inside of [ 18.356291] 16384-byte region [ffff880068ef8300, ffff880068efc300) [ 18.357193] The buggy address belongs to the page: [ 18.357552] page:ffffea0001a3be00 count:1 mapcount:0 mapping:ffff880068ef8300 index:0x0 compound_mapcount: 0 [ 18.358285] flags: 0x500000000008100(slab|head) [ 18.358628] raw: 0500000000008100 ffff880068ef8300 0000000000000000 0000000100000001 [ 18.359467] raw: ffffea0001a06c20 ffff88006d800c50 ffff88003e802200 0000000000000000 [ 18.360369] page dumped because: kasan: bad access detected [ 18.361055] [ 18.361256] Memory state around the buggy address: [ 18.361697] ffff880068efb600: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 18.362288] ffff880068efb680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 18.362810] >ffff880068efb700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 18.363332] ^ [ 18.363604] ffff880068efb780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 18.364190] ffff880068efb800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 18.364782] ================================================================== [ 18.365327] Disabling lock debugging due to kernel taint [ 18.365712] Kernel panic - not syncing: panic_on_warn set ... [ 18.365712] [ 18.366242] CPU: 2 PID: 2994 Comm: syzkaller376605 Tainted: G B 4.13.0-next-20170908+ #18 [ 18.366994] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS Bochs 01/01/2011 [ 18.367697] Call Trace: [ 18.367918] dump_stack+0x194/0x257 [ 18.368207] ? arch_local_irq_restore+0x53/0x53 [ 18.369123] ? vprintk_default+0x28/0x30 [ 18.369457] ? detach_if_pending+0x4c0/0x610 [ 18.369823] panic+0x1e4/0x417 [ 18.370055] ? __warn+0x1d9/0x1d9 [ 18.370320] ? detach_if_pending+0x557/0x610 [ 18.370634] kasan_end_report+0x50/0x50 [ 18.370929] kasan_report+0x137/0x340 [ 18.371216] __asan_report_store8_noabort+0x17/0x20 [ 18.371636] detach_if_pending+0x557/0x610 [ 18.371962] ? trace_raw_output_tick_stop+0x130/0x130 [ 18.372351] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 18.372730] ? lock_timer_base+0x1a3/0x2b0 [ 18.373041] ? lock_timer_base+0x1eb/0x2b0 [ 18.373339] ? __internal_add_timer+0x2d0/0x2d0 [ 18.373651] ? trace_hardirqs_on+0xd/0x10 [ 18.373999] try_to_del_timer_sync+0xa2/0x120 [ 18.374359] ? del_timer+0x130/0x130 [ 18.374609] ? del_timer_sync+0xeb/0x240 [ 18.374939] del_timer_sync+0x18a/0x240 [ 18.375233] tun_free_netdev+0x105/0x1b0 [ 18.375507] ? tun_xdp+0x410/0x410 [ 18.375812] ? cpumask_next+0x24/0x30 [ 18.376109] ? netdev_refcnt_read+0xed/0x150 [ 18.376405] ? tun_xdp+0x410/0x410 [ 18.376643] netdev_run_todo+0x870/0xca0 [ 18.376989] ? do_group_exit+0x149/0x400 [ 18.377293] ? register_netdev+0x30/0x30 [ 18.377566] ? lock_downgrade+0x990/0x990 [ 18.377844] ? trace_hardirqs_on+0xd/0x10 [ 18.378157] ? refcount_sub_and_test+0x115/0x1b0 [ 18.378475] ? refcount_inc+0x50/0x50 [ 18.378731] ? refcount_inc+0x50/0x50 [ 18.379015] ? sk_destruct+0x4c/0x80 [ 18.379306] ? __sk_free+0x5c/0x230 [ 18.379585] ? sk_free+0x2f/0x40 [ 18.379839] ? __tun_detach+0x176/0x1390 [ 18.380161] ? tun_attach+0xf90/0xf90 [ 18.380446] ? do_raw_spin_trylock+0x190/0x190 [ 18.380783] ? locks_remove_file+0x3fa/0x5a0 [ 18.381140] ? fcntl_setlk+0x10d0/0x10d0 [ 18.381442] ? __fsnotify_parent+0xb4/0x3a0 [ 18.381761] ? fsnotify+0x1af0/0x1af0 [ 18.382102] ? __tun_detach+0x1390/0x1390 [ 18.382415] ? __tun_detach+0x1390/0x1390 [ 18.382768] rtnl_unlock+0xe/0x10 [ 18.383028] tun_chr_close+0x49/0x60 [ 18.383294] __fput+0x333/0x7f0 [ 18.383546] ? fput+0x140/0x140 [ 18.383825] ? check_same_owner+0x320/0x320 [ 18.384183] ? _raw_spin_unlock_irq+0x27/0x70 [ 18.384544] ____fput+0x15/0x20 [ 18.384784] task_work_run+0x199/0x270 [ 18.385107] ? task_work_cancel+0x210/0x210 [ 18.385409] ? _raw_spin_unlock+0x22/0x30 [ 18.385729] ? switch_task_namespaces+0x87/0xc0 [ 18.386110] do_exit+0xa52/0x1b40 [ 18.386368] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 18.386737] ? check_noncircular+0x20/0x20 [ 18.387078] ? __handle_mm_fault+0x587/0x39c0 [ 18.387408] ? mm_update_next_owner+0x930/0x930 [ 18.387771] ? __pmd_alloc+0x4e0/0x4e0 [ 18.388057] ? find_held_lock+0x39/0x1d0 [ 18.388395] ? lock_downgrade+0x990/0x990 [ 18.388694] ? handle_mm_fault+0x410/0x8d0 [ 18.389004] ? down_read_trylock+0xdb/0x170 [ 18.389335] ? __do_page_fault+0x2b8/0xb60 [ 18.389664] ? __handle_mm_fault+0x39c0/0x39c0 [ 18.390255] ? vmacache_find+0x61/0x270 [ 18.390553] ? up_read+0x1a/0x40 [ 18.390808] ? __do_page_fault+0x35b/0xb60 [ 18.391157] ? do_page_fault+0xee/0x720 [ 18.391466] ? __do_page_fault+0xb60/0xb60 [ 18.391800] ? putname+0xf3/0x130 [ 18.392149] do_group_exit+0x149/0x400 [ 18.392446] ? lockdep_sys_exit+0x47/0xf0 [ 18.392732] ? SyS_exit+0x30/0x30 [ 18.392971] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 18.393340] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 18.393688] SyS_exit_group+0x1d/0x20 [ 18.393972] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 18.394326] RIP: 0033:0x438d19 [ 18.394567] RSP: 002b:00007ffca81966f8 EFLAGS: 00000246 ORIG_RAX: 00000000000000e7 [ 18.395129] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 0000000000438d19 [ 18.395649] RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000 [ 18.396205] RBP: 0000000000000082 R08: 000000000000003c R09: 00000000000000e7 [ 18.396719] R10: ffffffffffffffcc R11: 0000000000000246 R12: 0000000000000001 [ 18.397253] R13: 00000000006cd300 R14: 0000000000402810 R15: 0000000000000000 [ 18.397931] Dumping ftrace buffer: [ 18.398177] (ftrace buffer empty) [ 18.398432] Kernel Offset: disabled [ 18.398685] Rebooting in 86400 seconds..