net.ipv6.conf.syz0.accept_dad = 0 net.ipv6.conf.syz0.router_solicitations = 0 executing program syzkaller login: [ 22.684732] ================================================================== [ 22.685604] BUG: KASAN: use-after-free in detach_if_pending+0x557/0x610 [ 22.686327] Write of size 8 at addr ffff88003bc336c0 by task syzkaller455543/2974 [ 22.687150] [ 22.687344] CPU: 0 PID: 2974 Comm: syzkaller455543 Not tainted 4.13.0-next-20170911+ #1 [ 22.688234] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS Bochs 01/01/2011 [ 22.689144] Call Trace: [ 22.689446] dump_stack+0x194/0x257 [ 22.689858] ? arch_local_irq_restore+0x53/0x53 [ 22.690392] ? show_regs_print_info+0x65/0x65 [ 22.690891] ? lock_timer_base+0x1a3/0x2b0 [ 22.691372] ? detach_if_pending+0x557/0x610 [ 22.691857] print_address_description+0x73/0x250 [ 22.700219] ? detach_if_pending+0x557/0x610 [ 22.700625] kasan_report+0x24e/0x340 [ 22.702020] __asan_report_store8_noabort+0x17/0x20 [ 22.702539] detach_if_pending+0x557/0x610 [ 22.704031] ? trace_raw_output_tick_stop+0x130/0x130 [ 22.704570] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 22.706149] ? lock_timer_base+0x1a3/0x2b0 [ 22.706590] ? lock_timer_base+0x1eb/0x2b0 [ 22.708133] ? __internal_add_timer+0x2d0/0x2d0 [ 22.708620] ? trace_hardirqs_on+0xd/0x10 [ 22.709226] try_to_del_timer_sync+0xa2/0x120 [ 22.709663] ? del_timer+0x130/0x130 [ 22.710052] ? del_timer_sync+0xeb/0x240 [ 22.710458] del_timer_sync+0x18a/0x240 [ 22.710840] tun_free_netdev+0x105/0x1b0 [ 22.711257] ? tun_xdp+0x410/0x410 [ 22.711592] ? cpumask_next+0x24/0x30 [ 22.711958] ? netdev_refcnt_read+0xed/0x150 [ 22.712407] ? tun_xdp+0x410/0x410 [ 22.712741] netdev_run_todo+0x870/0xca0 [ 22.713104] ? do_group_exit+0x149/0x400 [ 22.715043] ? register_netdev+0x30/0x30 [ 22.715661] ? lock_downgrade+0x990/0x990 [ 22.717501] ? trace_hardirqs_on+0xd/0x10 [ 22.718108] ? refcount_sub_and_test+0x115/0x1b0 [ 22.719399] ? refcount_inc+0x50/0x50 [ 22.719928] ? refcount_inc+0x50/0x50 [ 22.720494] ? sk_destruct+0x4c/0x80 [ 22.721020] ? __sk_free+0x5c/0x230 [ 22.722233] ? sk_free+0x2f/0x40 [ 22.727238] ? __tun_detach+0x176/0x1390 [ 22.728684] ? tun_attach+0xf90/0xf90 [ 22.732637] ? do_raw_spin_trylock+0x190/0x190 [ 22.736223] ? locks_remove_file+0x3fa/0x5a0 [ 22.736995] ? fcntl_setlk+0x10d0/0x10d0 [ 22.737742] ? __fsnotify_parent+0xb4/0x3a0 [ 22.738575] ? fsnotify+0x1af0/0x1af0 [ 22.739297] ? __tun_detach+0x1390/0x1390 [ 22.739924] ? __tun_detach+0x1390/0x1390 [ 22.740327] rtnl_unlock+0xe/0x10 [ 22.740653] tun_chr_close+0x49/0x60 [ 22.741001] __fput+0x333/0x7f0 [ 22.741313] ? fput+0x140/0x140 [ 22.743196] ? check_same_owner+0x320/0x320 [ 22.743644] ? _raw_spin_unlock_irq+0x27/0x70 [ 22.744118] ____fput+0x15/0x20 [ 22.744462] task_work_run+0x199/0x270 [ 22.744867] ? task_work_cancel+0x210/0x210 [ 22.745314] ? _raw_spin_unlock+0x22/0x30 [ 22.745757] ? switch_task_namespaces+0x87/0xc0 [ 22.746250] do_exit+0xa52/0x1b40 [ 22.746611] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 22.747130] ? check_noncircular+0x20/0x20 [ 22.750806] ? __handle_mm_fault+0x587/0x39c0 [ 22.751731] ? mm_update_next_owner+0x930/0x930 [ 22.752591] ? __pmd_alloc+0x4e0/0x4e0 [ 22.753250] ? find_held_lock+0x39/0x1d0 [ 22.754012] ? lock_downgrade+0x990/0x990 [ 22.764738] ? handle_mm_fault+0x410/0x8d0 [ 22.765607] ? down_read_trylock+0xdb/0x170 [ 22.766430] ? __do_page_fault+0x2b8/0xb60 [ 22.767211] ? __handle_mm_fault+0x39c0/0x39c0 [ 22.768025] ? vmacache_find+0x61/0x270 [ 22.768744] ? up_read+0x1a/0x40 [ 22.769347] ? __do_page_fault+0x35b/0xb60 [ 22.770127] ? do_page_fault+0xee/0x720 [ 22.770829] ? __do_page_fault+0xb60/0xb60 [ 22.771345] ? putname+0xf3/0x130 [ 22.771724] do_group_exit+0x149/0x400 [ 22.772178] ? lockdep_sys_exit+0x47/0xf0 [ 22.772610] ? SyS_exit+0x30/0x30 [ 22.773047] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 22.773599] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 22.774226] SyS_exit_group+0x1d/0x20 [ 22.774867] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 22.784359] RIP: 0033:0x438cd9 [ 22.784846] RSP: 002b:00007ffeacfd6fd8 EFLAGS: 00000246 ORIG_RAX: 00000000000000e7 [ 22.785724] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 0000000000438cd9 [ 22.786586] RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000 [ 22.787443] RBP: 0000000000000082 R08: 000000000000003c R09: 00000000000000e7 [ 22.788081] R10: ffffffffffffffcc R11: 0000000000000246 R12: 0000000000000001 [ 22.788719] R13: 00000000006cc300 R14: 00000000004027d0 R15: 0000000000000000 [ 22.789386] [ 22.789534] Allocated by task 2974: [ 22.790000] save_stack_trace+0x16/0x20 [ 22.790625] save_stack+0x43/0xd0 [ 22.791144] kasan_kmalloc+0xad/0xe0 [ 22.791597] __kmalloc_node+0x47/0x70 [ 22.792025] kvmalloc_node+0x64/0xd0 [ 22.792662] alloc_netdev_mqs+0x16e/0xed0 [ 22.793401] __tun_chr_ioctl+0x12be/0x3d20 [ 22.794034] tun_chr_ioctl+0x2a/0x40 [ 22.794468] do_vfs_ioctl+0x1b1/0x1530 [ 22.794907] SyS_ioctl+0x8f/0xc0 [ 22.795371] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 22.795878] [ 22.796099] Freed by task 2974: [ 22.796470] save_stack_trace+0x16/0x20 [ 22.796909] save_stack+0x43/0xd0 [ 22.797297] kasan_slab_free+0x71/0xc0 [ 22.797743] kfree+0xca/0x250 [ 22.798183] kvfree+0x36/0x60 [ 22.799762] free_netdev+0x2cf/0x360 [ 22.800994] __tun_chr_ioctl+0x2cf6/0x3d20 [ 22.801430] tun_chr_ioctl+0x2a/0x40 [ 22.801770] do_vfs_ioctl+0x1b1/0x1530 [ 22.802159] SyS_ioctl+0x8f/0xc0 [ 22.802570] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 22.802973] [ 22.803093] The buggy address belongs to the object at ffff88003bc302c0 [ 22.803093] which belongs to the cache kmalloc-16384 of size 16384 [ 22.804323] The buggy address is located 13312 bytes inside of [ 22.804323] 16384-byte region [ffff88003bc302c0, ffff88003bc342c0) [ 22.805575] The buggy address belongs to the page: [ 22.806210] page:ffffea0000ef0c00 count:1 mapcount:0 mapping:ffff88003bc302c0 index:0x0 compound_mapcount: 0 [ 22.807965] flags: 0x100000000008100(slab|head) [ 22.808360] raw: 0100000000008100 ffff88003bc302c0 0000000000000000 0000000100000001 [ 22.809373] raw: ffffea0000ecd020 ffff88003e801c50 ffff88003e802200 0000000000000000 [ 22.810243] page dumped because: kasan: bad access detected [ 22.810802] [ 22.810950] Memory state around the buggy address: [ 22.811602] ffff88003bc33580: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 22.812294] ffff88003bc33600: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 22.812965] >ffff88003bc33680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 22.813664] ^ [ 22.814197] ffff88003bc33700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 22.814851] ffff88003bc33780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 22.815525] ================================================================== [ 22.816202] Disabling lock debugging due to kernel taint [ 22.816708] Kernel panic - not syncing: panic_on_warn set ... [ 22.816708] [ 22.817396] CPU: 0 PID: 2974 Comm: syzkaller455543 Tainted: G B 4.13.0-next-20170911+ #1 [ 22.818532] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS Bochs 01/01/2011 [ 22.821233] Call Trace: [ 22.821702] dump_stack+0x194/0x257 [ 22.822371] ? arch_local_irq_restore+0x53/0x53 [ 22.822818] ? vprintk_default+0x28/0x30 [ 22.823188] ? detach_if_pending+0x4c0/0x610 [ 22.823641] panic+0x1e4/0x417 [ 22.823950] ? __warn+0x1d9/0x1d9 [ 22.824386] ? detach_if_pending+0x557/0x610 [ 22.824835] kasan_end_report+0x50/0x50 [ 22.825253] kasan_report+0x137/0x340 [ 22.825648] __asan_report_store8_noabort+0x17/0x20 [ 22.826311] detach_if_pending+0x557/0x610 [ 22.827081] ? trace_raw_output_tick_stop+0x130/0x130 [ 22.828042] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 22.828881] ? lock_timer_base+0x1a3/0x2b0 [ 22.829632] ? lock_timer_base+0x1eb/0x2b0 [ 22.830333] ? __internal_add_timer+0x2d0/0x2d0 [ 22.830813] ? trace_hardirqs_on+0xd/0x10 [ 22.831250] try_to_del_timer_sync+0xa2/0x120 [ 22.831711] ? del_timer+0x130/0x130 [ 22.832125] ? del_timer_sync+0xeb/0x240 [ 22.832530] del_timer_sync+0x18a/0x240 [ 22.832900] tun_free_netdev+0x105/0x1b0 [ 22.833345] ? tun_xdp+0x410/0x410 [ 22.833666] ? cpumask_next+0x24/0x30 [ 22.834037] ? netdev_refcnt_read+0xed/0x150 [ 22.834495] ? tun_xdp+0x410/0x410 [ 22.834818] netdev_run_todo+0x870/0xca0 [ 22.835371] ? do_group_exit+0x149/0x400 [ 22.835807] ? register_netdev+0x30/0x30 [ 22.836455] ? lock_downgrade+0x990/0x990 [ 22.836962] ? trace_hardirqs_on+0xd/0x10 [ 22.837419] ? refcount_sub_and_test+0x115/0x1b0 [ 22.837872] ? refcount_inc+0x50/0x50 [ 22.838536] ? refcount_inc+0x50/0x50 [ 22.839206] ? sk_destruct+0x4c/0x80 [ 22.839675] ? __sk_free+0x5c/0x230 [ 22.840302] ? sk_free+0x2f/0x40 [ 22.840862] ? __tun_detach+0x176/0x1390 [ 22.842897] ? tun_attach+0xf90/0xf90 [ 22.843578] ? do_raw_spin_trylock+0x190/0x190 [ 22.844437] ? locks_remove_file+0x3fa/0x5a0 [ 22.845261] ? fcntl_setlk+0x10d0/0x10d0 [ 22.846022] ? __fsnotify_parent+0xb4/0x3a0 [ 22.846724] ? fsnotify+0x1af0/0x1af0 [ 22.847266] ? __tun_detach+0x1390/0x1390 [ 22.847802] ? __tun_detach+0x1390/0x1390 [ 22.848574] rtnl_unlock+0xe/0x10 [ 22.849217] tun_chr_close+0x49/0x60 [ 22.849617] __fput+0x333/0x7f0 [ 22.849976] ? fput+0x140/0x140 [ 22.850371] ? check_same_owner+0x320/0x320 [ 22.850827] ? _raw_spin_unlock_irq+0x27/0x70 [ 22.851290] ____fput+0x15/0x20 [ 22.851632] task_work_run+0x199/0x270 [ 22.852037] ? task_work_cancel+0x210/0x210 [ 22.852770] ? _raw_spin_unlock+0x22/0x30 [ 22.853282] ? switch_task_namespaces+0x87/0xc0 [ 22.853801] do_exit+0xa52/0x1b40 [ 22.854122] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 22.854495] ? check_noncircular+0x20/0x20 [ 22.854882] ? __handle_mm_fault+0x587/0x39c0 [ 22.855320] ? mm_update_next_owner+0x930/0x930 [ 22.855790] ? __pmd_alloc+0x4e0/0x4e0 [ 22.856094] ? find_held_lock+0x39/0x1d0 [ 22.856469] ? lock_downgrade+0x990/0x990 [ 22.856867] ? handle_mm_fault+0x410/0x8d0 [ 22.857254] ? down_read_trylock+0xdb/0x170 [ 22.857664] ? __do_page_fault+0x2b8/0xb60 [ 22.858071] ? __handle_mm_fault+0x39c0/0x39c0 [ 22.858488] ? vmacache_find+0x61/0x270 [ 22.858851] ? up_read+0x1a/0x40 [ 22.859153] ? __do_page_fault+0x35b/0xb60 [ 22.859544] ? do_page_fault+0xee/0x720 [ 22.859913] ? __do_page_fault+0xb60/0xb60 [ 22.860313] ? putname+0xf3/0x130 [ 22.860640] do_group_exit+0x149/0x400 [ 22.861005] ? lockdep_sys_exit+0x47/0xf0 [ 22.861384] ? SyS_exit+0x30/0x30 [ 22.861702] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 22.862169] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 22.862594] SyS_exit_group+0x1d/0x20 [ 22.864887] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 22.865420] RIP: 0033:0x438cd9 [ 22.865718] RSP: 002b:00007ffeacfd6fd8 EFLAGS: 00000246 ORIG_RAX: 00000000000000e7 [ 22.866491] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 0000000000438cd9 [ 22.867200] RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000 [ 22.867912] RBP: 0000000000000082 R08: 000000000000003c R09: 00000000000000e7 [ 22.870803] R10: ffffffffffffffcc R11: 0000000000000246 R12: 0000000000000001 [ 22.872238] R13: 00000000006cc300 R14: 00000000004027d0 R15: 0000000000000000 [ 22.873881] Dumping ftrace buffer: [ 22.874653] (ftrace buffer empty) [ 22.875469] Kernel Offset: disabled [ 22.876261] Rebooting in 86400 seconds..