net.ipv6.conf.syz0.accept_dad = 0 net.ipv6.conf.syz0.router_solicitations = 0 executing program syzkaller login: [ 24.705315] ================================================================== [ 24.706582] BUG: KASAN: use-after-free in detach_if_pending+0x557/0x610 [ 24.707376] Write of size 8 at addr ffff88003a603740 by task syzkaller103110/2985 [ 24.708289] [ 24.708486] CPU: 1 PID: 2985 Comm: syzkaller103110 Not tainted 4.13.0-rc7-next-20170829+ #11 [ 24.709470] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS Bochs 01/01/2011 [ 24.710380] Call Trace: [ 24.710687] dump_stack+0x194/0x257 [ 24.711198] ? arch_local_irq_restore+0x53/0x53 [ 24.711734] ? show_regs_print_info+0x65/0x65 [ 24.712218] ? lock_timer_base+0x1a3/0x2b0 [ 24.712672] ? detach_if_pending+0x557/0x610 [ 24.713148] print_address_description+0x73/0x250 [ 24.713688] ? detach_if_pending+0x557/0x610 [ 24.714214] kasan_report+0x24e/0x340 [ 24.714657] __asan_report_store8_noabort+0x17/0x20 [ 24.715283] detach_if_pending+0x557/0x610 [ 24.715734] ? trace_raw_output_tick_stop+0x130/0x130 [ 24.716269] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 24.716755] ? lock_timer_base+0x1a3/0x2b0 [ 24.717247] ? lock_timer_base+0x1eb/0x2b0 [ 24.717744] ? __internal_add_timer+0x2d0/0x2d0 [ 24.718247] ? trace_hardirqs_on+0xd/0x10 [ 24.718705] try_to_del_timer_sync+0xa2/0x120 [ 24.719203] ? del_timer+0x130/0x130 [ 24.719607] ? del_timer_sync+0xeb/0x240 [ 24.720063] del_timer_sync+0x18a/0x240 [ 24.720547] tun_free_netdev+0x105/0x1b0 [ 24.720985] ? tun_xdp+0x410/0x410 [ 24.721364] ? cpumask_next+0x24/0x30 [ 24.721829] ? netdev_refcnt_read+0xed/0x150 [ 24.722305] ? tun_xdp+0x410/0x410 [ 24.722686] netdev_run_todo+0x870/0xca0 [ 24.723125] ? do_group_exit+0x149/0x400 [ 24.723637] ? register_netdev+0x30/0x30 [ 24.724091] ? lock_downgrade+0x990/0x990 [ 24.724536] ? trace_hardirqs_on+0xd/0x10 [ 24.725005] ? refcount_sub_and_test+0x115/0x1b0 [ 24.725519] ? refcount_inc+0x50/0x50 [ 24.725929] ? refcount_inc+0x50/0x50 [ 24.726770] ? sk_destruct+0x4c/0x80 [ 24.727233] ? __sk_free+0x5c/0x230 [ 24.727745] ? sk_free+0x2f/0x40 [ 24.728124] ? __tun_detach+0x176/0x1390 [ 24.728567] ? tun_attach+0xf90/0xf90 [ 24.728978] ? do_raw_spin_trylock+0x190/0x190 [ 24.729497] ? locks_remove_file+0x3fa/0x5a0 [ 24.730003] ? fcntl_setlk+0x10d0/0x10d0 [ 24.730446] ? __fsnotify_parent+0xb4/0x3a0 [ 24.730915] ? fsnotify+0x1af0/0x1af0 [ 24.731408] ? rcu_note_context_switch+0x710/0x710 [ 24.731975] ? __tun_detach+0x1390/0x1390 [ 24.732433] ? __tun_detach+0x1390/0x1390 [ 24.732881] rtnl_unlock+0xe/0x10 [ 24.733295] tun_chr_close+0x49/0x60 [ 24.733753] __fput+0x333/0x7f0 [ 24.734196] ? fput+0x140/0x140 [ 24.734580] ? check_same_owner+0x320/0x320 [ 24.735070] ? _raw_spin_unlock_irq+0x27/0x70 [ 24.735626] ____fput+0x15/0x20 [ 24.735996] task_work_run+0x199/0x270 [ 24.736421] ? task_work_cancel+0x210/0x210 [ 24.736886] ? _raw_spin_unlock+0x22/0x30 [ 24.737422] ? switch_task_namespaces+0x87/0xc0 [ 24.737955] do_exit+0xa52/0x1b40 [ 24.738330] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 24.738893] ? check_noncircular+0x20/0x20 [ 24.739356] ? __handle_mm_fault+0x587/0x39c0 [ 24.739843] ? mm_update_next_owner+0x930/0x930 [ 24.740342] ? __pmd_alloc+0x4e0/0x4e0 [ 24.740774] ? find_held_lock+0x39/0x1d0 [ 24.741252] ? lock_downgrade+0x990/0x990 [ 24.741729] ? handle_mm_fault+0x4a2/0x860 [ 24.742183] ? down_read_trylock+0xdb/0x170 [ 24.742647] ? __handle_mm_fault+0x39c0/0x39c0 [ 24.743140] ? vmacache_find+0x61/0x270 [ 24.743577] ? up_read+0x1a/0x40 [ 24.743996] ? __do_page_fault+0x35b/0xb60 [ 24.744490] ? trace_do_page_fault+0x141/0x730 [ 24.744986] ? do_page_fault+0x70/0x70 [ 24.745422] ? iterate_fd+0x3f0/0x3f0 [ 24.745845] ? putname+0xf3/0x130 [ 24.746234] do_group_exit+0x149/0x400 [ 24.746693] ? lockdep_sys_exit+0x1c4/0x2b0 [ 24.747293] ? SyS_exit+0x30/0x30 [ 24.747708] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 24.748655] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 24.749194] SyS_exit_group+0x1d/0x20 [ 24.749603] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 24.750095] RIP: 0033:0x438819 [ 24.750438] RSP: 002b:00007ffc655db508 EFLAGS: 00000246 ORIG_RAX: 00000000000000e7 [ 24.751341] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 0000000000438819 [ 24.752238] RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000 [ 24.753003] RBP: 0000000000000086 R08: 000000000000003c R09: 00000000000000e7 [ 24.753766] R10: ffffffffffffffc0 R11: 0000000000000246 R12: 0000000000000001 [ 24.754501] R13: 00000000006cd300 R14: 0000000000402310 R15: 0000000000000000 [ 24.755204] [ 24.755385] Allocated by task 2985: [ 24.755828] save_stack_trace+0x16/0x20 [ 24.756257] save_stack+0x43/0xd0 [ 24.756628] kasan_kmalloc+0xad/0xe0 [ 24.757025] __kmalloc_node+0x47/0x70 [ 24.757444] kvmalloc_node+0x64/0xd0 [ 24.757880] alloc_netdev_mqs+0x16e/0xed0 [ 24.758323] __tun_chr_ioctl+0x12be/0x3d20 [ 24.758812] tun_chr_ioctl+0x2a/0x40 [ 24.759249] do_vfs_ioctl+0x1b1/0x1530 [ 24.759664] SyS_ioctl+0x8f/0xc0 [ 24.760026] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 24.760527] [ 24.760708] Freed by task 2985: [ 24.761059] save_stack_trace+0x16/0x20 [ 24.761483] save_stack+0x43/0xd0 [ 24.761853] kasan_slab_free+0x71/0xc0 [ 24.762269] kfree+0xca/0x250 [ 24.762600] kvfree+0x36/0x60 [ 24.762932] free_netdev+0x2cf/0x360 [ 24.763338] __tun_chr_ioctl+0x2cf6/0x3d20 [ 24.763786] tun_chr_ioctl+0x2a/0x40 [ 24.764182] do_vfs_ioctl+0x1b1/0x1530 [ 24.764597] SyS_ioctl+0x8f/0xc0 [ 24.764957] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 24.765449] [ 24.765627] The buggy address belongs to the object at ffff88003a600340 [ 24.765627] which belongs to the cache kmalloc-16384 of size 16384 [ 24.766621] The buggy address is located 13312 bytes inside of [ 24.766621] 16384-byte region [ffff88003a600340, ffff88003a604340) [ 24.767502] The buggy address belongs to the page: [ 24.767879] page:ffffea0000e98000 count:1 mapcount:0 mapping:ffff88003a600340 index:0x0 compound_mapcount: 0 [ 24.768619] flags: 0x100000000008100(slab|head) [ 24.768988] raw: 0100000000008100 ffff88003a600340 0000000000000000 0000000100000001 [ 24.769862] raw: ffffea0000ee0820 ffff88003e801c50 ffff88003e802200 0000000000000000 [ 24.770491] page dumped because: kasan: bad access detected [ 24.770892] [ 24.771041] Memory state around the buggy address: [ 24.771390] ffff88003a603600: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 24.771939] ffff88003a603680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 24.772520] >ffff88003a603700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 24.773063] ^ [ 24.773495] ffff88003a603780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 24.774066] ffff88003a603800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 24.774633] ================================================================== [ 24.775201] Disabling lock debugging due to kernel taint [ 24.775595] Kernel panic - not syncing: panic_on_warn set ... [ 24.775595] [ 24.776150] CPU: 1 PID: 2985 Comm: syzkaller103110 Tainted: G B 4.13.0-rc7-next-20170829+ #11 [ 24.776816] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS Bochs 01/01/2011 [ 24.777396] Call Trace: [ 24.777602] dump_stack+0x194/0x257 [ 24.777882] ? arch_local_irq_restore+0x53/0x53 [ 24.778259] ? vprintk_default+0x28/0x30 [ 24.778667] ? detach_if_pending+0x4b0/0x610 [ 24.779040] panic+0x1e4/0x41c [ 24.779275] ? refcount_error_report+0x214/0x214 [ 24.779625] ? detach_if_pending+0x557/0x610 [ 24.779931] kasan_end_report+0x50/0x50 [ 24.780244] kasan_report+0x137/0x340 [ 24.780537] __asan_report_store8_noabort+0x17/0x20 [ 24.780885] detach_if_pending+0x557/0x610 [ 24.781186] ? trace_raw_output_tick_stop+0x130/0x130 [ 24.781573] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 24.781922] ? lock_timer_base+0x1a3/0x2b0 [ 24.782228] ? lock_timer_base+0x1eb/0x2b0 [ 24.782549] ? __internal_add_timer+0x2d0/0x2d0 [ 24.782876] ? trace_hardirqs_on+0xd/0x10 [ 24.783184] try_to_del_timer_sync+0xa2/0x120 [ 24.783500] ? del_timer+0x130/0x130 [ 24.783784] ? del_timer_sync+0xeb/0x240 [ 24.784080] del_timer_sync+0x18a/0x240 [ 24.784360] tun_free_netdev+0x105/0x1b0 [ 24.784671] ? tun_xdp+0x410/0x410 [ 24.784919] ? cpumask_next+0x24/0x30 [ 24.785193] ? netdev_refcnt_read+0xed/0x150 [ 24.785530] ? tun_xdp+0x410/0x410 [ 24.785775] netdev_run_todo+0x870/0xca0 [ 24.786093] ? do_group_exit+0x149/0x400 [ 24.786404] ? register_netdev+0x30/0x30 [ 24.786697] ? lock_downgrade+0x990/0x990 [ 24.786987] ? trace_hardirqs_on+0xd/0x10 [ 24.787293] ? refcount_sub_and_test+0x115/0x1b0 [ 24.787620] ? refcount_inc+0x50/0x50 [ 24.787886] ? refcount_inc+0x50/0x50 [ 24.788161] ? sk_destruct+0x4c/0x80 [ 24.788417] ? __sk_free+0x5c/0x230 [ 24.788694] ? sk_free+0x2f/0x40 [ 24.788928] ? __tun_detach+0x176/0x1390 [ 24.789282] ? tun_attach+0xf90/0xf90 [ 24.789648] ? do_raw_spin_trylock+0x190/0x190 [ 24.790093] ? locks_remove_file+0x3fa/0x5a0 [ 24.790527] ? fcntl_setlk+0x10d0/0x10d0 [ 24.791177] ? __fsnotify_parent+0xb4/0x3a0 [ 24.791554] ? fsnotify+0x1af0/0x1af0 [ 24.791865] ? rcu_note_context_switch+0x710/0x710 [ 24.792285] ? __tun_detach+0x1390/0x1390 [ 24.792653] ? __tun_detach+0x1390/0x1390 [ 24.793024] rtnl_unlock+0xe/0x10 [ 24.793332] tun_chr_close+0x49/0x60 [ 24.793661] __fput+0x333/0x7f0 [ 24.793956] ? fput+0x140/0x140 [ 24.794248] ? check_same_owner+0x320/0x320 [ 24.794621] ? _raw_spin_unlock_irq+0x27/0x70 [ 24.795117] ____fput+0x15/0x20 [ 24.795411] task_work_run+0x199/0x270 [ 24.795754] ? task_work_cancel+0x210/0x210 [ 24.796227] ? _raw_spin_unlock+0x22/0x30 [ 24.796730] ? switch_task_namespaces+0x87/0xc0 [ 24.797208] do_exit+0xa52/0x1b40 [ 24.797538] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 24.797957] ? check_noncircular+0x20/0x20 [ 24.798375] ? __handle_mm_fault+0x587/0x39c0 [ 24.798828] ? mm_update_next_owner+0x930/0x930 [ 24.799265] ? __pmd_alloc+0x4e0/0x4e0 [ 24.799691] ? find_held_lock+0x39/0x1d0 [ 24.800103] ? lock_downgrade+0x990/0x990 [ 24.800493] ? handle_mm_fault+0x4a2/0x860 [ 24.800925] ? down_read_trylock+0xdb/0x170 [ 24.801363] ? __handle_mm_fault+0x39c0/0x39c0 [ 24.801848] ? vmacache_find+0x61/0x270 [ 24.802279] ? up_read+0x1a/0x40 [ 24.802659] ? __do_page_fault+0x35b/0xb60 [ 24.803120] ? trace_do_page_fault+0x141/0x730 [ 24.803577] ? do_page_fault+0x70/0x70 [ 24.804002] ? iterate_fd+0x3f0/0x3f0 [ 24.804410] ? putname+0xf3/0x130 [ 24.804790] do_group_exit+0x149/0x400 [ 24.805224] ? lockdep_sys_exit+0x1c4/0x2b0 [ 24.805671] ? SyS_exit+0x30/0x30 [ 24.805988] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 24.806525] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 24.806984] SyS_exit_group+0x1d/0x20 [ 24.807386] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 24.807823] RIP: 0033:0x438819 [ 24.808121] RSP: 002b:00007ffc655db508 EFLAGS: 00000246 ORIG_RAX: 00000000000000e7 [ 24.808889] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 0000000000438819 [ 24.809613] RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000 [ 24.810371] RBP: 0000000000000086 R08: 000000000000003c R09: 00000000000000e7 [ 24.811121] R10: ffffffffffffffc0 R11: 0000000000000246 R12: 0000000000000001 [ 24.812081] R13: 00000000006cd300 R14: 0000000000402310 R15: 0000000000000000 [ 24.812862] Dumping ftrace buffer: [ 24.813288] (ftrace buffer empty) [ 24.813645] Kernel Offset: disabled [ 24.814035] Rebooting in 86400 seconds..