net.ipv6.conf.syz0.accept_dad = 0 net.ipv6.conf.syz0.router_solicitations = 0 executing program syzkaller login: [ 44.796382] ================================================================== [ 44.797226] BUG: KASAN: use-after-free in detach_if_pending+0x557/0x610 [ 44.797902] Write of size 8 at addr ffff88003c39b6c0 by task syzkaller550962/2971 [ 44.798650] [ 44.798821] CPU: 0 PID: 2971 Comm: syzkaller550962 Not tainted 4.13.0-next-20170906+ #16 [ 44.799544] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS Bochs 01/01/2011 [ 44.800098] Call Trace: [ 44.800293] dump_stack+0x194/0x257 [ 44.800564] ? arch_local_irq_restore+0x53/0x53 [ 44.800903] ? show_regs_print_info+0x65/0x65 [ 44.801242] ? lock_timer_base+0x1a3/0x2b0 [ 44.801549] ? detach_if_pending+0x557/0x610 [ 44.801874] print_address_description+0x73/0x250 [ 44.802285] ? detach_if_pending+0x557/0x610 [ 44.802691] kasan_report+0x24e/0x340 [ 44.803044] __asan_report_store8_noabort+0x17/0x20 [ 44.803514] detach_if_pending+0x557/0x610 [ 44.803972] ? trace_raw_output_tick_stop+0x130/0x130 [ 44.804460] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 44.804952] ? lock_timer_base+0x1a3/0x2b0 [ 44.805340] ? lock_timer_base+0x1eb/0x2b0 [ 44.805734] ? __internal_add_timer+0x2d0/0x2d0 [ 44.806152] ? trace_hardirqs_on+0xd/0x10 [ 44.806564] try_to_del_timer_sync+0xa2/0x120 [ 44.807478] ? del_timer+0x130/0x130 [ 44.807878] ? del_timer_sync+0xeb/0x240 [ 44.808322] del_timer_sync+0x18a/0x240 [ 44.808749] tun_free_netdev+0x105/0x1b0 [ 44.809183] ? tun_xdp+0x410/0x410 [ 44.809560] ? cpumask_next+0x24/0x30 [ 44.809995] ? netdev_refcnt_read+0xed/0x150 [ 44.810578] ? tun_xdp+0x410/0x410 [ 44.810971] netdev_run_todo+0x870/0xca0 [ 44.811415] ? do_group_exit+0x149/0x400 [ 44.811909] ? register_netdev+0x30/0x30 [ 44.812414] ? lock_downgrade+0x990/0x990 [ 44.812924] ? trace_hardirqs_on+0xd/0x10 [ 44.813416] ? refcount_sub_and_test+0x115/0x1b0 [ 44.813940] ? refcount_inc+0x50/0x50 [ 44.814395] ? refcount_inc+0x50/0x50 [ 44.814866] ? sk_destruct+0x4c/0x80 [ 44.815257] ? __sk_free+0x5c/0x230 [ 44.815634] ? sk_free+0x2f/0x40 [ 44.816005] ? __tun_detach+0x176/0x1390 [ 44.816465] ? tun_attach+0xf90/0xf90 [ 44.816870] ? do_raw_spin_trylock+0x190/0x190 [ 44.817470] ? locks_remove_file+0x3fa/0x5a0 [ 44.817989] ? fcntl_setlk+0x10d0/0x10d0 [ 44.818430] ? __fsnotify_parent+0xb4/0x3a0 [ 44.818930] ? fsnotify+0x1af0/0x1af0 [ 44.819392] ? __tun_detach+0x1390/0x1390 [ 44.819899] ? __tun_detach+0x1390/0x1390 [ 44.820361] rtnl_unlock+0xe/0x10 [ 44.820720] tun_chr_close+0x49/0x60 [ 44.821112] __fput+0x333/0x7f0 [ 44.821455] ? fput+0x140/0x140 [ 44.821813] ? check_same_owner+0x320/0x320 [ 44.822222] ? _raw_spin_unlock_irq+0x27/0x70 [ 44.822664] ____fput+0x15/0x20 [ 44.822957] task_work_run+0x199/0x270 [ 44.823275] ? task_work_cancel+0x210/0x210 [ 44.823578] ? _raw_spin_unlock+0x22/0x30 [ 44.823943] ? switch_task_namespaces+0x87/0xc0 [ 44.824414] do_exit+0xa52/0x1b40 [ 44.824730] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 44.825259] ? check_noncircular+0x20/0x20 [ 44.825615] ? __handle_mm_fault+0x587/0x39c0 [ 44.826083] ? mm_update_next_owner+0x930/0x930 [ 44.826550] ? __pmd_alloc+0x4e0/0x4e0 [ 44.826973] ? find_held_lock+0x39/0x1d0 [ 44.827407] ? lock_downgrade+0x990/0x990 [ 44.828187] ? handle_mm_fault+0x4a2/0x860 [ 44.828632] ? down_read_trylock+0xdb/0x170 [ 44.829091] ? __handle_mm_fault+0x39c0/0x39c0 [ 44.829585] ? vmacache_find+0x61/0x270 [ 44.830032] ? up_read+0x1a/0x40 [ 44.830388] ? __do_page_fault+0x35b/0xb60 [ 44.830759] ? do_page_fault+0xee/0x720 [ 44.831058] ? __do_page_fault+0xb60/0xb60 [ 44.831454] ? putname+0xf3/0x130 [ 44.831824] do_group_exit+0x149/0x400 [ 44.832230] ? lockdep_sys_exit+0x47/0xf0 [ 44.832668] ? SyS_exit+0x30/0x30 [ 44.833030] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 44.833559] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 44.834074] SyS_exit_group+0x1d/0x20 [ 44.834468] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 44.834941] RIP: 0033:0x438819 [ 44.835321] RSP: 002b:00007ffd6c084378 EFLAGS: 00000246 ORIG_RAX: 00000000000000e7 [ 44.836146] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 0000000000438819 [ 44.836857] RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000 [ 44.837568] RBP: 0000000000000082 R08: 000000000000003c R09: 00000000000000e7 [ 44.838280] R10: ffffffffffffffc0 R11: 0000000000000246 R12: 0000000000000001 [ 44.838977] R13: 00000000006cd300 R14: 0000000000402310 R15: 0000000000000000 [ 44.839756] [ 44.839935] Allocated by task 2971: [ 44.840321] save_stack_trace+0x16/0x20 [ 44.840803] save_stack+0x43/0xd0 [ 44.841207] kasan_kmalloc+0xad/0xe0 [ 44.841596] __kmalloc_node+0x47/0x70 [ 44.842002] kvmalloc_node+0x64/0xd0 [ 44.842394] alloc_netdev_mqs+0x16e/0xed0 [ 44.842827] __tun_chr_ioctl+0x12be/0x3d20 [ 44.843350] tun_chr_ioctl+0x2a/0x40 [ 44.843721] do_vfs_ioctl+0x1b1/0x1530 [ 44.844124] SyS_ioctl+0x8f/0xc0 [ 44.844460] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 44.844934] [ 44.845106] Freed by task 2971: [ 44.845459] save_stack_trace+0x16/0x20 [ 44.845899] save_stack+0x43/0xd0 [ 44.846309] kasan_slab_free+0x71/0xc0 [ 44.846774] kfree+0xca/0x250 [ 44.847161] kvfree+0x36/0x60 [ 44.847520] free_netdev+0x2cf/0x360 [ 44.847950] __tun_chr_ioctl+0x2cf6/0x3d20 [ 44.848429] tun_chr_ioctl+0x2a/0x40 [ 44.848796] do_vfs_ioctl+0x1b1/0x1530 [ 44.849445] SyS_ioctl+0x8f/0xc0 [ 44.849694] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 44.850120] [ 44.850314] The buggy address belongs to the object at ffff88003c3982c0 [ 44.850314] which belongs to the cache kmalloc-16384 of size 16384 [ 44.851654] The buggy address is located 13312 bytes inside of [ 44.851654] 16384-byte region [ffff88003c3982c0, ffff88003c39c2c0) [ 44.853095] The buggy address belongs to the page: [ 44.853656] page:ffffea0000f0e600 count:1 mapcount:0 mapping:ffff88003c3982c0 index:0x0 compound_mapcount: 0 [ 44.854822] flags: 0x100000000008100(slab|head) [ 44.855314] raw: 0100000000008100 ffff88003c3982c0 0000000000000000 0000000100000001 [ 44.856140] raw: ffffea0000e31a20 ffff88003e801c50 ffff88003e802200 0000000000000000 [ 44.856966] page dumped because: kasan: bad access detected [ 44.857529] [ 44.857709] Memory state around the buggy address: [ 44.858231] ffff88003c39b580: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 44.859008] ffff88003c39b600: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 44.859774] >ffff88003c39b680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 44.860609] ^ [ 44.861184] ffff88003c39b700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 44.861960] ffff88003c39b780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 44.862764] ================================================================== [ 44.863553] Disabling lock debugging due to kernel taint [ 44.864136] Kernel panic - not syncing: panic_on_warn set ... [ 44.864136] [ 44.864950] CPU: 0 PID: 2971 Comm: syzkaller550962 Tainted: G B 4.13.0-next-20170906+ #16 [ 44.866071] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS Bochs 01/01/2011 [ 44.866960] Call Trace: [ 44.867238] dump_stack+0x194/0x257 [ 44.867653] ? arch_local_irq_restore+0x53/0x53 [ 44.868143] ? vprintk_default+0x28/0x30 [ 44.868571] ? detach_if_pending+0x530/0x610 [ 44.869030] panic+0x1e4/0x417 [ 44.869361] ? __warn+0x1d9/0x1d9 [ 44.869728] ? detach_if_pending+0x557/0x610 [ 44.870211] kasan_end_report+0x50/0x50 [ 44.870819] kasan_report+0x137/0x340 [ 44.871107] __asan_report_store8_noabort+0x17/0x20 [ 44.871446] detach_if_pending+0x557/0x610 [ 44.871807] ? trace_raw_output_tick_stop+0x130/0x130 [ 44.872407] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 44.872918] ? lock_timer_base+0x1a3/0x2b0 [ 44.873409] ? lock_timer_base+0x1eb/0x2b0 [ 44.873869] ? __internal_add_timer+0x2d0/0x2d0 [ 44.874364] ? trace_hardirqs_on+0xd/0x10 [ 44.874834] try_to_del_timer_sync+0xa2/0x120 [ 44.875270] ? del_timer+0x130/0x130 [ 44.875653] ? del_timer_sync+0xeb/0x240 [ 44.876026] del_timer_sync+0x18a/0x240 [ 44.876388] tun_free_netdev+0x105/0x1b0 [ 44.876760] ? tun_xdp+0x410/0x410 [ 44.877087] ? cpumask_next+0x24/0x30 [ 44.877461] ? netdev_refcnt_read+0xed/0x150 [ 44.877940] ? tun_xdp+0x410/0x410 [ 44.878437] netdev_run_todo+0x870/0xca0 [ 44.878892] ? do_group_exit+0x149/0x400 [ 44.879390] ? register_netdev+0x30/0x30 [ 44.879882] ? lock_downgrade+0x990/0x990 [ 44.880342] ? trace_hardirqs_on+0xd/0x10 [ 44.880856] ? refcount_sub_and_test+0x115/0x1b0 [ 44.881401] ? refcount_inc+0x50/0x50 [ 44.881825] ? refcount_inc+0x50/0x50 [ 44.882221] ? sk_destruct+0x4c/0x80 [ 44.882623] ? __sk_free+0x5c/0x230 [ 44.882979] ? sk_free+0x2f/0x40 [ 44.883316] ? __tun_detach+0x176/0x1390 [ 44.883722] ? tun_attach+0xf90/0xf90 [ 44.884096] ? do_raw_spin_trylock+0x190/0x190 [ 44.884566] ? locks_remove_file+0x3fa/0x5a0 [ 44.885012] ? fcntl_setlk+0x10d0/0x10d0 [ 44.885461] ? __fsnotify_parent+0xb4/0x3a0 [ 44.885960] ? fsnotify+0x1af0/0x1af0 [ 44.886352] ? __tun_detach+0x1390/0x1390 [ 44.886822] ? __tun_detach+0x1390/0x1390 [ 44.887249] rtnl_unlock+0xe/0x10 [ 44.887603] tun_chr_close+0x49/0x60 [ 44.887988] __fput+0x333/0x7f0 [ 44.888337] ? fput+0x140/0x140 [ 44.888685] ? check_same_owner+0x320/0x320 [ 44.889211] ? _raw_spin_unlock_irq+0x27/0x70 [ 44.889704] ____fput+0x15/0x20 [ 44.890063] task_work_run+0x199/0x270 [ 44.890613] ? task_work_cancel+0x210/0x210 [ 44.891122] ? _raw_spin_unlock+0x22/0x30 [ 44.891565] ? switch_task_namespaces+0x87/0xc0 [ 44.892325] do_exit+0xa52/0x1b40 [ 44.892686] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 44.893202] ? check_noncircular+0x20/0x20 [ 44.893655] ? __handle_mm_fault+0x587/0x39c0 [ 44.894173] ? mm_update_next_owner+0x930/0x930 [ 44.894677] ? __pmd_alloc+0x4e0/0x4e0 [ 44.895112] ? find_held_lock+0x39/0x1d0 [ 44.895593] ? lock_downgrade+0x990/0x990 [ 44.896035] ? handle_mm_fault+0x4a2/0x860 [ 44.896472] ? down_read_trylock+0xdb/0x170 [ 44.896906] ? __handle_mm_fault+0x39c0/0x39c0 [ 44.897363] ? vmacache_find+0x61/0x270 [ 44.897787] ? up_read+0x1a/0x40 [ 44.898138] ? __do_page_fault+0x35b/0xb60 [ 44.898559] ? do_page_fault+0xee/0x720 [ 44.898953] ? __do_page_fault+0xb60/0xb60 [ 44.899429] ? putname+0xf3/0x130 [ 44.899811] do_group_exit+0x149/0x400 [ 44.900238] ? lockdep_sys_exit+0x47/0xf0 [ 44.900673] ? SyS_exit+0x30/0x30 [ 44.901039] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 44.901610] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 44.902109] SyS_exit_group+0x1d/0x20 [ 44.902435] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 44.902843] RIP: 0033:0x438819 [ 44.903142] RSP: 002b:00007ffd6c084378 EFLAGS: 00000246 ORIG_RAX: 00000000000000e7 [ 44.903789] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 0000000000438819 [ 44.904423] RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000 [ 44.905071] RBP: 0000000000000082 R08: 000000000000003c R09: 00000000000000e7 [ 44.905683] R10: ffffffffffffffc0 R11: 0000000000000246 R12: 0000000000000001 [ 44.906333] R13: 00000000006cd300 R14: 0000000000402310 R15: 0000000000000000 [ 44.907009] Dumping ftrace buffer: [ 44.907322] (ftrace buffer empty) [ 44.907634] Kernel Offset: disabled [ 44.907957] Rebooting in 86400 seconds..