net.ipv6.conf.syz0.accept_dad = 0 net.ipv6.conf.syz0.router_solicitations = 0 executing program syzkaller login: [ 22.575535] ================================================================== [ 22.576466] BUG: KASAN: use-after-free in detach_if_pending+0x557/0x610 [ 22.577246] Write of size 8 at addr ffff880039bf3800 by task syzkaller549514/2994 [ 22.578131] [ 22.578336] CPU: 1 PID: 2994 Comm: syzkaller549514 Not tainted 4.13.0-next-20170905+ #15 [ 22.579178] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS Bochs 01/01/2011 [ 22.580152] Call Trace: [ 22.580471] dump_stack+0x194/0x257 [ 22.580911] ? arch_local_irq_restore+0x53/0x53 [ 22.581459] ? show_regs_print_info+0x65/0x65 [ 22.582009] ? lock_timer_base+0x1a3/0x2b0 [ 22.582821] ? detach_if_pending+0x557/0x610 [ 22.583372] print_address_description+0x73/0x250 [ 22.583963] ? detach_if_pending+0x557/0x610 [ 22.584483] kasan_report+0x24e/0x340 [ 22.584946] __asan_report_store8_noabort+0x17/0x20 [ 22.585533] detach_if_pending+0x557/0x610 [ 22.586137] ? trace_raw_output_tick_stop+0x130/0x130 [ 22.586550] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 22.586986] ? lock_timer_base+0x1a3/0x2b0 [ 22.587437] ? lock_timer_base+0x1eb/0x2b0 [ 22.587903] ? __internal_add_timer+0x2d0/0x2d0 [ 22.589642] ? trace_hardirqs_on+0xd/0x10 [ 22.590678] try_to_del_timer_sync+0xa2/0x120 [ 22.591573] ? del_timer+0x130/0x130 [ 22.592338] ? del_timer_sync+0xeb/0x240 [ 22.593200] del_timer_sync+0x18a/0x240 [ 22.593985] tun_free_netdev+0x105/0x1b0 [ 22.594465] ? tun_xdp+0x410/0x410 [ 22.594824] ? cpumask_next+0x24/0x30 [ 22.595257] ? netdev_refcnt_read+0xed/0x150 [ 22.595747] ? tun_xdp+0x410/0x410 [ 22.596131] netdev_run_todo+0x870/0xca0 [ 22.596560] ? do_group_exit+0x149/0x400 [ 22.596970] ? register_netdev+0x30/0x30 [ 22.597461] ? lock_downgrade+0x990/0x990 [ 22.597872] ? trace_hardirqs_on+0xd/0x10 [ 22.598411] ? refcount_sub_and_test+0x115/0x1b0 [ 22.599362] ? refcount_inc+0x50/0x50 [ 22.600119] ? refcount_inc+0x50/0x50 [ 22.600900] ? sk_destruct+0x4c/0x80 [ 22.601672] ? __sk_free+0x5c/0x230 [ 22.602403] ? sk_free+0x2f/0x40 [ 22.603047] ? __tun_detach+0x176/0x1390 [ 22.603618] ? tun_attach+0xf90/0xf90 [ 22.604035] ? do_raw_spin_trylock+0x190/0x190 [ 22.604616] ? locks_remove_file+0x3fa/0x5a0 [ 22.605376] ? fcntl_setlk+0x10d0/0x10d0 [ 22.606496] ? __fsnotify_parent+0xb4/0x3a0 [ 22.607389] ? fsnotify+0x1af0/0x1af0 [ 22.607963] ? __tun_detach+0x1390/0x1390 [ 22.608589] ? __tun_detach+0x1390/0x1390 [ 22.609224] rtnl_unlock+0xe/0x10 [ 22.609745] tun_chr_close+0x49/0x60 [ 22.610313] __fput+0x333/0x7f0 [ 22.610921] ? fput+0x140/0x140 [ 22.611468] ? check_same_owner+0x320/0x320 [ 22.612110] ? _raw_spin_unlock_irq+0x27/0x70 [ 22.612777] ____fput+0x15/0x20 [ 22.613284] task_work_run+0x199/0x270 [ 22.613863] ? task_work_cancel+0x210/0x210 [ 22.614513] ? _raw_spin_unlock+0x22/0x30 [ 22.615151] ? switch_task_namespaces+0x87/0xc0 [ 22.615858] do_exit+0xa52/0x1b40 [ 22.616485] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 22.617468] ? check_noncircular+0x20/0x20 [ 22.618270] ? __handle_mm_fault+0x587/0x39c0 [ 22.619128] ? mm_update_next_owner+0x930/0x930 [ 22.620019] ? __pmd_alloc+0x4e0/0x4e0 [ 22.620820] ? find_held_lock+0x39/0x1d0 [ 22.621674] ? lock_downgrade+0x990/0x990 [ 22.622690] ? handle_mm_fault+0x4a2/0x860 [ 22.623706] ? down_read_trylock+0xdb/0x170 [ 22.624672] ? __handle_mm_fault+0x39c0/0x39c0 [ 22.625608] ? vmacache_find+0x61/0x270 [ 22.626390] ? up_read+0x1a/0x40 [ 22.627059] ? __do_page_fault+0x35b/0xb60 [ 22.628307] ? do_page_fault+0xee/0x720 [ 22.629154] ? __do_page_fault+0xb60/0xb60 [ 22.630009] ? putname+0xf3/0x130 [ 22.630715] do_group_exit+0x149/0x400 [ 22.631512] ? lockdep_sys_exit+0x47/0xf0 [ 22.632339] ? SyS_exit+0x30/0x30 [ 22.633030] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 22.634025] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 22.634971] SyS_exit_group+0x1d/0x20 [ 22.635770] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 22.636700] RIP: 0033:0x438b99 [ 22.637203] RSP: 002b:00007fff8ff40788 EFLAGS: 00000246 ORIG_RAX: 00000000000000e7 [ 22.638131] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 0000000000438b99 [ 22.638939] RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000 [ 22.639697] RBP: 0000000000000082 R08: 000000000000003c R09: 00000000000000e7 [ 22.640388] R10: ffffffffffffffcc R11: 0000000000000246 R12: 0000000000000001 [ 22.641082] R13: 00000000006cc300 R14: 0000000000402690 R15: 0000000000000000 [ 22.641788] [ 22.641950] Allocated by task 2994: [ 22.642311] save_stack_trace+0x16/0x20 [ 22.642696] save_stack+0x43/0xd0 [ 22.643040] kasan_kmalloc+0xad/0xe0 [ 22.643408] __kmalloc_node+0x47/0x70 [ 22.643777] kvmalloc_node+0x64/0xd0 [ 22.644137] alloc_netdev_mqs+0x16e/0xed0 [ 22.644536] __tun_chr_ioctl+0x12be/0x3d20 [ 22.644944] tun_chr_ioctl+0x2a/0x40 [ 22.645305] do_vfs_ioctl+0x1b1/0x1530 [ 22.645681] SyS_ioctl+0x8f/0xc0 [ 22.646009] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 22.646466] [ 22.646630] Freed by task 2994: [ 22.646950] save_stack_trace+0x16/0x20 [ 22.647598] save_stack+0x43/0xd0 [ 22.647933] kasan_slab_free+0x71/0xc0 [ 22.648312] kfree+0xca/0x250 [ 22.648614] kvfree+0x36/0x60 [ 22.648916] free_netdev+0x2cf/0x360 [ 22.649277] __tun_chr_ioctl+0x2cf6/0x3d20 [ 22.649685] tun_chr_ioctl+0x2a/0x40 [ 22.650045] do_vfs_ioctl+0x1b1/0x1530 [ 22.650440] SyS_ioctl+0x8f/0xc0 [ 22.650774] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 22.651258] [ 22.651422] The buggy address belongs to the object at ffff880039bf0400 [ 22.651422] which belongs to the cache kmalloc-16384 of size 16384 [ 22.652679] The buggy address is located 13312 bytes inside of [ 22.652679] 16384-byte region [ffff880039bf0400, ffff880039bf4400) [ 22.653861] The buggy address belongs to the page: [ 22.654358] page:ffffea0000e6fc00 count:1 mapcount:0 mapping:ffff880039bf0400 index:0x0 compound_mapcount: 0 [ 22.655313] flags: 0x100000000008100(slab|head) [ 22.655758] raw: 0100000000008100 ffff880039bf0400 0000000000000000 0000000100000001 [ 22.656500] raw: ffffea0000ebea20 ffff88003e801c50 ffff88003e802200 0000000000000000 [ 22.657248] page dumped because: kasan: bad access detected [ 22.657790] [ 22.657950] Memory state around the buggy address: [ 22.658421] ffff880039bf3700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 22.659122] ffff880039bf3780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 22.659831] >ffff880039bf3800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 22.660536] ^ [ 22.660862] ffff880039bf3880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 22.661568] ffff880039bf3900: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 22.662269] ================================================================== [ 22.662968] Disabling lock debugging due to kernel taint [ 22.663486] Kernel panic - not syncing: panic_on_warn set ... [ 22.663486] [ 22.664187] CPU: 1 PID: 2994 Comm: syzkaller549514 Tainted: G B 4.13.0-next-20170905+ #15 [ 22.665073] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS Bochs 01/01/2011 [ 22.665851] Call Trace: [ 22.666107] dump_stack+0x194/0x257 [ 22.666461] ? arch_local_irq_restore+0x53/0x53 [ 22.666908] ? vprintk_default+0x28/0x30 [ 22.667300] ? detach_if_pending+0x530/0x610 [ 22.667721] panic+0x1e4/0x417 [ 22.668029] ? __warn+0x1d9/0x1d9 [ 22.668369] ? detach_if_pending+0x557/0x610 [ 22.668792] kasan_end_report+0x50/0x50 [ 22.669136] kasan_report+0x137/0x340 [ 22.669473] __asan_report_store8_noabort+0x17/0x20 [ 22.670199] detach_if_pending+0x557/0x610 [ 22.670604] ? trace_raw_output_tick_stop+0x130/0x130 [ 22.671125] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 22.671585] ? lock_timer_base+0x1a3/0x2b0 [ 22.671989] ? lock_timer_base+0x1eb/0x2b0 [ 22.672417] ? __internal_add_timer+0x2d0/0x2d0 [ 22.672862] ? trace_hardirqs_on+0xd/0x10 [ 22.673282] try_to_del_timer_sync+0xa2/0x120 [ 22.673711] ? del_timer+0x130/0x130 [ 22.674067] ? del_timer_sync+0xeb/0x240 [ 22.674478] del_timer_sync+0x18a/0x240 [ 22.674860] tun_free_netdev+0x105/0x1b0 [ 22.675278] ? tun_xdp+0x410/0x410 [ 22.675617] ? cpumask_next+0x24/0x30 [ 22.675999] ? netdev_refcnt_read+0xed/0x150 [ 22.676442] ? tun_xdp+0x410/0x410 [ 22.676781] netdev_run_todo+0x870/0xca0 [ 22.677188] ? do_group_exit+0x149/0x400 [ 22.677577] ? register_netdev+0x30/0x30 [ 22.677965] ? lock_downgrade+0x990/0x990 [ 22.678362] ? trace_hardirqs_on+0xd/0x10 [ 22.678769] ? refcount_sub_and_test+0x115/0x1b0 [ 22.679230] ? refcount_inc+0x50/0x50 [ 22.679595] ? refcount_inc+0x50/0x50 [ 22.679959] ? sk_destruct+0x4c/0x80 [ 22.680311] ? __sk_free+0x5c/0x230 [ 22.680658] ? sk_free+0x2f/0x40 [ 22.680981] ? __tun_detach+0x176/0x1390 [ 22.681374] ? tun_attach+0xf90/0xf90 [ 22.681740] ? do_raw_spin_trylock+0x190/0x190 [ 22.682181] ? locks_remove_file+0x3fa/0x5a0 [ 22.682605] ? fcntl_setlk+0x10d0/0x10d0 [ 22.682998] ? __fsnotify_parent+0xb4/0x3a0 [ 22.683419] ? fsnotify+0x1af0/0x1af0 [ 22.683789] ? __tun_detach+0x1390/0x1390 [ 22.684187] ? __tun_detach+0x1390/0x1390 [ 22.684588] rtnl_unlock+0xe/0x10 [ 22.684917] tun_chr_close+0x49/0x60 [ 22.685270] __fput+0x333/0x7f0 [ 22.685584] ? fput+0x140/0x140 [ 22.685896] ? check_same_owner+0x320/0x320 [ 22.686306] ? _raw_spin_unlock_irq+0x27/0x70 [ 22.686740] ____fput+0x15/0x20 [ 22.687059] task_work_run+0x199/0x270 [ 22.687450] ? task_work_cancel+0x210/0x210 [ 22.687862] ? _raw_spin_unlock+0x22/0x30 [ 22.688254] ? switch_task_namespaces+0x87/0xc0 [ 22.688697] do_exit+0xa52/0x1b40 [ 22.689025] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 22.689500] ? check_noncircular+0x20/0x20 [ 22.689906] ? __handle_mm_fault+0x587/0x39c0 [ 22.690313] ? mm_update_next_owner+0x930/0x930 [ 22.690738] ? __pmd_alloc+0x4e0/0x4e0 [ 22.691581] ? find_held_lock+0x39/0x1d0 [ 22.691874] ? lock_downgrade+0x990/0x990 [ 22.692206] ? handle_mm_fault+0x4a2/0x860 [ 22.692501] ? down_read_trylock+0xdb/0x170 [ 22.692803] ? __handle_mm_fault+0x39c0/0x39c0 [ 22.693159] ? vmacache_find+0x61/0x270 [ 22.693442] ? up_read+0x1a/0x40 [ 22.693679] ? __do_page_fault+0x35b/0xb60 [ 22.693979] ? do_page_fault+0xee/0x720 [ 22.694289] ? __do_page_fault+0xb60/0xb60 [ 22.694588] ? putname+0xf3/0x130 [ 22.694833] do_group_exit+0x149/0x400 [ 22.695126] ? lockdep_sys_exit+0x47/0xf0 [ 22.695523] ? SyS_exit+0x30/0x30 [ 22.695864] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 22.696339] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 22.696777] SyS_exit_group+0x1d/0x20 [ 22.697138] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 22.697578] RIP: 0033:0x438b99 [ 22.697876] RSP: 002b:00007fff8ff40788 EFLAGS: 00000246 ORIG_RAX: 00000000000000e7 [ 22.698597] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 0000000000438b99 [ 22.699275] RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000 [ 22.699963] RBP: 0000000000000082 R08: 000000000000003c R09: 00000000000000e7 [ 22.700635] R10: ffffffffffffffcc R11: 0000000000000246 R12: 0000000000000001 [ 22.701322] R13: 00000000006cc300 R14: 0000000000402690 R15: 0000000000000000 [ 22.703625] Dumping ftrace buffer: [ 22.703985] (ftrace buffer empty) [ 22.704385] Kernel Offset: disabled [ 22.704732] Rebooting in 86400 seconds..