net.ipv6.conf.syz0.accept_dad = 0 net.ipv6.conf.syz0.router_solicitations = 0 executing program syzkaller login: [ 24.229899] ================================================================== [ 24.231516] BUG: KASAN: use-after-free in detach_if_pending+0x557/0x610 [ 24.232964] Write of size 8 at addr ffff88006d2ab840 by task syzkaller946259/3015 [ 24.234493] [ 24.234774] CPU: 3 PID: 3015 Comm: syzkaller946259 Not tainted 4.13.0-next-20170915+ #5 [ 24.237346] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS Bochs 01/01/2011 [ 24.238693] Call Trace: [ 24.239191] dump_stack+0x194/0x257 [ 24.239589] ? arch_local_irq_restore+0x53/0x53 [ 24.240179] ? show_regs_print_info+0x65/0x65 [ 24.240679] ? lock_timer_base+0x1a3/0x2b0 [ 24.241150] ? detach_if_pending+0x557/0x610 [ 24.241664] print_address_description+0x73/0x250 [ 24.242130] ? detach_if_pending+0x557/0x610 [ 24.242640] kasan_report+0x24e/0x340 [ 24.243084] __asan_report_store8_noabort+0x17/0x20 [ 24.243601] detach_if_pending+0x557/0x610 [ 24.244005] ? trace_raw_output_tick_stop+0x130/0x130 [ 24.244544] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 24.244907] ? lock_timer_base+0x1a3/0x2b0 [ 24.245346] ? lock_timer_base+0x1eb/0x2b0 [ 24.245786] ? __internal_add_timer+0x2d0/0x2d0 [ 24.246267] ? trace_hardirqs_on+0xd/0x10 [ 24.246707] try_to_del_timer_sync+0xa2/0x120 [ 24.247193] ? del_timer+0x130/0x130 [ 24.247585] ? del_timer_sync+0xeb/0x240 [ 24.248023] del_timer_sync+0x18a/0x240 [ 24.248440] tun_free_netdev+0x105/0x1b0 [ 24.248864] ? tun_xdp+0x410/0x410 [ 24.249232] ? cpumask_next+0x24/0x30 [ 24.249636] ? netdev_refcnt_read+0xed/0x150 [ 24.250110] ? tun_xdp+0x410/0x410 [ 24.250489] netdev_run_todo+0x870/0xca0 [ 24.250926] ? do_group_exit+0x149/0x400 [ 24.251359] ? register_netdev+0x30/0x30 [ 24.251788] ? lock_downgrade+0x990/0x990 [ 24.252234] ? trace_hardirqs_on+0xd/0x10 [ 24.252685] ? refcount_sub_and_test+0x115/0x1b0 [ 24.253181] ? refcount_inc+0x50/0x50 [ 24.253617] ? refcount_inc+0x50/0x50 [ 24.254245] ? sk_destruct+0x4c/0x80 [ 24.255237] ? __sk_free+0x5c/0x230 [ 24.256040] ? sk_free+0x2f/0x40 [ 24.256940] ? __tun_detach+0x176/0x1390 [ 24.257553] ? tun_attach+0xf90/0xf90 [ 24.258337] ? locks_remove_file+0x3fa/0x5a0 [ 24.259257] ? fcntl_setlk+0x10d0/0x10d0 [ 24.260149] ? __fsnotify_parent+0xb4/0x3a0 [ 24.261074] ? fsnotify+0x1af0/0x1af0 [ 24.261869] ? __tun_detach+0x1390/0x1390 [ 24.262763] ? __tun_detach+0x1390/0x1390 [ 24.263645] rtnl_unlock+0xe/0x10 [ 24.264415] tun_chr_close+0x49/0x60 [ 24.265251] __fput+0x333/0x7f0 [ 24.265986] ? fput+0x140/0x140 [ 24.266721] ? check_same_owner+0x320/0x320 [ 24.267672] ____fput+0x15/0x20 [ 24.268125] task_work_run+0x199/0x270 [ 24.268912] ? task_work_cancel+0x210/0x210 [ 24.269747] ? free_nsproxy+0x185/0x1f0 [ 24.270547] ? switch_task_namespaces+0xa2/0xc0 [ 24.271501] do_exit+0xa52/0x1b40 [ 24.272230] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 24.273301] ? check_noncircular+0x20/0x20 [ 24.274282] ? __handle_mm_fault+0x587/0x39c0 [ 24.275245] ? mm_update_next_owner+0x930/0x930 [ 24.276249] ? __pmd_alloc+0x4e0/0x4e0 [ 24.277107] ? find_held_lock+0x39/0x1d0 [ 24.278031] ? lock_downgrade+0x990/0x990 [ 24.278803] ? handle_mm_fault+0x410/0x8d0 [ 24.279747] ? down_read_trylock+0xdb/0x170 [ 24.280454] ? __do_page_fault+0x2b8/0xb60 [ 24.281080] ? __handle_mm_fault+0x39c0/0x39c0 [ 24.281936] ? vmacache_find+0x61/0x270 [ 24.282358] ? vmacache_update+0xfe/0x130 [ 24.282913] ? up_read+0x1a/0x40 [ 24.283290] ? __do_page_fault+0x35b/0xb60 [ 24.283770] ? do_page_fault+0xee/0x720 [ 24.284255] ? __do_page_fault+0xb60/0xb60 [ 24.284716] ? putname+0xf3/0x130 [ 24.285019] do_group_exit+0x149/0x400 [ 24.285435] ? lockdep_sys_exit+0x47/0xf0 [ 24.285929] ? SyS_exit+0x30/0x30 [ 24.286344] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 24.286950] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 24.287539] SyS_exit_group+0x1d/0x20 [ 24.287963] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 24.288559] RIP: 0033:0x43a399 [ 24.288911] RSP: 002b:00000000007dfe38 EFLAGS: 00000202 ORIG_RAX: 00000000000000e7 [ 24.289723] RAX: ffffffffffffffda RBX: ef52a0e856e32e4e RCX: 000000000043a399 [ 24.290422] RDX: 000000000043a399 RSI: 0000000020927fd8 RDI: 0000000000000001 [ 24.291238] RBP: 0000000000000082 R08: 0000000000000000 R09: 0000000000000000 [ 24.291968] R10: 0000000000000000 R11: 0000000000000202 R12: 0000000000000000 [ 24.292670] R13: 0000000000402960 R14: 00000000004029f0 R15: 0000000000000000 [ 24.293431] [ 24.293604] Allocated by task 3015: [ 24.293983] save_stack_trace+0x16/0x20 [ 24.294397] save_stack+0x43/0xd0 [ 24.294757] kasan_kmalloc+0xad/0xe0 [ 24.295149] __kmalloc_node+0x47/0x70 [ 24.295547] kvmalloc_node+0x64/0xd0 [ 24.295935] alloc_netdev_mqs+0x16e/0xed0 [ 24.296373] __tun_chr_ioctl+0x12be/0x3d20 [ 24.296814] tun_chr_ioctl+0x2a/0x40 [ 24.297202] do_vfs_ioctl+0x1b1/0x1530 [ 24.297608] SyS_ioctl+0x8f/0xc0 [ 24.297960] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 24.298450] [ 24.298623] Freed by task 3015: [ 24.298954] save_stack_trace+0x16/0x20 [ 24.299329] save_stack+0x43/0xd0 [ 24.299910] kasan_slab_free+0x71/0xc0 [ 24.300276] kfree+0xca/0x250 [ 24.300800] kvfree+0x36/0x60 [ 24.301164] free_netdev+0x2cf/0x360 [ 24.301948] __tun_chr_ioctl+0x2cf6/0x3d20 [ 24.302909] tun_chr_ioctl+0x2a/0x40 [ 24.303677] do_vfs_ioctl+0x1b1/0x1530 [ 24.304543] SyS_ioctl+0x8f/0xc0 [ 24.305328] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 24.306441] [ 24.306834] The buggy address belongs to the object at ffff88006d2a8440 [ 24.306834] which belongs to the cache kmalloc-16384 of size 16384 [ 24.309759] The buggy address is located 13312 bytes inside of [ 24.309759] 16384-byte region [ffff88006d2a8440, ffff88006d2ac440) [ 24.312535] The buggy address belongs to the page: [ 24.313639] page:ffffea0001b4aa00 count:1 mapcount:0 mapping:ffff88006d2a8440 index:0x0 compound_mapcount: 0 [ 24.315968] flags: 0x500000000008100(slab|head) [ 24.317061] raw: 0500000000008100 ffff88006d2a8440 0000000000000000 0000000100000001 [ 24.318821] raw: ffffea0001a22420 ffff88006d800c50 ffff88003e802200 0000000000000000 [ 24.320550] page dumped because: kasan: bad access detected [ 24.321739] [ 24.322715] Memory state around the buggy address: [ 24.323812] ffff88006d2ab700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 24.325436] ffff88006d2ab780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 24.327047] >ffff88006d2ab800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 24.328623] ^ [ 24.329800] ffff88006d2ab880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 24.331405] ffff88006d2ab900: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 24.332977] ================================================================== [ 24.334551] Disabling lock debugging due to kernel taint [ 24.335782] Kernel panic - not syncing: panic_on_warn set ... [ 24.335782] [ 24.337340] CPU: 3 PID: 3015 Comm: syzkaller946259 Tainted: G B 4.13.0-next-20170915+ #5 [ 24.339284] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS Bochs 01/01/2011 [ 24.340960] Call Trace: [ 24.341511] dump_stack+0x194/0x257 [ 24.342636] ? arch_local_irq_restore+0x53/0x53 [ 24.343252] ? vprintk_default+0x28/0x30 [ 24.343697] ? detach_if_pending+0x510/0x610 [ 24.344202] panic+0x1e4/0x417 [ 24.344575] ? __warn+0x1d9/0x1d9 [ 24.344956] ? detach_if_pending+0x557/0x610 [ 24.345470] kasan_end_report+0x50/0x50 [ 24.345934] kasan_report+0x137/0x340 [ 24.346368] __asan_report_store8_noabort+0x17/0x20 [ 24.347038] detach_if_pending+0x557/0x610 [ 24.347549] ? trace_raw_output_tick_stop+0x130/0x130 [ 24.348158] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 24.348690] ? lock_timer_base+0x1a3/0x2b0 [ 24.349181] ? lock_timer_base+0x1eb/0x2b0 [ 24.349675] ? __internal_add_timer+0x2d0/0x2d0 [ 24.350205] ? trace_hardirqs_on+0xd/0x10 [ 24.350691] try_to_del_timer_sync+0xa2/0x120 [ 24.351398] ? del_timer+0x130/0x130 [ 24.351815] ? del_timer_sync+0xeb/0x240 [ 24.352283] del_timer_sync+0x18a/0x240 [ 24.352901] tun_free_netdev+0x105/0x1b0 [ 24.353372] ? tun_xdp+0x410/0x410 [ 24.353822] ? cpumask_next+0x24/0x30 [ 24.354230] ? netdev_refcnt_read+0xed/0x150 [ 24.354743] ? tun_xdp+0x410/0x410 [ 24.355162] netdev_run_todo+0x870/0xca0 [ 24.355947] ? do_group_exit+0x149/0x400 [ 24.356538] ? register_netdev+0x30/0x30 [ 24.357015] ? lock_downgrade+0x990/0x990 [ 24.357482] ? trace_hardirqs_on+0xd/0x10 [ 24.358176] ? refcount_sub_and_test+0x115/0x1b0 [ 24.359143] ? refcount_inc+0x50/0x50 [ 24.359918] ? refcount_inc+0x50/0x50 [ 24.360700] ? sk_destruct+0x4c/0x80 [ 24.361448] ? __sk_free+0x5c/0x230 [ 24.362210] ? sk_free+0x2f/0x40 [ 24.362887] ? __tun_detach+0x176/0x1390 [ 24.363919] ? tun_attach+0xf90/0xf90 [ 24.365118] ? locks_remove_file+0x3fa/0x5a0 [ 24.366035] ? fcntl_setlk+0x10d0/0x10d0 [ 24.366840] ? __fsnotify_parent+0xb4/0x3a0 [ 24.367751] ? fsnotify+0x1af0/0x1af0 [ 24.368537] ? __tun_detach+0x1390/0x1390 [ 24.369357] ? __tun_detach+0x1390/0x1390 [ 24.370201] rtnl_unlock+0xe/0x10 [ 24.370909] tun_chr_close+0x49/0x60 [ 24.371657] __fput+0x333/0x7f0 [ 24.372343] ? fput+0x140/0x140 [ 24.373003] ? check_same_owner+0x320/0x320 [ 24.373895] ____fput+0x15/0x20 [ 24.374595] task_work_run+0x199/0x270 [ 24.375429] ? task_work_cancel+0x210/0x210 [ 24.376304] ? free_nsproxy+0x185/0x1f0 [ 24.377093] ? switch_task_namespaces+0xa2/0xc0 [ 24.378037] do_exit+0xa52/0x1b40 [ 24.378717] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 24.379711] ? check_noncircular+0x20/0x20 [ 24.380538] ? __handle_mm_fault+0x587/0x39c0 [ 24.381426] ? mm_update_next_owner+0x930/0x930 [ 24.382368] ? __pmd_alloc+0x4e0/0x4e0 [ 24.383197] ? find_held_lock+0x39/0x1d0 [ 24.384010] ? lock_downgrade+0x990/0x990 [ 24.384681] ? handle_mm_fault+0x410/0x8d0 [ 24.385122] ? down_read_trylock+0xdb/0x170 [ 24.385566] ? __do_page_fault+0x2b8/0xb60 [ 24.386260] ? __handle_mm_fault+0x39c0/0x39c0 [ 24.386904] ? vmacache_find+0x61/0x270 [ 24.387681] ? vmacache_update+0xfe/0x130 [ 24.388523] ? up_read+0x1a/0x40 [ 24.389224] ? __do_page_fault+0x35b/0xb60 [ 24.390088] ? do_page_fault+0xee/0x720 [ 24.390889] ? __do_page_fault+0xb60/0xb60 [ 24.391366] ? putname+0xf3/0x130 [ 24.391781] do_group_exit+0x149/0x400 [ 24.392190] ? lockdep_sys_exit+0x47/0xf0 [ 24.392665] ? SyS_exit+0x30/0x30 [ 24.393062] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 24.393650] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 24.394190] SyS_exit_group+0x1d/0x20 [ 24.394641] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 24.395327] RIP: 0033:0x43a399 [ 24.395697] RSP: 002b:00000000007dfe38 EFLAGS: 00000202 ORIG_RAX: 00000000000000e7 [ 24.396573] RAX: ffffffffffffffda RBX: ef52a0e856e32e4e RCX: 000000000043a399 [ 24.397388] RDX: 000000000043a399 RSI: 0000000020927fd8 RDI: 0000000000000001 [ 24.398200] RBP: 0000000000000082 R08: 0000000000000000 R09: 0000000000000000 [ 24.399056] R10: 0000000000000000 R11: 0000000000000202 R12: 0000000000000000 [ 24.399863] R13: 0000000000402960 R14: 00000000004029f0 R15: 0000000000000000 [ 24.400808] Dumping ftrace buffer: [ 24.401222] (ftrace buffer empty) [ 24.401752] Kernel Offset: disabled [ 24.402173] Rebooting in 86400 seconds..