net.ipv6.conf.syz0.accept_dad = 0 net.ipv6.conf.syz0.router_solicitations = 0 executing program syzkaller login: [ 24.105451] ================================================================== [ 24.106218] BUG: KASAN: use-after-free in detach_if_pending+0x557/0x610 [ 24.106916] Write of size 8 at addr ffff88003c02b6c0 by task syzkaller884381/2972 [ 24.107494] [ 24.107616] CPU: 0 PID: 2972 Comm: syzkaller884381 Not tainted 4.13.0-next-20170907+ #17 [ 24.108200] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS Bochs 01/01/2011 [ 24.108760] Call Trace: [ 24.108958] dump_stack+0x194/0x257 [ 24.109299] ? arch_local_irq_restore+0x53/0x53 [ 24.109731] ? show_regs_print_info+0x65/0x65 [ 24.110167] ? lock_timer_base+0x1a3/0x2b0 [ 24.110561] ? detach_if_pending+0x557/0x610 [ 24.110969] print_address_description+0x73/0x250 [ 24.111420] ? detach_if_pending+0x557/0x610 [ 24.111833] kasan_report+0x24e/0x340 [ 24.112191] __asan_report_store8_noabort+0x17/0x20 [ 24.112655] detach_if_pending+0x557/0x610 [ 24.113051] ? trace_raw_output_tick_stop+0x130/0x130 [ 24.113538] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 24.113970] ? lock_timer_base+0x1a3/0x2b0 [ 24.114367] ? lock_timer_base+0x1eb/0x2b0 [ 24.114764] ? __internal_add_timer+0x2d0/0x2d0 [ 24.115202] ? trace_hardirqs_on+0xd/0x10 [ 24.115597] try_to_del_timer_sync+0xa2/0x120 [ 24.116016] ? del_timer+0x130/0x130 [ 24.116368] ? del_timer_sync+0xeb/0x240 [ 24.116790] del_timer_sync+0x18a/0x240 [ 24.117247] tun_free_netdev+0x105/0x1b0 [ 24.117638] ? tun_xdp+0x410/0x410 [ 24.117990] ? cpumask_next+0x24/0x30 [ 24.118420] ? netdev_refcnt_read+0xed/0x150 [ 24.118830] ? tun_xdp+0x410/0x410 [ 24.119153] netdev_run_todo+0x870/0xca0 [ 24.119537] ? do_group_exit+0x149/0x400 [ 24.119842] ? register_netdev+0x30/0x30 [ 24.121023] ? lock_downgrade+0x990/0x990 [ 24.121368] ? trace_hardirqs_on+0xd/0x10 [ 24.121670] ? refcount_sub_and_test+0x115/0x1b0 [ 24.122010] ? refcount_inc+0x50/0x50 [ 24.122341] ? refcount_inc+0x50/0x50 [ 24.122605] ? sk_destruct+0x4c/0x80 [ 24.122861] ? __sk_free+0x5c/0x230 [ 24.123155] ? sk_free+0x2f/0x40 [ 24.123461] ? __tun_detach+0x176/0x1390 [ 24.123841] ? tun_attach+0xf90/0xf90 [ 24.124199] ? do_raw_spin_trylock+0x190/0x190 [ 24.124623] ? locks_remove_file+0x3fa/0x5a0 [ 24.125032] ? fcntl_setlk+0x10d0/0x10d0 [ 24.125416] ? __fsnotify_parent+0xb4/0x3a0 [ 24.125821] ? fsnotify+0x1af0/0x1af0 [ 24.126181] ? __tun_detach+0x1390/0x1390 [ 24.126589] ? __tun_detach+0x1390/0x1390 [ 24.126981] rtnl_unlock+0xe/0x10 [ 24.127270] tun_chr_close+0x49/0x60 [ 24.127554] __fput+0x333/0x7f0 [ 24.127793] ? fput+0x140/0x140 [ 24.128049] ? check_same_owner+0x320/0x320 [ 24.128442] ? _raw_spin_unlock_irq+0x27/0x70 [ 24.128853] ____fput+0x15/0x20 [ 24.129153] task_work_run+0x199/0x270 [ 24.129516] ? task_work_cancel+0x210/0x210 [ 24.129962] ? _raw_spin_unlock+0x22/0x30 [ 24.130366] ? switch_task_namespaces+0x87/0xc0 [ 24.130792] do_exit+0xa52/0x1b40 [ 24.131106] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 24.131559] ? check_noncircular+0x20/0x20 [ 24.131944] ? __handle_mm_fault+0x587/0x39c0 [ 24.132353] ? mm_update_next_owner+0x930/0x930 [ 24.132773] ? __pmd_alloc+0x4e0/0x4e0 [ 24.133133] ? find_held_lock+0x39/0x1d0 [ 24.133518] ? lock_downgrade+0x990/0x990 [ 24.133912] ? handle_mm_fault+0x410/0x8d0 [ 24.134294] ? down_read_trylock+0xdb/0x170 [ 24.134684] ? __do_page_fault+0x2b8/0xb60 [ 24.135068] ? __handle_mm_fault+0x39c0/0x39c0 [ 24.135480] ? vmacache_find+0x61/0x270 [ 24.135846] ? up_read+0x1a/0x40 [ 24.136152] ? __do_page_fault+0x35b/0xb60 [ 24.136538] ? do_page_fault+0xee/0x720 [ 24.136902] ? __do_page_fault+0xb60/0xb60 [ 24.137296] ? putname+0xf3/0x130 [ 24.137618] do_group_exit+0x149/0x400 [ 24.137977] ? lockdep_sys_exit+0x47/0xf0 [ 24.138397] ? SyS_exit+0x30/0x30 [ 24.138758] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 24.139231] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 24.139591] SyS_exit_group+0x1d/0x20 [ 24.139863] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 24.140236] RIP: 0033:0x438d09 [ 24.140469] RSP: 002b:00007ffed9c04188 EFLAGS: 00000246 ORIG_RAX: 00000000000000e7 [ 24.141026] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 0000000000438d09 [ 24.142028] RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000 [ 24.142582] RBP: 0000000000000082 R08: 000000000000003c R09: 00000000000000e7 [ 24.143197] R10: ffffffffffffffcc R11: 0000000000000246 R12: 0000000000000001 [ 24.143732] R13: 00000000006cc300 R14: 0000000000402800 R15: 0000000000000000 [ 24.144331] [ 24.144465] Allocated by task 2972: [ 24.144784] save_stack_trace+0x16/0x20 [ 24.145072] save_stack+0x43/0xd0 [ 24.145342] kasan_kmalloc+0xad/0xe0 [ 24.145611] __kmalloc_node+0x47/0x70 [ 24.145890] kvmalloc_node+0x64/0xd0 [ 24.146162] alloc_netdev_mqs+0x16e/0xed0 [ 24.146463] __tun_chr_ioctl+0x12be/0x3d20 [ 24.146761] tun_chr_ioctl+0x2a/0x40 [ 24.147031] do_vfs_ioctl+0x1b1/0x1530 [ 24.147315] SyS_ioctl+0x8f/0xc0 [ 24.147562] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 24.147904] [ 24.148024] Freed by task 2972: [ 24.148264] save_stack_trace+0x16/0x20 [ 24.148556] save_stack+0x43/0xd0 [ 24.148808] kasan_slab_free+0x71/0xc0 [ 24.149086] kfree+0xca/0x250 [ 24.149316] kvfree+0x36/0x60 [ 24.149546] free_netdev+0x2cf/0x360 [ 24.149818] __tun_chr_ioctl+0x2cf6/0x3d20 [ 24.150159] tun_chr_ioctl+0x2a/0x40 [ 24.150493] do_vfs_ioctl+0x1b1/0x1530 [ 24.150852] SyS_ioctl+0x8f/0xc0 [ 24.151189] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 24.151702] [ 24.151855] The buggy address belongs to the object at ffff88003c0282c0 [ 24.151855] which belongs to the cache kmalloc-16384 of size 16384 [ 24.152971] The buggy address is located 13312 bytes inside of [ 24.152971] 16384-byte region [ffff88003c0282c0, ffff88003c02c2c0) [ 24.154149] The buggy address belongs to the page: [ 24.154633] page:ffffea0000f00a00 count:1 mapcount:0 mapping:ffff88003c0282c0 index:0x0 compound_mapcount: 0 [ 24.155592] flags: 0x100000000008100(slab|head) [ 24.156019] raw: 0100000000008100 ffff88003c0282c0 0000000000000000 0000000100000001 [ 24.156767] raw: ffffea0000e5a220 ffff88003e801c50 ffff88003e802200 0000000000000000 [ 24.157313] page dumped because: kasan: bad access detected [ 24.157702] [ 24.157819] Memory state around the buggy address: [ 24.158254] ffff88003c02b580: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 24.158922] ffff88003c02b600: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 24.159426] >ffff88003c02b680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 24.159933] ^ [ 24.160343] ffff88003c02b700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 24.160894] ffff88003c02b780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 24.161423] ================================================================== [ 24.161968] Disabling lock debugging due to kernel taint [ 24.162369] Kernel panic - not syncing: panic_on_warn set ... [ 24.162369] [ 24.163228] CPU: 0 PID: 2972 Comm: syzkaller884381 Tainted: G B 4.13.0-next-20170907+ #17 [ 24.163909] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS Bochs 01/01/2011 [ 24.164469] Call Trace: [ 24.164673] dump_stack+0x194/0x257 [ 24.164927] ? arch_local_irq_restore+0x53/0x53 [ 24.165295] ? vprintk_default+0x28/0x30 [ 24.165604] ? detach_if_pending+0x530/0x610 [ 24.165914] panic+0x1e4/0x417 [ 24.166137] ? __warn+0x1d9/0x1d9 [ 24.166382] ? detach_if_pending+0x557/0x610 [ 24.166690] kasan_end_report+0x50/0x50 [ 24.166970] kasan_report+0x137/0x340 [ 24.167276] __asan_report_store8_noabort+0x17/0x20 [ 24.167641] detach_if_pending+0x557/0x610 [ 24.167926] ? trace_raw_output_tick_stop+0x130/0x130 [ 24.168332] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 24.168740] ? lock_timer_base+0x1a3/0x2b0 [ 24.169048] ? lock_timer_base+0x1eb/0x2b0 [ 24.169344] ? __internal_add_timer+0x2d0/0x2d0 [ 24.169711] ? trace_hardirqs_on+0xd/0x10 [ 24.170041] try_to_del_timer_sync+0xa2/0x120 [ 24.170420] ? del_timer+0x130/0x130 [ 24.170679] ? del_timer_sync+0xeb/0x240 [ 24.170989] del_timer_sync+0x18a/0x240 [ 24.171304] tun_free_netdev+0x105/0x1b0 [ 24.171667] ? tun_xdp+0x410/0x410 [ 24.171926] ? cpumask_next+0x24/0x30 [ 24.172209] ? netdev_refcnt_read+0xed/0x150 [ 24.172556] ? tun_xdp+0x410/0x410 [ 24.172800] netdev_run_todo+0x870/0xca0 [ 24.173081] ? do_group_exit+0x149/0x400 [ 24.173368] ? register_netdev+0x30/0x30 [ 24.173658] ? lock_downgrade+0x990/0x990 [ 24.173936] ? trace_hardirqs_on+0xd/0x10 [ 24.174283] ? refcount_sub_and_test+0x115/0x1b0 [ 24.174691] ? refcount_inc+0x50/0x50 [ 24.174995] ? refcount_inc+0x50/0x50 [ 24.175286] ? sk_destruct+0x4c/0x80 [ 24.175541] ? __sk_free+0x5c/0x230 [ 24.175823] ? sk_free+0x2f/0x40 [ 24.176066] ? __tun_detach+0x176/0x1390 [ 24.176432] ? tun_attach+0xf90/0xf90 [ 24.176738] ? do_raw_spin_trylock+0x190/0x190 [ 24.177084] ? locks_remove_file+0x3fa/0x5a0 [ 24.177448] ? fcntl_setlk+0x10d0/0x10d0 [ 24.177848] ? __fsnotify_parent+0xb4/0x3a0 [ 24.178240] ? fsnotify+0x1af0/0x1af0 [ 24.178692] ? __tun_detach+0x1390/0x1390 [ 24.179109] ? __tun_detach+0x1390/0x1390 [ 24.179567] rtnl_unlock+0xe/0x10 [ 24.179919] tun_chr_close+0x49/0x60 [ 24.180283] __fput+0x333/0x7f0 [ 24.180631] ? fput+0x140/0x140 [ 24.180954] ? check_same_owner+0x320/0x320 [ 24.181389] ? _raw_spin_unlock_irq+0x27/0x70 [ 24.181879] ____fput+0x15/0x20 [ 24.182189] task_work_run+0x199/0x270 [ 24.182595] ? task_work_cancel+0x210/0x210 [ 24.182987] ? _raw_spin_unlock+0x22/0x30 [ 24.183270] ? switch_task_namespaces+0x87/0xc0 [ 24.183591] do_exit+0xa52/0x1b40 [ 24.183830] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 24.184561] ? check_noncircular+0x20/0x20 [ 24.184857] ? __handle_mm_fault+0x587/0x39c0 [ 24.185167] ? mm_update_next_owner+0x930/0x930 [ 24.185568] ? __pmd_alloc+0x4e0/0x4e0 [ 24.185894] ? find_held_lock+0x39/0x1d0 [ 24.186225] ? lock_downgrade+0x990/0x990 [ 24.186555] ? handle_mm_fault+0x410/0x8d0 [ 24.186849] ? down_read_trylock+0xdb/0x170 [ 24.187159] ? __do_page_fault+0x2b8/0xb60 [ 24.187477] ? __handle_mm_fault+0x39c0/0x39c0 [ 24.187791] ? vmacache_find+0x61/0x270 [ 24.188096] ? up_read+0x1a/0x40 [ 24.188436] ? __do_page_fault+0x35b/0xb60 [ 24.188784] ? do_page_fault+0xee/0x720 [ 24.189058] ? __do_page_fault+0xb60/0xb60 [ 24.189366] ? putname+0xf3/0x130 [ 24.189607] do_group_exit+0x149/0x400 [ 24.189887] ? lockdep_sys_exit+0x47/0xf0 [ 24.190213] ? SyS_exit+0x30/0x30 [ 24.190451] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 24.190795] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 24.191148] SyS_exit_group+0x1d/0x20 [ 24.191435] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 24.191801] RIP: 0033:0x438d09 [ 24.192060] RSP: 002b:00007ffed9c04188 EFLAGS: 00000246 ORIG_RAX: 00000000000000e7 [ 24.192642] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 0000000000438d09 [ 24.193200] RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000 [ 24.193696] RBP: 0000000000000082 R08: 000000000000003c R09: 00000000000000e7 [ 24.194188] R10: ffffffffffffffcc R11: 0000000000000246 R12: 0000000000000001 [ 24.194690] R13: 00000000006cc300 R14: 0000000000402800 R15: 0000000000000000 [ 24.195305] Dumping ftrace buffer: [ 24.195548] (ftrace buffer empty) [ 24.195801] Kernel Offset: disabled [ 24.196058] Rebooting in 86400 seconds..