net.ipv6.conf.syz0.accept_dad = 0 net.ipv6.conf.syz0.router_solicitations = 0 executing program syzkaller login: [ 24.656603] ================================================================== [ 24.657865] BUG: KASAN: use-after-free in detach_if_pending+0x557/0x610 [ 24.658584] Write of size 8 at addr ffff880039573700 by task syzkaller172839/3003 [ 24.659997] [ 24.660183] CPU: 0 PID: 3003 Comm: syzkaller172839 Not tainted 4.13.0-next-20170905+ #15 [ 24.660907] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS Bochs 01/01/2011 [ 24.661489] Call Trace: [ 24.661725] dump_stack+0x194/0x257 [ 24.661980] ? arch_local_irq_restore+0x53/0x53 [ 24.662295] ? show_regs_print_info+0x65/0x65 [ 24.662623] ? lock_timer_base+0x1a3/0x2b0 [ 24.662922] ? detach_if_pending+0x557/0x610 [ 24.663224] print_address_description+0x73/0x250 [ 24.663552] ? detach_if_pending+0x557/0x610 [ 24.663874] kasan_report+0x24e/0x340 [ 24.664141] __asan_report_store8_noabort+0x17/0x20 [ 24.664488] detach_if_pending+0x557/0x610 [ 24.665642] ? trace_raw_output_tick_stop+0x130/0x130 [ 24.666200] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 24.666679] ? lock_timer_base+0x1a3/0x2b0 [ 24.667072] ? lock_timer_base+0x1eb/0x2b0 [ 24.667475] ? __internal_add_timer+0x2d0/0x2d0 [ 24.667938] ? trace_hardirqs_on+0xd/0x10 [ 24.668322] try_to_del_timer_sync+0xa2/0x120 [ 24.668845] ? del_timer+0x130/0x130 [ 24.669189] ? del_timer_sync+0xeb/0x240 [ 24.669604] del_timer_sync+0x18a/0x240 [ 24.669998] tun_free_netdev+0x105/0x1b0 [ 24.670354] ? tun_xdp+0x410/0x410 [ 24.670598] ? cpumask_next+0x24/0x30 [ 24.670883] ? netdev_refcnt_read+0xed/0x150 [ 24.671282] ? tun_xdp+0x410/0x410 [ 24.671670] netdev_run_todo+0x870/0xca0 [ 24.672123] ? do_group_exit+0x149/0x400 [ 24.672581] ? register_netdev+0x30/0x30 [ 24.673028] ? lock_downgrade+0x990/0x990 [ 24.673473] ? trace_hardirqs_on+0xd/0x10 [ 24.673941] ? refcount_sub_and_test+0x115/0x1b0 [ 24.674453] ? refcount_inc+0x50/0x50 [ 24.674858] ? refcount_inc+0x50/0x50 [ 24.675259] ? sk_destruct+0x4c/0x80 [ 24.675639] ? __sk_free+0x5c/0x230 [ 24.675962] ? sk_free+0x2f/0x40 [ 24.676314] ? __tun_detach+0x176/0x1390 [ 24.676772] ? tun_attach+0xf90/0xf90 [ 24.677130] ? locks_remove_file+0x3fa/0x5a0 [ 24.677435] ? fcntl_setlk+0x10d0/0x10d0 [ 24.677737] ? __fsnotify_parent+0xb4/0x3a0 [ 24.678025] ? fsnotify+0x1af0/0x1af0 [ 24.678275] ? __tun_detach+0x1390/0x1390 [ 24.678555] ? __tun_detach+0x1390/0x1390 [ 24.678856] rtnl_unlock+0xe/0x10 [ 24.679084] tun_chr_close+0x49/0x60 [ 24.679350] __fput+0x333/0x7f0 [ 24.679585] ? fput+0x140/0x140 [ 24.679843] ? check_same_owner+0x320/0x320 [ 24.680142] ____fput+0x15/0x20 [ 24.681275] task_work_run+0x199/0x270 [ 24.681696] ? task_work_cancel+0x210/0x210 [ 24.682189] ? free_nsproxy+0x185/0x1f0 [ 24.682630] ? switch_task_namespaces+0xa2/0xc0 [ 24.683157] do_exit+0xa52/0x1b40 [ 24.683544] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 24.684095] ? check_noncircular+0x20/0x20 [ 24.684563] ? __handle_mm_fault+0x587/0x39c0 [ 24.685118] ? mm_update_next_owner+0x930/0x930 [ 24.685795] ? __pmd_alloc+0x4e0/0x4e0 [ 24.686145] ? find_held_lock+0x39/0x1d0 [ 24.686426] ? lock_downgrade+0x990/0x990 [ 24.686763] ? handle_mm_fault+0x4a2/0x860 [ 24.687057] ? down_read_trylock+0xdb/0x170 [ 24.687358] ? __handle_mm_fault+0x39c0/0x39c0 [ 24.687704] ? vmacache_find+0x61/0x270 [ 24.687977] ? vmacache_update+0xfe/0x130 [ 24.688269] ? up_read+0x1a/0x40 [ 24.688508] ? __do_page_fault+0x35b/0xb60 [ 24.688941] ? do_page_fault+0xee/0x720 [ 24.689369] ? __do_page_fault+0xb60/0xb60 [ 24.689805] ? putname+0xf3/0x130 [ 24.690177] do_group_exit+0x149/0x400 [ 24.690588] ? lockdep_sys_exit+0x47/0xf0 [ 24.691074] ? SyS_exit+0x30/0x30 [ 24.691486] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 24.691943] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 24.692270] SyS_exit_group+0x1d/0x20 [ 24.692532] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 24.692897] RIP: 0033:0x43a399 [ 24.693134] RSP: 002b:00000000007dfe38 EFLAGS: 00000202 ORIG_RAX: 00000000000000e7 [ 24.693791] RAX: ffffffffffffffda RBX: 8760d46e2068deb1 RCX: 000000000043a399 [ 24.694282] RDX: 000000000043a399 RSI: 0000000020bc5000 RDI: 0000000000000001 [ 24.694806] RBP: 0000000000000082 R08: 0000000000000000 R09: 0000000000000000 [ 24.695295] R10: 00000000000000fd R11: 0000000000000202 R12: 0000000000000000 [ 24.695809] R13: 0000000000402960 R14: 00000000004029f0 R15: 0000000000000000 [ 24.696302] [ 24.696413] Allocated by task 3003: [ 24.696727] save_stack_trace+0x16/0x20 [ 24.697089] save_stack+0x43/0xd0 [ 24.697401] kasan_kmalloc+0xad/0xe0 [ 24.697737] __kmalloc_node+0x47/0x70 [ 24.698079] kvmalloc_node+0x64/0xd0 [ 24.698415] alloc_netdev_mqs+0x16e/0xed0 [ 24.698788] __tun_chr_ioctl+0x12be/0x3d20 [ 24.699177] tun_chr_ioctl+0x2a/0x40 [ 24.699522] do_vfs_ioctl+0x1b1/0x1530 [ 24.699896] SyS_ioctl+0x8f/0xc0 [ 24.700203] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 24.700628] [ 24.700787] Freed by task 3003: [ 24.701083] save_stack_trace+0x16/0x20 [ 24.701962] save_stack+0x43/0xd0 [ 24.702218] kasan_slab_free+0x71/0xc0 [ 24.702469] kfree+0xca/0x250 [ 24.702671] kvfree+0x36/0x60 [ 24.702876] free_netdev+0x2cf/0x360 [ 24.703141] __tun_chr_ioctl+0x2cf6/0x3d20 [ 24.703425] tun_chr_ioctl+0x2a/0x40 [ 24.703679] do_vfs_ioctl+0x1b1/0x1530 [ 24.703956] SyS_ioctl+0x8f/0xc0 [ 24.704170] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 24.704508] [ 24.704622] The buggy address belongs to the object at ffff880039570300 [ 24.704622] which belongs to the cache kmalloc-16384 of size 16384 [ 24.705508] The buggy address is located 13312 bytes inside of [ 24.705508] 16384-byte region [ffff880039570300, ffff880039574300) [ 24.706351] The buggy address belongs to the page: [ 24.706687] page:ffffea0000e55c00 count:1 mapcount:0 mapping:ffff880039570300 index:0x0 compound_mapcount: 0 [ 24.707384] flags: 0x100000000008100(slab|head) [ 24.707695] raw: 0100000000008100 ffff880039570300 0000000000000000 0000000100000001 [ 24.708230] raw: ffffea0000e48c20 ffff88003e801c50 ffff88003e802200 0000000000000000 [ 24.708746] page dumped because: kasan: bad access detected [ 24.709144] [ 24.709256] Memory state around the buggy address: [ 24.709574] ffff880039573600: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 24.710028] ffff880039573680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 24.710496] >ffff880039573700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 24.710926] ^ [ 24.711228] ffff880039573780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 24.711918] ffff880039573800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 24.712582] ================================================================== [ 24.713243] Disabling lock debugging due to kernel taint [ 24.713723] Kernel panic - not syncing: panic_on_warn set ... [ 24.713723] [ 24.714425] CPU: 0 PID: 3003 Comm: syzkaller172839 Tainted: G B 4.13.0-next-20170905+ #15 [ 24.715071] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS Bochs 01/01/2011 [ 24.715689] Call Trace: [ 24.715874] dump_stack+0x194/0x257 [ 24.716131] ? arch_local_irq_restore+0x53/0x53 [ 24.716466] ? vprintk_default+0x28/0x30 [ 24.716759] ? detach_if_pending+0x530/0x610 [ 24.717060] panic+0x1e4/0x417 [ 24.717341] ? __warn+0x1d9/0x1d9 [ 24.717711] ? detach_if_pending+0x557/0x610 [ 24.718156] kasan_end_report+0x50/0x50 [ 24.718549] kasan_report+0x137/0x340 [ 24.718944] __asan_report_store8_noabort+0x17/0x20 [ 24.719450] detach_if_pending+0x557/0x610 [ 24.719879] ? trace_raw_output_tick_stop+0x130/0x130 [ 24.720405] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 24.720876] ? lock_timer_base+0x1a3/0x2b0 [ 24.721296] ? lock_timer_base+0x1eb/0x2b0 [ 24.721727] ? __internal_add_timer+0x2d0/0x2d0 [ 24.722149] ? trace_hardirqs_on+0xd/0x10 [ 24.722650] try_to_del_timer_sync+0xa2/0x120 [ 24.723503] ? del_timer+0x130/0x130 [ 24.724029] ? del_timer_sync+0xeb/0x240 [ 24.724552] del_timer_sync+0x18a/0x240 [ 24.724919] tun_free_netdev+0x105/0x1b0 [ 24.725369] ? tun_xdp+0x410/0x410 [ 24.725862] ? cpumask_next+0x24/0x30 [ 24.726299] ? netdev_refcnt_read+0xed/0x150 [ 24.726906] ? tun_xdp+0x410/0x410 [ 24.727395] netdev_run_todo+0x870/0xca0 [ 24.727996] ? do_group_exit+0x149/0x400 [ 24.728765] ? register_netdev+0x30/0x30 [ 24.729468] ? lock_downgrade+0x990/0x990 [ 24.730171] ? trace_hardirqs_on+0xd/0x10 [ 24.730834] ? refcount_sub_and_test+0x115/0x1b0 [ 24.731545] ? refcount_inc+0x50/0x50 [ 24.732071] ? refcount_inc+0x50/0x50 [ 24.732616] ? sk_destruct+0x4c/0x80 [ 24.733115] ? __sk_free+0x5c/0x230 [ 24.733375] ? sk_free+0x2f/0x40 [ 24.733619] ? __tun_detach+0x176/0x1390 [ 24.733926] ? tun_attach+0xf90/0xf90 [ 24.734216] ? locks_remove_file+0x3fa/0x5a0 [ 24.734530] ? fcntl_setlk+0x10d0/0x10d0 [ 24.734820] ? __fsnotify_parent+0xb4/0x3a0 [ 24.735176] ? fsnotify+0x1af0/0x1af0 [ 24.735549] ? __tun_detach+0x1390/0x1390 [ 24.735976] ? __tun_detach+0x1390/0x1390 [ 24.736411] rtnl_unlock+0xe/0x10 [ 24.736793] tun_chr_close+0x49/0x60 [ 24.737185] __fput+0x333/0x7f0 [ 24.737526] ? fput+0x140/0x140 [ 24.737864] ? check_same_owner+0x320/0x320 [ 24.738299] ____fput+0x15/0x20 [ 24.738639] task_work_run+0x199/0x270 [ 24.739043] ? task_work_cancel+0x210/0x210 [ 24.739489] ? free_nsproxy+0x185/0x1f0 [ 24.739893] ? switch_task_namespaces+0xa2/0xc0 [ 24.740375] do_exit+0xa52/0x1b40 [ 24.740744] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 24.741257] ? check_noncircular+0x20/0x20 [ 24.741701] ? __handle_mm_fault+0x587/0x39c0 [ 24.742159] ? mm_update_next_owner+0x930/0x930 [ 24.742646] ? __pmd_alloc+0x4e0/0x4e0 [ 24.743047] ? find_held_lock+0x39/0x1d0 [ 24.743454] ? lock_downgrade+0x990/0x990 [ 24.744518] ? handle_mm_fault+0x4a2/0x860 [ 24.744961] ? down_read_trylock+0xdb/0x170 [ 24.745382] ? __handle_mm_fault+0x39c0/0x39c0 [ 24.745848] ? vmacache_find+0x61/0x270 [ 24.746131] ? vmacache_update+0xfe/0x130 [ 24.746418] ? up_read+0x1a/0x40 [ 24.746660] ? __do_page_fault+0x35b/0xb60 [ 24.747037] ? do_page_fault+0xee/0x720 [ 24.747412] ? __do_page_fault+0xb60/0xb60 [ 24.747839] ? putname+0xf3/0x130 [ 24.748270] do_group_exit+0x149/0x400 [ 24.748860] ? lockdep_sys_exit+0x47/0xf0 [ 24.749233] ? SyS_exit+0x30/0x30 [ 24.749560] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 24.750045] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 24.750514] SyS_exit_group+0x1d/0x20 [ 24.750904] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 24.751377] RIP: 0033:0x43a399 [ 24.751719] RSP: 002b:00000000007dfe38 EFLAGS: 00000202 ORIG_RAX: 00000000000000e7 [ 24.752369] RAX: ffffffffffffffda RBX: 8760d46e2068deb1 RCX: 000000000043a399 [ 24.752877] RDX: 000000000043a399 RSI: 0000000020bc5000 RDI: 0000000000000001 [ 24.753468] RBP: 0000000000000082 R08: 0000000000000000 R09: 0000000000000000 [ 24.754611] R10: 00000000000000fd R11: 0000000000000202 R12: 0000000000000000 [ 24.755837] R13: 0000000000402960 R14: 00000000004029f0 R15: 0000000000000000 [ 24.756600] Dumping ftrace buffer: [ 24.756962] (ftrace buffer empty) [ 24.757304] Kernel Offset: disabled [ 24.757665] Rebooting in 86400 seconds..