net.ipv6.conf.syz0.accept_dad = 0 net.ipv6.conf.syz0.router_solicitations = 0 executing program syzkaller login: [ 23.683608] ================================================================== [ 23.685285] BUG: KASAN: use-after-free in detach_if_pending+0x557/0x610 [ 23.694281] Write of size 8 at addr ffff88003cd838c0 by task syzkaller137214/3000 [ 23.695951] [ 23.696316] CPU: 2 PID: 3000 Comm: syzkaller137214 Not tainted 4.13.0-next-20170905+ #15 [ 23.698026] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS Bochs 01/01/2011 [ 23.704378] Call Trace: [ 23.705581] dump_stack+0x194/0x257 [ 23.707247] ? arch_local_irq_restore+0x53/0x53 [ 23.708476] ? show_regs_print_info+0x65/0x65 [ 23.710386] ? lock_timer_base+0x1a3/0x2b0 [ 23.713548] ? detach_if_pending+0x557/0x610 [ 23.714039] print_address_description+0x73/0x250 [ 23.715003] ? detach_if_pending+0x557/0x610 [ 23.716643] kasan_report+0x24e/0x340 [ 23.717089] __asan_report_store8_noabort+0x17/0x20 [ 23.718715] detach_if_pending+0x557/0x610 [ 23.719214] ? trace_raw_output_tick_stop+0x130/0x130 [ 23.720856] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 23.721392] ? lock_timer_base+0x1a3/0x2b0 [ 23.722933] ? lock_timer_base+0x1eb/0x2b0 [ 23.723433] ? __internal_add_timer+0x2d0/0x2d0 [ 23.725046] ? trace_hardirqs_on+0xd/0x10 [ 23.726605] try_to_del_timer_sync+0xa2/0x120 [ 23.727122] ? del_timer+0x130/0x130 [ 23.727605] ? del_timer_sync+0xeb/0x240 [ 23.728068] del_timer_sync+0x18a/0x240 [ 23.730588] tun_free_netdev+0x105/0x1b0 [ 23.731056] ? tun_xdp+0x410/0x410 [ 23.731461] ? cpumask_next+0x24/0x30 [ 23.737009] ? netdev_refcnt_read+0xed/0x150 [ 23.737835] ? tun_xdp+0x410/0x410 [ 23.738425] netdev_run_todo+0x870/0xca0 [ 23.739029] ? do_group_exit+0x149/0x400 [ 23.739632] ? register_netdev+0x30/0x30 [ 23.740318] ? lock_downgrade+0x990/0x990 [ 23.740910] ? trace_hardirqs_on+0xd/0x10 [ 23.741675] ? refcount_sub_and_test+0x115/0x1b0 [ 23.742368] ? refcount_inc+0x50/0x50 [ 23.742918] ? refcount_inc+0x50/0x50 [ 23.743500] ? sk_destruct+0x4c/0x80 [ 23.744714] ? __sk_free+0x5c/0x230 [ 23.745300] ? sk_free+0x2f/0x40 [ 23.759642] ? __tun_detach+0x176/0x1390 [ 23.760131] ? tun_attach+0xf90/0xf90 [ 23.760569] ? do_raw_spin_trylock+0x190/0x190 [ 23.761089] ? locks_remove_file+0x3fa/0x5a0 [ 23.761600] ? fcntl_setlk+0x10d0/0x10d0 [ 23.762084] ? __fsnotify_parent+0xb4/0x3a0 [ 23.762677] ? fsnotify+0x1af0/0x1af0 [ 23.763190] ? __tun_detach+0x1390/0x1390 [ 23.763661] ? __tun_detach+0x1390/0x1390 [ 23.764207] rtnl_unlock+0xe/0x10 [ 23.764768] tun_chr_close+0x49/0x60 [ 23.765344] __fput+0x333/0x7f0 [ 23.765760] ? fput+0x140/0x140 [ 23.766240] ? check_same_owner+0x320/0x320 [ 23.766779] ? _raw_spin_unlock_irq+0x27/0x70 [ 23.767435] ____fput+0x15/0x20 [ 23.767862] task_work_run+0x199/0x270 [ 23.768411] ? task_work_cancel+0x210/0x210 [ 23.768915] ? _raw_spin_unlock+0x22/0x30 [ 23.769466] ? switch_task_namespaces+0x87/0xc0 [ 23.770077] do_exit+0xa52/0x1b40 [ 23.770477] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 23.771111] ? check_noncircular+0x20/0x20 [ 23.771594] ? __handle_mm_fault+0x587/0x39c0 [ 23.772153] ? mm_update_next_owner+0x930/0x930 [ 23.772677] ? __pmd_alloc+0x4e0/0x4e0 [ 23.773192] ? find_held_lock+0x39/0x1d0 [ 23.773685] ? lock_downgrade+0x990/0x990 [ 23.774319] ? handle_mm_fault+0x4a2/0x860 [ 23.774809] ? down_read_trylock+0xdb/0x170 [ 23.775418] ? __handle_mm_fault+0x39c0/0x39c0 [ 23.775931] ? vmacache_find+0x61/0x270 [ 23.776450] ? up_read+0x1a/0x40 [ 23.776833] ? __do_page_fault+0x35b/0xb60 [ 23.777367] ? do_page_fault+0xee/0x720 [ 23.777816] ? __do_page_fault+0xb60/0xb60 [ 23.778342] ? putname+0xf3/0x130 [ 23.778776] do_group_exit+0x149/0x400 [ 23.779275] ? lockdep_sys_exit+0x47/0xf0 [ 23.779735] ? SyS_exit+0x30/0x30 [ 23.780174] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 23.780736] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 23.781321] SyS_exit_group+0x1d/0x20 [ 23.781751] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 23.782326] RIP: 0033:0x438839 [ 23.782684] RSP: 002b:00007fffdf6f1de8 EFLAGS: 00000246 ORIG_RAX: 00000000000000e7 [ 23.783582] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 0000000000438839 [ 23.784428] RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000 [ 23.785313] RBP: 0000000000000082 R08: 000000000000003c R09: 00000000000000e7 [ 23.786164] R10: ffffffffffffffc0 R11: 0000000000000246 R12: 0000000000000001 [ 23.786973] R13: 00000000006cd300 R14: 0000000000402330 R15: 0000000000000000 [ 23.787846] [ 23.788082] Allocated by task 3000: [ 23.788491] save_stack_trace+0x16/0x20 [ 23.788932] save_stack+0x43/0xd0 [ 23.789362] kasan_kmalloc+0xad/0xe0 [ 23.789775] __kmalloc_node+0x47/0x70 [ 23.790253] kvmalloc_node+0x64/0xd0 [ 23.790675] alloc_netdev_mqs+0x16e/0xed0 [ 23.791215] __tun_chr_ioctl+0x12be/0x3d20 [ 23.791693] tun_chr_ioctl+0x2a/0x40 [ 23.792183] do_vfs_ioctl+0x1b1/0x1530 [ 23.792617] SyS_ioctl+0x8f/0xc0 [ 23.793204] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 23.793796] [ 23.794062] Freed by task 3000: [ 23.794475] save_stack_trace+0x16/0x20 [ 23.794961] save_stack+0x43/0xd0 [ 23.795450] kasan_slab_free+0x71/0xc0 [ 23.795919] kfree+0xca/0x250 [ 23.796361] kvfree+0x36/0x60 [ 23.797109] free_netdev+0x2cf/0x360 [ 23.797531] __tun_chr_ioctl+0x2cf6/0x3d20 [ 23.798050] tun_chr_ioctl+0x2a/0x40 [ 23.798467] do_vfs_ioctl+0x1b1/0x1530 [ 23.798892] SyS_ioctl+0x8f/0xc0 [ 23.799341] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 23.799857] [ 23.800098] The buggy address belongs to the object at ffff88003cd804c0 [ 23.800098] which belongs to the cache kmalloc-16384 of size 16384 [ 23.801537] The buggy address is located 13312 bytes inside of [ 23.801537] 16384-byte region [ffff88003cd804c0, ffff88003cd844c0) [ 23.802935] The buggy address belongs to the page: [ 23.803554] page:ffffea0000f36000 count:1 mapcount:0 mapping:ffff88003cd804c0 index:0x0 compound_mapcount: 0 [ 23.804691] flags: 0x100000000008100(slab|head) [ 23.805258] raw: 0100000000008100 ffff88003cd804c0 0000000000000000 0000000100000001 [ 23.806144] raw: ffffea0000ea7a20 ffff88003e801c50 ffff88003e802200 0000000000000000 [ 23.807071] page dumped because: kasan: bad access detected [ 23.807678] [ 23.807871] Memory state around the buggy address: [ 23.808454] ffff88003cd83780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 23.809288] ffff88003cd83800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 23.810114] >ffff88003cd83880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 23.810879] ^ [ 23.811509] ffff88003cd83900: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 23.812345] ffff88003cd83980: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 23.813199] ================================================================== [ 23.813977] Disabling lock debugging due to kernel taint [ 23.814592] Kernel panic - not syncing: panic_on_warn set ... [ 23.814592] [ 23.815413] CPU: 2 PID: 3000 Comm: syzkaller137214 Tainted: G B 4.13.0-next-20170905+ #15 [ 23.816456] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS Bochs 01/01/2011 [ 23.817960] Call Trace: [ 23.818283] dump_stack+0x194/0x257 [ 23.818668] ? arch_local_irq_restore+0x53/0x53 [ 23.819210] ? vprintk_default+0x28/0x30 [ 23.819638] ? detach_if_pending+0x530/0x610 [ 23.820143] panic+0x1e4/0x417 [ 23.820483] ? __warn+0x1d9/0x1d9 [ 23.820854] ? detach_if_pending+0x557/0x610 [ 23.821356] kasan_end_report+0x50/0x50 [ 23.821782] kasan_report+0x137/0x340 [ 23.822242] __asan_report_store8_noabort+0x17/0x20 [ 23.822771] detach_if_pending+0x557/0x610 [ 23.823289] ? trace_raw_output_tick_stop+0x130/0x130 [ 23.823833] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 23.824357] ? lock_timer_base+0x1a3/0x2b0 [ 23.824798] ? lock_timer_base+0x1eb/0x2b0 [ 23.825270] ? __internal_add_timer+0x2d0/0x2d0 [ 23.825758] ? trace_hardirqs_on+0xd/0x10 [ 23.826230] try_to_del_timer_sync+0xa2/0x120 [ 23.826705] ? del_timer+0x130/0x130 [ 23.827144] ? del_timer_sync+0xeb/0x240 [ 23.827574] del_timer_sync+0x18a/0x240 [ 23.827993] tun_free_netdev+0x105/0x1b0 [ 23.828466] ? tun_xdp+0x410/0x410 [ 23.828840] ? cpumask_next+0x24/0x30 [ 23.829275] ? netdev_refcnt_read+0xed/0x150 [ 23.829742] ? tun_xdp+0x410/0x410 [ 23.830157] netdev_run_todo+0x870/0xca0 [ 23.830546] ? do_group_exit+0x149/0x400 [ 23.830902] ? register_netdev+0x30/0x30 [ 23.831314] ? lock_downgrade+0x990/0x990 [ 23.831662] ? trace_hardirqs_on+0xd/0x10 [ 23.832073] ? refcount_sub_and_test+0x115/0x1b0 [ 23.832472] ? refcount_inc+0x50/0x50 [ 23.832802] ? refcount_inc+0x50/0x50 [ 23.833176] ? sk_destruct+0x4c/0x80 [ 23.833499] ? __sk_free+0x5c/0x230 [ 23.833816] ? sk_free+0x2f/0x40 [ 23.834151] ? __tun_detach+0x176/0x1390 [ 23.834510] ? tun_attach+0xf90/0xf90 [ 23.834888] ? do_raw_spin_trylock+0x190/0x190 [ 23.835327] ? locks_remove_file+0x3fa/0x5a0 [ 23.835709] ? fcntl_setlk+0x10d0/0x10d0 [ 23.836095] ? __fsnotify_parent+0xb4/0x3a0 [ 23.836474] ? fsnotify+0x1af0/0x1af0 [ 23.836808] ? __tun_detach+0x1390/0x1390 [ 23.837216] ? __tun_detach+0x1390/0x1390 [ 23.837579] rtnl_unlock+0xe/0x10 [ 23.837880] tun_chr_close+0x49/0x60 [ 23.838244] __fput+0x333/0x7f0 [ 23.838536] ? fput+0x140/0x140 [ 23.838824] ? check_same_owner+0x320/0x320 [ 23.840530] ? _raw_spin_unlock_irq+0x27/0x70 [ 23.841386] ____fput+0x15/0x20 [ 23.841623] task_work_run+0x199/0x270 [ 23.842072] ? task_work_cancel+0x210/0x210 [ 23.842722] ? _raw_spin_unlock+0x22/0x30 [ 23.843423] ? switch_task_namespaces+0x87/0xc0 [ 23.844170] do_exit+0xa52/0x1b40 [ 23.844688] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 23.845469] ? check_noncircular+0x20/0x20 [ 23.846128] ? __handle_mm_fault+0x587/0x39c0 [ 23.847120] ? mm_update_next_owner+0x930/0x930 [ 23.848105] ? __pmd_alloc+0x4e0/0x4e0 [ 23.848905] ? find_held_lock+0x39/0x1d0 [ 23.849775] ? lock_downgrade+0x990/0x990 [ 23.850687] ? handle_mm_fault+0x4a2/0x860 [ 23.855249] ? down_read_trylock+0xdb/0x170 [ 23.867441] ? __handle_mm_fault+0x39c0/0x39c0 [ 23.867970] ? vmacache_find+0x61/0x270 [ 23.868414] ? up_read+0x1a/0x40 [ 23.868751] ? __do_page_fault+0x35b/0xb60 [ 23.869246] ? do_page_fault+0xee/0x720 [ 23.869720] ? __do_page_fault+0xb60/0xb60 [ 23.870258] ? putname+0xf3/0x130 [ 23.870651] do_group_exit+0x149/0x400 [ 23.871129] ? lockdep_sys_exit+0x47/0xf0 [ 23.871607] ? SyS_exit+0x30/0x30 [ 23.872054] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 23.872625] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 23.873219] SyS_exit_group+0x1d/0x20 [ 23.873647] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 23.874575] RIP: 0033:0x438839 [ 23.875219] RSP: 002b:00007fffdf6f1de8 EFLAGS: 00000246 ORIG_RAX: 00000000000000e7 [ 23.876783] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 0000000000438839 [ 23.878275] RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000 [ 23.879429] RBP: 0000000000000082 R08: 000000000000003c R09: 00000000000000e7 [ 23.880702] R10: ffffffffffffffc0 R11: 0000000000000246 R12: 0000000000000001 [ 23.883289] R13: 00000000006cd300 R14: 0000000000402330 R15: 0000000000000000