net.ipv6.conf.syz0.accept_dad = 0 net.ipv6.conf.syz0.router_solicitations = 0 executing program syzkaller login: [ 27.216534] ================================================================== [ 27.217376] BUG: KASAN: use-after-free in detach_if_pending+0x557/0x610 [ 27.218081] Write of size 8 at addr ffff88003ba2b6c0 by task syzkaller944411/3003 [ 27.218865] [ 27.219048] CPU: 1 PID: 3003 Comm: syzkaller944411 Not tainted 4.13.0-next-20170905+ #15 [ 27.219886] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS Bochs 01/01/2011 [ 27.221037] Call Trace: [ 27.221325] dump_stack+0x194/0x257 [ 27.221722] ? arch_local_irq_restore+0x53/0x53 [ 27.222191] ? show_regs_print_info+0x65/0x65 [ 27.224439] ? lock_timer_base+0x1a3/0x2b0 [ 27.224738] ? detach_if_pending+0x557/0x610 [ 27.225073] print_address_description+0x73/0x250 [ 27.225491] ? detach_if_pending+0x557/0x610 [ 27.225880] kasan_report+0x24e/0x340 [ 27.226256] __asan_report_store8_noabort+0x17/0x20 [ 27.226776] detach_if_pending+0x557/0x610 [ 27.227208] ? trace_raw_output_tick_stop+0x130/0x130 [ 27.227681] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 27.228087] ? lock_timer_base+0x1a3/0x2b0 [ 27.245632] ? lock_timer_base+0x1eb/0x2b0 [ 27.246071] ? __internal_add_timer+0x2d0/0x2d0 [ 27.246551] ? trace_hardirqs_on+0xd/0x10 [ 27.246986] try_to_del_timer_sync+0xa2/0x120 [ 27.247507] ? del_timer+0x130/0x130 [ 27.247910] ? del_timer_sync+0xeb/0x240 [ 27.248401] del_timer_sync+0x18a/0x240 [ 27.248800] tun_free_netdev+0x105/0x1b0 [ 27.249254] ? tun_xdp+0x410/0x410 [ 27.249591] ? cpumask_next+0x24/0x30 [ 27.249959] ? netdev_refcnt_read+0xed/0x150 [ 27.250445] ? tun_xdp+0x410/0x410 [ 27.250879] netdev_run_todo+0x870/0xca0 [ 27.251296] ? do_group_exit+0x149/0x400 [ 27.251728] ? register_netdev+0x30/0x30 [ 27.252149] ? lock_downgrade+0x990/0x990 [ 27.252570] ? trace_hardirqs_on+0xd/0x10 [ 27.253025] ? refcount_sub_and_test+0x115/0x1b0 [ 27.264517] ? refcount_inc+0x50/0x50 [ 27.264797] ? refcount_inc+0x50/0x50 [ 27.265096] ? sk_destruct+0x4c/0x80 [ 27.265494] ? __sk_free+0x5c/0x230 [ 27.266566] ? sk_free+0x2f/0x40 [ 27.266896] ? __tun_detach+0x176/0x1390 [ 27.267309] ? tun_attach+0xf90/0xf90 [ 27.267854] ? locks_remove_file+0x3fa/0x5a0 [ 27.268367] ? fcntl_setlk+0x10d0/0x10d0 [ 27.268723] ? __fsnotify_parent+0xb4/0x3a0 [ 27.269095] ? fsnotify+0x1af0/0x1af0 [ 27.269493] ? __tun_detach+0x1390/0x1390 [ 27.269857] ? __tun_detach+0x1390/0x1390 [ 27.270210] rtnl_unlock+0xe/0x10 [ 27.270612] tun_chr_close+0x49/0x60 [ 27.270913] __fput+0x333/0x7f0 [ 27.271248] ? fput+0x140/0x140 [ 27.271518] ? check_same_owner+0x320/0x320 [ 27.271820] ____fput+0x15/0x20 [ 27.272060] task_work_run+0x199/0x270 [ 27.272470] ? task_work_cancel+0x210/0x210 [ 27.272953] ? free_nsproxy+0x185/0x1f0 [ 27.273474] ? switch_task_namespaces+0xa2/0xc0 [ 27.273941] do_exit+0xa52/0x1b40 [ 27.274423] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 27.274934] ? check_noncircular+0x20/0x20 [ 27.275451] ? __handle_mm_fault+0x587/0x39c0 [ 27.276070] ? mm_update_next_owner+0x930/0x930 [ 27.276680] ? __pmd_alloc+0x4e0/0x4e0 [ 27.277069] ? find_held_lock+0x39/0x1d0 [ 27.277552] ? lock_downgrade+0x990/0x990 [ 27.278001] ? handle_mm_fault+0x4a2/0x860 [ 27.278532] ? down_read_trylock+0xdb/0x170 [ 27.279130] ? __handle_mm_fault+0x39c0/0x39c0 [ 27.279678] ? vmacache_find+0x61/0x270 [ 27.280104] ? vmacache_update+0xfe/0x130 [ 27.280537] ? up_read+0x1a/0x40 [ 27.280806] ? __do_page_fault+0x35b/0xb60 [ 27.281285] ? do_page_fault+0xee/0x720 [ 27.281710] ? __do_page_fault+0xb60/0xb60 [ 27.282198] ? putname+0xf3/0x130 [ 27.282660] do_group_exit+0x149/0x400 [ 27.283112] ? lockdep_sys_exit+0x47/0xf0 [ 27.283583] ? SyS_exit+0x30/0x30 [ 27.283992] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 27.284589] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 27.285005] SyS_exit_group+0x1d/0x20 [ 27.285423] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 27.285789] RIP: 0033:0x43a029 [ 27.286203] RSP: 002b:00007fff6d340f18 EFLAGS: 00000202 ORIG_RAX: 00000000000000e7 [ 27.288721] RAX: ffffffffffffffda RBX: 00007fff6d341030 RCX: 000000000043a029 [ 27.289575] RDX: 000000000043a029 RSI: 0000000020000fd8 RDI: 0000000000000001 [ 27.290409] RBP: 0000000000000082 R08: 0000000000000000 R09: 00007fff6d341030 [ 27.291286] R10: 00000000000000fd R11: 0000000000000202 R12: 0000000000000000 [ 27.292231] R13: 0000000000402360 R14: 00000000004023f0 R15: 0000000000000000 [ 27.296119] [ 27.296361] Allocated by task 3003: [ 27.296800] save_stack_trace+0x16/0x20 [ 27.297216] save_stack+0x43/0xd0 [ 27.297652] kasan_kmalloc+0xad/0xe0 [ 27.298032] __kmalloc_node+0x47/0x70 [ 27.298463] kvmalloc_node+0x64/0xd0 [ 27.298860] alloc_netdev_mqs+0x16e/0xed0 [ 27.299357] __tun_chr_ioctl+0x12be/0x3d20 [ 27.299773] tun_chr_ioctl+0x2a/0x40 [ 27.300129] do_vfs_ioctl+0x1b1/0x1530 [ 27.300495] SyS_ioctl+0x8f/0xc0 [ 27.300725] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 27.301057] [ 27.301224] Freed by task 3003: [ 27.301536] save_stack_trace+0x16/0x20 [ 27.301875] save_stack+0x43/0xd0 [ 27.302164] kasan_slab_free+0x71/0xc0 [ 27.302453] kfree+0xca/0x250 [ 27.302738] kvfree+0x36/0x60 [ 27.302952] free_netdev+0x2cf/0x360 [ 27.303336] __tun_chr_ioctl+0x2cf6/0x3d20 [ 27.303778] tun_chr_ioctl+0x2a/0x40 [ 27.304086] do_vfs_ioctl+0x1b1/0x1530 [ 27.304485] SyS_ioctl+0x8f/0xc0 [ 27.304752] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 27.305167] [ 27.305309] The buggy address belongs to the object at ffff88003ba282c0 [ 27.305309] which belongs to the cache kmalloc-16384 of size 16384 [ 27.306378] The buggy address is located 13312 bytes inside of [ 27.306378] 16384-byte region [ffff88003ba282c0, ffff88003ba2c2c0) [ 27.307301] The buggy address belongs to the page: [ 27.307717] page:ffffea0000ee8a00 count:1 mapcount:0 mapping:ffff88003ba282c0 index:0x0 compound_mapcount: 0 [ 27.309455] flags: 0x100000000008100(slab|head) [ 27.309838] raw: 0100000000008100 ffff88003ba282c0 0000000000000000 0000000100000001 [ 27.310445] raw: ffffea0000f02220 ffff88003e801c50 ffff88003e802200 0000000000000000 [ 27.311105] page dumped because: kasan: bad access detected [ 27.311590] [ 27.311722] Memory state around the buggy address: [ 27.312133] ffff88003ba2b580: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 27.312791] ffff88003ba2b600: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 27.313355] >ffff88003ba2b680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 27.313917] ^ [ 27.314486] ffff88003ba2b700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 27.315104] ffff88003ba2b780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 27.315778] ================================================================== [ 27.316386] Disabling lock debugging due to kernel taint [ 27.316801] Kernel panic - not syncing: panic_on_warn set ... [ 27.316801] [ 27.317497] CPU: 1 PID: 3003 Comm: syzkaller944411 Tainted: G B 4.13.0-next-20170905+ #15 [ 27.318400] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS Bochs 01/01/2011 [ 27.319199] Call Trace: [ 27.319429] dump_stack+0x194/0x257 [ 27.319763] ? arch_local_irq_restore+0x53/0x53 [ 27.320227] ? vprintk_default+0x28/0x30 [ 27.320619] ? detach_if_pending+0x530/0x610 [ 27.321052] panic+0x1e4/0x417 [ 27.321352] ? __warn+0x1d9/0x1d9 [ 27.321689] ? detach_if_pending+0x557/0x610 [ 27.322083] kasan_end_report+0x50/0x50 [ 27.322410] kasan_report+0x137/0x340 [ 27.322691] __asan_report_store8_noabort+0x17/0x20 [ 27.323058] detach_if_pending+0x557/0x610 [ 27.323367] ? trace_raw_output_tick_stop+0x130/0x130 [ 27.323726] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 27.324054] ? lock_timer_base+0x1a3/0x2b0 [ 27.324479] ? lock_timer_base+0x1eb/0x2b0 [ 27.324855] ? __internal_add_timer+0x2d0/0x2d0 [ 27.325222] ? trace_hardirqs_on+0xd/0x10 [ 27.325597] try_to_del_timer_sync+0xa2/0x120 [ 27.325930] ? del_timer+0x130/0x130 [ 27.326203] ? del_timer_sync+0xeb/0x240 [ 27.326540] del_timer_sync+0x18a/0x240 [ 27.326852] tun_free_netdev+0x105/0x1b0 [ 27.327175] ? tun_xdp+0x410/0x410 [ 27.327477] ? cpumask_next+0x24/0x30 [ 27.327769] ? netdev_refcnt_read+0xed/0x150 [ 27.328267] ? tun_xdp+0x410/0x410 [ 27.328666] netdev_run_todo+0x870/0xca0 [ 27.330024] ? do_group_exit+0x149/0x400 [ 27.330369] ? register_netdev+0x30/0x30 [ 27.330961] ? lock_downgrade+0x990/0x990 [ 27.331303] ? trace_hardirqs_on+0xd/0x10 [ 27.331619] ? refcount_sub_and_test+0x115/0x1b0 [ 27.331961] ? refcount_inc+0x50/0x50 [ 27.332329] ? refcount_inc+0x50/0x50 [ 27.332669] ? sk_destruct+0x4c/0x80 [ 27.332976] ? __sk_free+0x5c/0x230 [ 27.333239] ? sk_free+0x2f/0x40 [ 27.333505] ? __tun_detach+0x176/0x1390 [ 27.333819] ? tun_attach+0xf90/0xf90 [ 27.334087] ? locks_remove_file+0x3fa/0x5a0 [ 27.334390] ? fcntl_setlk+0x10d0/0x10d0 [ 27.334669] ? __fsnotify_parent+0xb4/0x3a0 [ 27.334978] ? fsnotify+0x1af0/0x1af0 [ 27.335243] ? __tun_detach+0x1390/0x1390 [ 27.335659] ? __tun_detach+0x1390/0x1390 [ 27.336073] rtnl_unlock+0xe/0x10 [ 27.336411] tun_chr_close+0x49/0x60 [ 27.336799] __fput+0x333/0x7f0 [ 27.337126] ? fput+0x140/0x140 [ 27.337454] ? check_same_owner+0x320/0x320 [ 27.337843] ____fput+0x15/0x20 [ 27.338081] task_work_run+0x199/0x270 [ 27.338400] ? task_work_cancel+0x210/0x210 [ 27.338819] ? free_nsproxy+0x185/0x1f0 [ 27.339129] ? switch_task_namespaces+0xa2/0xc0 [ 27.339472] do_exit+0xa52/0x1b40 [ 27.339745] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 27.340142] ? check_noncircular+0x20/0x20 [ 27.340692] ? __handle_mm_fault+0x587/0x39c0 [ 27.341107] ? mm_update_next_owner+0x930/0x930 [ 27.341540] ? __pmd_alloc+0x4e0/0x4e0 [ 27.341905] ? find_held_lock+0x39/0x1d0 [ 27.342289] ? lock_downgrade+0x990/0x990 [ 27.342685] ? handle_mm_fault+0x4a2/0x860 [ 27.343072] ? down_read_trylock+0xdb/0x170 [ 27.343397] ? __handle_mm_fault+0x39c0/0x39c0 [ 27.343671] ? vmacache_find+0x61/0x270 [ 27.344015] ? vmacache_update+0xfe/0x130 [ 27.344406] ? up_read+0x1a/0x40 [ 27.344708] ? __do_page_fault+0x35b/0xb60 [ 27.345091] ? do_page_fault+0xee/0x720 [ 27.345449] ? __do_page_fault+0xb60/0xb60 [ 27.345827] ? putname+0xf3/0x130 [ 27.346145] do_group_exit+0x149/0x400 [ 27.346504] ? lockdep_sys_exit+0x47/0xf0 [ 27.346886] ? SyS_exit+0x30/0x30 [ 27.347207] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 27.347671] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 27.348114] SyS_exit_group+0x1d/0x20 [ 27.348476] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 27.348914] RIP: 0033:0x43a029 [ 27.349206] RSP: 002b:00007fff6d340f18 EFLAGS: 00000202 ORIG_RAX: 00000000000000e7 [ 27.349835] RAX: ffffffffffffffda RBX: 00007fff6d341030 RCX: 000000000043a029 [ 27.350299] RDX: 000000000043a029 RSI: 0000000020000fd8 RDI: 0000000000000001 [ 27.352131] RBP: 0000000000000082 R08: 0000000000000000 R09: 00007fff6d341030 [ 27.352617] R10: 00000000000000fd R11: 0000000000000202 R12: 0000000000000000 [ 27.353068] R13: 0000000000402360 R14: 00000000004023f0 R15: 0000000000000000 [ 27.353687] Dumping ftrace buffer: [ 27.353983] (ftrace buffer empty) [ 27.354294] Kernel Offset: disabled [ 27.354601] Rebooting in 86400 seconds..