net.ipv6.conf.syz0.accept_dad = 0 net.ipv6.conf.syz0.router_solicitations = 0 executing program syzkaller login: [ 26.266424] ================================================================== [ 26.267441] BUG: KASAN: use-after-free in detach_if_pending+0x557/0x610 [ 26.268297] Write of size 8 at addr ffff88003b83b7c0 by task syzkaller083359/2998 [ 26.269191] [ 26.269415] CPU: 0 PID: 2998 Comm: syzkaller083359 Not tainted 4.13.0-next-20170907+ #17 [ 26.270417] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS Bochs 01/01/2011 [ 26.271424] Call Trace: [ 26.271723] dump_stack+0x194/0x257 [ 26.272202] ? arch_local_irq_restore+0x53/0x53 [ 26.272760] ? show_regs_print_info+0x65/0x65 [ 26.273363] ? lock_timer_base+0x1a3/0x2b0 [ 26.273838] ? detach_if_pending+0x557/0x610 [ 26.274428] print_address_description+0x73/0x250 [ 26.275030] ? detach_if_pending+0x557/0x610 [ 26.275546] kasan_report+0x24e/0x340 [ 26.276041] __asan_report_store8_noabort+0x17/0x20 [ 26.276632] detach_if_pending+0x557/0x610 [ 26.277160] ? trace_raw_output_tick_stop+0x130/0x130 [ 26.277778] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 26.278413] ? lock_timer_base+0x1a3/0x2b0 [ 26.278910] ? lock_timer_base+0x1eb/0x2b0 [ 26.279451] ? __internal_add_timer+0x2d0/0x2d0 [ 26.279982] ? trace_hardirqs_on+0xd/0x10 [ 26.280432] try_to_del_timer_sync+0xa2/0x120 [ 26.280869] ? del_timer+0x130/0x130 [ 26.281307] ? del_timer_sync+0xeb/0x240 [ 26.281712] del_timer_sync+0x18a/0x240 [ 26.282172] tun_free_netdev+0x105/0x1b0 [ 26.282569] ? tun_xdp+0x410/0x410 [ 26.282914] ? cpumask_next+0x24/0x30 [ 26.283369] ? netdev_refcnt_read+0xed/0x150 [ 26.283819] ? tun_xdp+0x410/0x410 [ 26.284677] netdev_run_todo+0x870/0xca0 [ 26.286442] ? do_group_exit+0x149/0x400 [ 26.287308] ? register_netdev+0x30/0x30 [ 26.288193] ? lock_downgrade+0x990/0x990 [ 26.289095] ? trace_hardirqs_on+0xd/0x10 [ 26.289958] ? refcount_sub_and_test+0x115/0x1b0 [ 26.291122] ? refcount_inc+0x50/0x50 [ 26.291906] ? refcount_inc+0x50/0x50 [ 26.292721] ? sk_destruct+0x4c/0x80 [ 26.293569] ? __sk_free+0x5c/0x230 [ 26.295976] ? sk_free+0x2f/0x40 [ 26.296448] ? __tun_detach+0x176/0x1390 [ 26.297508] ? tun_attach+0xf90/0xf90 [ 26.299464] ? do_raw_spin_trylock+0x190/0x190 [ 26.301203] ? locks_remove_file+0x3fa/0x5a0 [ 26.302132] ? fcntl_setlk+0x10d0/0x10d0 [ 26.303854] ? __fsnotify_parent+0xb4/0x3a0 [ 26.305486] ? fsnotify+0x1af0/0x1af0 [ 26.306867] ? __tun_detach+0x1390/0x1390 [ 26.307344] ? __tun_detach+0x1390/0x1390 [ 26.307882] rtnl_unlock+0xe/0x10 [ 26.308276] tun_chr_close+0x49/0x60 [ 26.308778] __fput+0x333/0x7f0 [ 26.309163] ? fput+0x140/0x140 [ 26.309522] ? check_same_owner+0x320/0x320 [ 26.310089] ? _raw_spin_unlock_irq+0x27/0x70 [ 26.310518] ____fput+0x15/0x20 [ 26.310867] task_work_run+0x199/0x270 [ 26.311284] ? task_work_cancel+0x210/0x210 [ 26.311722] ? _raw_spin_unlock+0x22/0x30 [ 26.312122] ? switch_task_namespaces+0x87/0xc0 [ 26.312568] do_exit+0xa52/0x1b40 [ 26.313054] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 26.313537] ? check_noncircular+0x20/0x20 [ 26.313990] ? __handle_mm_fault+0x587/0x39c0 [ 26.314421] ? mm_update_next_owner+0x930/0x930 [ 26.314896] ? __pmd_alloc+0x4e0/0x4e0 [ 26.315279] ? find_held_lock+0x39/0x1d0 [ 26.315665] ? lock_downgrade+0x990/0x990 [ 26.316099] ? handle_mm_fault+0x410/0x8d0 [ 26.316580] ? down_read_trylock+0xdb/0x170 [ 26.317251] ? __do_page_fault+0x2b8/0xb60 [ 26.317666] ? __handle_mm_fault+0x39c0/0x39c0 [ 26.318136] ? vmacache_find+0x61/0x270 [ 26.318611] ? up_read+0x1a/0x40 [ 26.319007] ? __do_page_fault+0x35b/0xb60 [ 26.319481] ? do_page_fault+0xee/0x720 [ 26.319908] ? __do_page_fault+0xb60/0xb60 [ 26.320330] ? putname+0xf3/0x130 [ 26.320718] do_group_exit+0x149/0x400 [ 26.321448] ? lockdep_sys_exit+0x47/0xf0 [ 26.322233] ? SyS_exit+0x30/0x30 [ 26.322887] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 26.323692] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 26.324276] SyS_exit_group+0x1d/0x20 [ 26.324675] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 26.325304] RIP: 0033:0x438849 [ 26.325746] RSP: 002b:00007ffe6bfa2a58 EFLAGS: 00000246 ORIG_RAX: 00000000000000e7 [ 26.328153] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 0000000000438849 [ 26.329683] RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000 [ 26.331111] RBP: 0000000000000082 R08: 000000000000003c R09: 00000000000000e7 [ 26.332507] R10: ffffffffffffffc0 R11: 0000000000000246 R12: 0000000000000001 [ 26.333934] R13: 00000000006cd300 R14: 0000000000402340 R15: 0000000000000000 [ 26.335458] [ 26.335636] Allocated by task 2998: [ 26.336094] save_stack_trace+0x16/0x20 [ 26.336494] save_stack+0x43/0xd0 [ 26.336896] kasan_kmalloc+0xad/0xe0 [ 26.337272] __kmalloc_node+0x47/0x70 [ 26.337658] kvmalloc_node+0x64/0xd0 [ 26.338073] alloc_netdev_mqs+0x16e/0xed0 [ 26.338489] __tun_chr_ioctl+0x12be/0x3d20 [ 26.338993] tun_chr_ioctl+0x2a/0x40 [ 26.339370] do_vfs_ioctl+0x1b1/0x1530 [ 26.339852] SyS_ioctl+0x8f/0xc0 [ 26.340218] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 26.340892] [ 26.341061] Freed by task 2998: [ 26.341295] save_stack_trace+0x16/0x20 [ 26.341554] save_stack+0x43/0xd0 [ 26.341829] kasan_slab_free+0x71/0xc0 [ 26.342082] kfree+0xca/0x250 [ 26.342288] kvfree+0x36/0x60 [ 26.342679] free_netdev+0x2cf/0x360 [ 26.343418] __tun_chr_ioctl+0x2cf6/0x3d20 [ 26.344279] tun_chr_ioctl+0x2a/0x40 [ 26.345074] do_vfs_ioctl+0x1b1/0x1530 [ 26.345905] SyS_ioctl+0x8f/0xc0 [ 26.346598] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 26.347303] [ 26.347484] The buggy address belongs to the object at ffff88003b8383c0 [ 26.347484] which belongs to the cache kmalloc-16384 of size 16384 [ 26.350380] The buggy address is located 13312 bytes inside of [ 26.350380] 16384-byte region [ffff88003b8383c0, ffff88003b83c3c0) [ 26.351963] The buggy address belongs to the page: [ 26.352562] page:ffffea0000ee0e00 count:1 mapcount:0 mapping:ffff88003b8383c0 index:0x0 compound_mapcount: 0 [ 26.353896] flags: 0x100000000008100(slab|head) [ 26.354474] raw: 0100000000008100 ffff88003b8383c0 0000000000000000 0000000100000001 [ 26.355412] raw: ffffea0000ef9e20 ffff88003e801c50 ffff88003e802200 0000000000000000 [ 26.356241] page dumped because: kasan: bad access detected [ 26.356860] [ 26.357021] Memory state around the buggy address: [ 26.357544] ffff88003b83b680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 26.358383] ffff88003b83b700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 26.359141] >ffff88003b83b780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 26.359912] ^ [ 26.360464] ffff88003b83b800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 26.361256] ffff88003b83b880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 26.361997] ================================================================== [ 26.362577] Disabling lock debugging due to kernel taint [ 26.363254] Kernel panic - not syncing: panic_on_warn set ... [ 26.363254] [ 26.364279] CPU: 0 PID: 2998 Comm: syzkaller083359 Tainted: G B 4.13.0-next-20170907+ #17 [ 26.365287] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS Bochs 01/01/2011 [ 26.366158] Call Trace: [ 26.366421] dump_stack+0x194/0x257 [ 26.366827] ? arch_local_irq_restore+0x53/0x53 [ 26.367290] ? vprintk_default+0x28/0x30 [ 26.367867] ? detach_if_pending+0x530/0x610 [ 26.368327] panic+0x1e4/0x417 [ 26.368650] ? __warn+0x1d9/0x1d9 [ 26.369039] ? detach_if_pending+0x557/0x610 [ 26.369475] kasan_end_report+0x50/0x50 [ 26.369889] kasan_report+0x137/0x340 [ 26.371923] __asan_report_store8_noabort+0x17/0x20 [ 26.372419] detach_if_pending+0x557/0x610 [ 26.372910] ? trace_raw_output_tick_stop+0x130/0x130 [ 26.373445] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 26.373969] ? lock_timer_base+0x1a3/0x2b0 [ 26.374399] ? lock_timer_base+0x1eb/0x2b0 [ 26.374881] ? __internal_add_timer+0x2d0/0x2d0 [ 26.375360] ? trace_hardirqs_on+0xd/0x10 [ 26.375850] try_to_del_timer_sync+0xa2/0x120 [ 26.376310] ? del_timer+0x130/0x130 [ 26.376744] ? del_timer_sync+0xeb/0x240 [ 26.377161] del_timer_sync+0x18a/0x240 [ 26.377600] tun_free_netdev+0x105/0x1b0 [ 26.378033] ? tun_xdp+0x410/0x410 [ 26.378393] ? cpumask_next+0x24/0x30 [ 26.378831] ? netdev_refcnt_read+0xed/0x150 [ 26.379283] ? tun_xdp+0x410/0x410 [ 26.379699] netdev_run_todo+0x870/0xca0 [ 26.380212] ? do_group_exit+0x149/0x400 [ 26.380642] ? register_netdev+0x30/0x30 [ 26.381065] ? lock_downgrade+0x990/0x990 [ 26.381482] ? trace_hardirqs_on+0xd/0x10 [ 26.381988] ? refcount_sub_and_test+0x115/0x1b0 [ 26.382368] ? refcount_inc+0x50/0x50 [ 26.382695] ? refcount_inc+0x50/0x50 [ 26.382973] ? sk_destruct+0x4c/0x80 [ 26.383283] ? __sk_free+0x5c/0x230 [ 26.383549] ? sk_free+0x2f/0x40 [ 26.383856] ? __tun_detach+0x176/0x1390 [ 26.384277] ? tun_attach+0xf90/0xf90 [ 26.385027] ? do_raw_spin_trylock+0x190/0x190 [ 26.385829] ? locks_remove_file+0x3fa/0x5a0 [ 26.386263] ? fcntl_setlk+0x10d0/0x10d0 [ 26.386695] ? __fsnotify_parent+0xb4/0x3a0 [ 26.387127] ? fsnotify+0x1af0/0x1af0 [ 26.387503] ? __tun_detach+0x1390/0x1390 [ 26.387972] ? __tun_detach+0x1390/0x1390 [ 26.388378] rtnl_unlock+0xe/0x10 [ 26.388800] tun_chr_close+0x49/0x60 [ 26.389169] __fput+0x333/0x7f0 [ 26.389495] ? fput+0x140/0x140 [ 26.389859] ? check_same_owner+0x320/0x320 [ 26.390282] ? _raw_spin_unlock_irq+0x27/0x70 [ 26.390743] ____fput+0x15/0x20 [ 26.391075] task_work_run+0x199/0x270 [ 26.392340] ? task_work_cancel+0x210/0x210 [ 26.392780] ? _raw_spin_unlock+0x22/0x30 [ 26.393208] ? switch_task_namespaces+0x87/0xc0 [ 26.393669] do_exit+0xa52/0x1b40 [ 26.394016] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 26.394538] ? check_noncircular+0x20/0x20 [ 26.395016] ? __handle_mm_fault+0x587/0x39c0 [ 26.395513] ? mm_update_next_owner+0x930/0x930 [ 26.396032] ? __pmd_alloc+0x4e0/0x4e0 [ 26.396471] ? find_held_lock+0x39/0x1d0 [ 26.396929] ? lock_downgrade+0x990/0x990 [ 26.397398] ? handle_mm_fault+0x410/0x8d0 [ 26.398107] ? down_read_trylock+0xdb/0x170 [ 26.398578] ? __do_page_fault+0x2b8/0xb60 [ 26.399083] ? __handle_mm_fault+0x39c0/0x39c0 [ 26.399591] ? vmacache_find+0x61/0x270 [ 26.400026] ? up_read+0x1a/0x40 [ 26.400245] ? __do_page_fault+0x35b/0xb60 [ 26.400533] ? do_page_fault+0xee/0x720 [ 26.400824] ? __do_page_fault+0xb60/0xb60 [ 26.401098] ? putname+0xf3/0x130 [ 26.401336] do_group_exit+0x149/0x400 [ 26.401586] ? lockdep_sys_exit+0x47/0xf0 [ 26.401879] ? SyS_exit+0x30/0x30 [ 26.402102] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 26.402436] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 26.402771] SyS_exit_group+0x1d/0x20 [ 26.403022] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 26.403347] RIP: 0033:0x438849 [ 26.403555] RSP: 002b:00007ffe6bfa2a58 EFLAGS: 00000246 ORIG_RAX: 00000000000000e7 [ 26.404090] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 0000000000438849 [ 26.404565] RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000 [ 26.405288] RBP: 0000000000000082 R08: 000000000000003c R09: 00000000000000e7 [ 26.408018] R10: ffffffffffffffc0 R11: 0000000000000246 R12: 0000000000000001 [ 26.409430] R13: 00000000006cd300 R14: 0000000000402340 R15: 0000000000000000 [ 26.411985] Dumping ftrace buffer: [ 26.413303] (ftrace buffer empty) [ 26.413830] Kernel Offset: disabled [ 26.414362] Rebooting in 86400 seconds..