net.ipv6.conf.syz0.accept_dad = 0 net.ipv6.conf.syz0.router_solicitations = 0 executing program syzkaller login: [ 26.123632] ================================================================== [ 26.125163] BUG: KASAN: use-after-free in detach_if_pending+0x557/0x610 [ 26.126448] Write of size 8 at addr ffff88003c933700 by task syzkaller253574/2991 [ 26.127867] [ 26.128192] CPU: 1 PID: 2991 Comm: syzkaller253574 Not tainted 4.13.0-next-20170905+ #15 [ 26.129719] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS Bochs 01/01/2011 [ 26.131268] Call Trace: [ 26.159049] dump_stack+0x194/0x257 [ 26.159416] ? arch_local_irq_restore+0x53/0x53 [ 26.160941] ? show_regs_print_info+0x65/0x65 [ 26.161947] ? lock_timer_base+0x1a3/0x2b0 [ 26.163645] ? detach_if_pending+0x557/0x610 [ 26.165305] print_address_description+0x73/0x250 [ 26.166711] ? detach_if_pending+0x557/0x610 [ 26.168622] kasan_report+0x24e/0x340 [ 26.169403] __asan_report_store8_noabort+0x17/0x20 [ 26.170462] detach_if_pending+0x557/0x610 [ 26.170872] ? trace_raw_output_tick_stop+0x130/0x130 [ 26.172446] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 26.172887] ? lock_timer_base+0x1a3/0x2b0 [ 26.174400] ? lock_timer_base+0x1eb/0x2b0 [ 26.175561] ? __internal_add_timer+0x2d0/0x2d0 [ 26.177931] ? trace_hardirqs_on+0xd/0x10 [ 26.180139] try_to_del_timer_sync+0xa2/0x120 [ 26.182878] ? del_timer+0x130/0x130 [ 26.183340] ? del_timer_sync+0xeb/0x240 [ 26.183839] del_timer_sync+0x18a/0x240 [ 26.184303] tun_free_netdev+0x105/0x1b0 [ 26.184779] ? tun_xdp+0x410/0x410 [ 26.185187] ? cpumask_next+0x24/0x30 [ 26.185605] ? netdev_refcnt_read+0xed/0x150 [ 26.186062] ? tun_xdp+0x410/0x410 [ 26.186445] netdev_run_todo+0x870/0xca0 [ 26.187083] ? do_group_exit+0x149/0x400 [ 26.187522] ? register_netdev+0x30/0x30 [ 26.187963] ? lock_downgrade+0x990/0x990 [ 26.188428] ? trace_hardirqs_on+0xd/0x10 [ 26.188914] ? refcount_sub_and_test+0x115/0x1b0 [ 26.191908] ? refcount_inc+0x50/0x50 [ 26.192324] ? refcount_inc+0x50/0x50 [ 26.192733] ? sk_destruct+0x4c/0x80 [ 26.193255] ? __sk_free+0x5c/0x230 [ 26.193677] ? sk_free+0x2f/0x40 [ 26.194240] ? __tun_detach+0x176/0x1390 [ 26.195417] ? tun_attach+0xf90/0xf90 [ 26.197223] ? do_raw_spin_trylock+0x190/0x190 [ 26.198162] ? locks_remove_file+0x3fa/0x5a0 [ 26.199798] ? fcntl_setlk+0x10d0/0x10d0 [ 26.200567] ? __fsnotify_parent+0xb4/0x3a0 [ 26.201434] ? fsnotify+0x1af0/0x1af0 [ 26.202187] ? __tun_detach+0x1390/0x1390 [ 26.203015] ? __tun_detach+0x1390/0x1390 [ 26.203839] rtnl_unlock+0xe/0x10 [ 26.204490] tun_chr_close+0x49/0x60 [ 26.206230] __fput+0x333/0x7f0 [ 26.206910] ? fput+0x140/0x140 [ 26.207532] ? check_same_owner+0x320/0x320 [ 26.208393] ? _raw_spin_unlock_irq+0x27/0x70 [ 26.209303] ____fput+0x15/0x20 [ 26.209967] task_work_run+0x199/0x270 [ 26.210778] ? task_work_cancel+0x210/0x210 [ 26.211590] ? _raw_spin_unlock+0x22/0x30 [ 26.212418] ? switch_task_namespaces+0x87/0xc0 [ 26.213352] do_exit+0xa52/0x1b40 [ 26.214048] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 26.215031] ? check_noncircular+0x20/0x20 [ 26.215884] ? __handle_mm_fault+0x587/0x39c0 [ 26.216784] ? mm_update_next_owner+0x930/0x930 [ 26.217415] ? __pmd_alloc+0x4e0/0x4e0 [ 26.218523] ? find_held_lock+0x39/0x1d0 [ 26.219465] ? lock_downgrade+0x990/0x990 [ 26.220841] ? handle_mm_fault+0x4a2/0x860 [ 26.221412] ? down_read_trylock+0xdb/0x170 [ 26.221909] ? __handle_mm_fault+0x39c0/0x39c0 [ 26.222501] ? vmacache_find+0x61/0x270 [ 26.223059] ? up_read+0x1a/0x40 [ 26.223702] ? __do_page_fault+0x35b/0xb60 [ 26.224932] ? do_page_fault+0xee/0x720 [ 26.226099] ? __do_page_fault+0xb60/0xb60 [ 26.226741] ? putname+0xf3/0x130 [ 26.227140] do_group_exit+0x149/0x400 [ 26.227571] ? lockdep_sys_exit+0x47/0xf0 [ 26.228324] ? SyS_exit+0x30/0x30 [ 26.228985] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 26.229938] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 26.230519] SyS_exit_group+0x1d/0x20 [ 26.230974] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 26.231893] RIP: 0033:0x438cc9 [ 26.232490] RSP: 002b:00007ffc08a79628 EFLAGS: 00000246 ORIG_RAX: 00000000000000e7 [ 26.233998] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 0000000000438cc9 [ 26.235381] RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000 [ 26.236772] RBP: 0000000000000082 R08: 000000000000003c R09: 00000000000000e7 [ 26.238721] R10: ffffffffffffffcc R11: 0000000000000246 R12: 0000000000000001 [ 26.240076] R13: 00000000006cc300 R14: 00000000004027c0 R15: 0000000000000000 [ 26.241720] [ 26.242079] Allocated by task 2991: [ 26.242726] save_stack_trace+0x16/0x20 [ 26.243463] save_stack+0x43/0xd0 [ 26.244120] kasan_kmalloc+0xad/0xe0 [ 26.244879] __kmalloc_node+0x47/0x70 [ 26.245610] kvmalloc_node+0x64/0xd0 [ 26.246329] alloc_netdev_mqs+0x16e/0xed0 [ 26.247738] __tun_chr_ioctl+0x12be/0x3d20 [ 26.248276] tun_chr_ioctl+0x2a/0x40 [ 26.248708] do_vfs_ioctl+0x1b1/0x1530 [ 26.249153] SyS_ioctl+0x8f/0xc0 [ 26.249534] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 26.250061] [ 26.250251] Freed by task 2991: [ 26.250629] save_stack_trace+0x16/0x20 [ 26.251398] save_stack+0x43/0xd0 [ 26.251804] kasan_slab_free+0x71/0xc0 [ 26.252549] kfree+0xca/0x250 [ 26.253165] kvfree+0x36/0x60 [ 26.253634] free_netdev+0x2cf/0x360 [ 26.254143] __tun_chr_ioctl+0x2cf6/0x3d20 [ 26.254646] tun_chr_ioctl+0x2a/0x40 [ 26.255070] do_vfs_ioctl+0x1b1/0x1530 [ 26.255535] SyS_ioctl+0x8f/0xc0 [ 26.255986] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 26.256651] [ 26.256861] The buggy address belongs to the object at ffff88003c930300 [ 26.256861] which belongs to the cache kmalloc-16384 of size 16384 [ 26.258608] The buggy address is located 13312 bytes inside of [ 26.258608] 16384-byte region [ffff88003c930300, ffff88003c934300) [ 26.260913] The buggy address belongs to the page: [ 26.261839] page:ffffea0000f24c00 count:1 mapcount:0 mapping:ffff88003c930300 index:0x0 compound_mapcount: 0 [ 26.264025] flags: 0x100000000008100(slab|head) [ 26.264923] raw: 0100000000008100 ffff88003c930300 0000000000000000 0000000100000001 [ 26.266430] raw: ffffea0000ef5e20 ffff88003e801c50 ffff88003e802200 0000000000000000 [ 26.267942] page dumped because: kasan: bad access detected [ 26.269050] [ 26.269370] Memory state around the buggy address: [ 26.270318] ffff88003c933600: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 26.271758] ffff88003c933680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 26.284746] >ffff88003c933700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 26.293890] ^ [ 26.294199] ffff88003c933780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 26.294908] ffff88003c933800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 26.295632] ================================================================== [ 26.296320] Disabling lock debugging due to kernel taint [ 26.296837] Kernel panic - not syncing: panic_on_warn set ... [ 26.296837] [ 26.297680] CPU: 1 PID: 2991 Comm: syzkaller253574 Tainted: G B 4.13.0-next-20170905+ #15 [ 26.298733] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS Bochs 01/01/2011 [ 26.299657] Call Trace: [ 26.299947] dump_stack+0x194/0x257 [ 26.300341] ? arch_local_irq_restore+0x53/0x53 [ 26.300845] ? vprintk_default+0x28/0x30 [ 26.301278] ? detach_if_pending+0x530/0x610 [ 26.301750] panic+0x1e4/0x417 [ 26.302099] ? __warn+0x1d9/0x1d9 [ 26.302504] ? detach_if_pending+0x557/0x610 [ 26.303169] kasan_end_report+0x50/0x50 [ 26.303945] kasan_report+0x137/0x340 [ 26.304665] __asan_report_store8_noabort+0x17/0x20 [ 26.305582] detach_if_pending+0x557/0x610 [ 26.306733] ? trace_raw_output_tick_stop+0x130/0x130 [ 26.307705] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 26.308631] ? lock_timer_base+0x1a3/0x2b0 [ 26.309494] ? lock_timer_base+0x1eb/0x2b0 [ 26.310327] ? __internal_add_timer+0x2d0/0x2d0 [ 26.311232] ? trace_hardirqs_on+0xd/0x10 [ 26.312040] try_to_del_timer_sync+0xa2/0x120 [ 26.312797] ? del_timer+0x130/0x130 [ 26.313788] ? del_timer_sync+0xeb/0x240 [ 26.314545] del_timer_sync+0x18a/0x240 [ 26.315304] tun_free_netdev+0x105/0x1b0 [ 26.316078] ? tun_xdp+0x410/0x410 [ 26.316749] ? cpumask_next+0x24/0x30 [ 26.317476] ? netdev_refcnt_read+0xed/0x150 [ 26.318322] ? tun_xdp+0x410/0x410 [ 26.318980] netdev_run_todo+0x870/0xca0 [ 26.319736] ? do_group_exit+0x149/0x400 [ 26.320502] ? register_netdev+0x30/0x30 [ 26.321287] ? lock_downgrade+0x990/0x990 [ 26.322050] ? trace_hardirqs_on+0xd/0x10 [ 26.322822] ? refcount_sub_and_test+0x115/0x1b0 [ 26.323706] ? refcount_inc+0x50/0x50 [ 26.324413] ? refcount_inc+0x50/0x50 [ 26.325317] ? sk_destruct+0x4c/0x80 [ 26.325710] ? __sk_free+0x5c/0x230 [ 26.326063] ? sk_free+0x2f/0x40 [ 26.326387] ? __tun_detach+0x176/0x1390 [ 26.326751] ? tun_attach+0xf90/0xf90 [ 26.327812] ? do_raw_spin_trylock+0x190/0x190 [ 26.328235] ? locks_remove_file+0x3fa/0x5a0 [ 26.328693] ? fcntl_setlk+0x10d0/0x10d0 [ 26.329295] ? __fsnotify_parent+0xb4/0x3a0 [ 26.329724] ? fsnotify+0x1af0/0x1af0 [ 26.330109] ? __tun_detach+0x1390/0x1390 [ 26.330901] ? __tun_detach+0x1390/0x1390 [ 26.331902] rtnl_unlock+0xe/0x10 [ 26.332556] tun_chr_close+0x49/0x60 [ 26.333310] __fput+0x333/0x7f0 [ 26.333953] ? fput+0x140/0x140 [ 26.334568] ? check_same_owner+0x320/0x320 [ 26.335411] ? _raw_spin_unlock_irq+0x27/0x70 [ 26.336243] ____fput+0x15/0x20 [ 26.336853] task_work_run+0x199/0x270 [ 26.337575] ? task_work_cancel+0x210/0x210 [ 26.338393] ? _raw_spin_unlock+0x22/0x30 [ 26.339159] ? switch_task_namespaces+0x87/0xc0 [ 26.340039] do_exit+0xa52/0x1b40 [ 26.340685] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 26.342006] ? check_noncircular+0x20/0x20 [ 26.342810] ? __handle_mm_fault+0x587/0x39c0 [ 26.343516] ? mm_update_next_owner+0x930/0x930 [ 26.344181] ? __pmd_alloc+0x4e0/0x4e0 [ 26.344744] ? find_held_lock+0x39/0x1d0 [ 26.345354] ? lock_downgrade+0x990/0x990 [ 26.345973] ? handle_mm_fault+0x4a2/0x860 [ 26.346627] ? down_read_trylock+0xdb/0x170 [ 26.347262] ? __handle_mm_fault+0x39c0/0x39c0 [ 26.347903] ? vmacache_find+0x61/0x270 [ 26.348752] ? up_read+0x1a/0x40 [ 26.349247] ? __do_page_fault+0x35b/0xb60 [ 26.349933] ? do_page_fault+0xee/0x720 [ 26.350499] ? __do_page_fault+0xb60/0xb60 [ 26.351134] ? putname+0xf3/0x130 [ 26.351629] do_group_exit+0x149/0x400 [ 26.352192] ? lockdep_sys_exit+0x47/0xf0 [ 26.352778] ? SyS_exit+0x30/0x30 [ 26.353278] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 26.354019] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 26.354728] SyS_exit_group+0x1d/0x20 [ 26.355272] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 26.355959] RIP: 0033:0x438cc9 [ 26.356417] RSP: 002b:00007ffc08a79628 EFLAGS: 00000246 ORIG_RAX: 00000000000000e7 [ 26.357845] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 0000000000438cc9 [ 26.359546] RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000 [ 26.360723] RBP: 0000000000000082 R08: 000000000000003c R09: 00000000000000e7 [ 26.361834] R10: ffffffffffffffcc R11: 0000000000000246 R12: 0000000000000001 [ 26.362897] R13: 00000000006cc300 R14: 00000000004027c0 R15: 0000000000000000 [ 26.364077] Dumping ftrace buffer: [ 26.364597] (ftrace buffer empty) [ 26.365134] Kernel Offset: disabled [ 26.365669] Rebooting in 86400 seconds..