INIT: Entering runlevel: 2 [info] Using makefile-style concurrent boot in runlevel 2. [....] Starting enhanced syslogd: rsyslogd[?25l[?1c7[ ok 8[?25h[?0c. [....] Starting periodic command scheduler: cron[?25l[?1c7[ ok 8[?25h[?0c. [....] Starting OpenBSD Secure Shell server: sshd[?25l[?1c7[ ok 8[?25h[?0c. Debian GNU/Linux 7 syzkaller ttyS0 Warning: Permanently added 'ci-upstream-next-kasan-gce-1,10.128.0.39' (ECDSA) to the list of known hosts. net.ipv6.conf.syz0.accept_dad = 0 net.ipv6.conf.syz0.router_solicitations = 0 executing program syzkaller login: [ 29.238556] ================================================================== [ 29.246006] BUG: KASAN: use-after-free in detach_if_pending+0x557/0x610 [ 29.252756] Write of size 8 at addr ffff8801ce573780 by task syzkaller591262/2983 [ 29.260361] [ 29.261972] CPU: 1 PID: 2983 Comm: syzkaller591262 Not tainted 4.13.0-rc7-next-20170829+ #11 [ 29.270533] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 29.279882] Call Trace: [ 29.282730] dump_stack+0x194/0x257 [ 29.286359] ? arch_local_irq_restore+0x53/0x53 [ 29.291034] ? show_regs_print_info+0x65/0x65 [ 29.295670] ? lock_timer_base+0x1a3/0x2b0 [ 29.299912] ? detach_if_pending+0x557/0x610 [ 29.304335] print_address_description+0x73/0x250 [ 29.309180] ? detach_if_pending+0x557/0x610 [ 29.313586] kasan_report+0x24e/0x340 [ 29.317391] __asan_report_store8_noabort+0x17/0x20 [ 29.322416] detach_if_pending+0x557/0x610 [ 29.326653] ? trace_raw_output_tick_stop+0x130/0x130 [ 29.331868] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 29.336771] ? lock_timer_base+0x1a3/0x2b0 [ 29.341487] ? lock_timer_base+0x1eb/0x2b0 [ 29.345709] ? __internal_add_timer+0x2d0/0x2d0 [ 29.350360] ? trace_hardirqs_on+0xd/0x10 [ 29.354520] try_to_del_timer_sync+0xa2/0x120 [ 29.359015] ? del_timer+0x130/0x130 [ 29.362730] ? del_timer_sync+0xeb/0x240 [ 29.366790] del_timer_sync+0x18a/0x240 [ 29.370774] tun_free_netdev+0x105/0x1b0 [ 29.374836] ? tun_xdp+0x410/0x410 [ 29.378368] ? cpumask_next+0x24/0x30 [ 29.382174] ? netdev_refcnt_read+0xed/0x150 [ 29.386587] ? tun_xdp+0x410/0x410 [ 29.390125] netdev_run_todo+0x870/0xca0 [ 29.394182] ? do_group_exit+0x149/0x400 [ 29.398253] ? register_netdev+0x30/0x30 [ 29.402314] ? lock_downgrade+0x990/0x990 [ 29.406467] ? trace_hardirqs_on+0xd/0x10 [ 29.410644] ? refcount_sub_and_test+0x115/0x1b0 [ 29.415411] ? refcount_inc+0x50/0x50 [ 29.419222] ? refcount_inc+0x50/0x50 [ 29.423042] ? sk_destruct+0x4c/0x80 [ 29.426837] ? __sk_free+0x5c/0x230 [ 29.430546] ? sk_free+0x2f/0x40 [ 29.433924] ? __tun_detach+0x176/0x1390 [ 29.438001] ? tun_attach+0xf90/0xf90 [ 29.441800] ? do_raw_spin_trylock+0x190/0x190 [ 29.446388] ? locks_remove_file+0x3fa/0x5a0 [ 29.450795] ? fcntl_setlk+0x10d0/0x10d0 [ 29.454860] ? __fsnotify_parent+0xb4/0x3a0 [ 29.459179] ? fsnotify+0x1af0/0x1af0 [ 29.462980] ? rcu_note_context_switch+0x710/0x710 [ 29.467909] ? __tun_detach+0x1390/0x1390 [ 29.472052] ? __tun_detach+0x1390/0x1390 [ 29.476192] rtnl_unlock+0xe/0x10 [ 29.479634] tun_chr_close+0x49/0x60 [ 29.483342] __fput+0x333/0x7f0 [ 29.486624] ? fput+0x140/0x140 [ 29.489897] ? check_same_owner+0x320/0x320 [ 29.494229] ? _raw_spin_unlock_irq+0x27/0x70 [ 29.498728] ____fput+0x15/0x20 [ 29.502022] task_work_run+0x199/0x270 [ 29.505919] ? task_work_cancel+0x210/0x210 [ 29.510247] ? _raw_spin_unlock+0x22/0x30 [ 29.514399] ? switch_task_namespaces+0x87/0xc0 [ 29.519071] do_exit+0xa52/0x1b40 [ 29.522787] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 29.527809] ? trace_hardirqs_on+0xd/0x10 [ 29.531961] ? __handle_mm_fault+0xe21/0x39c0 [ 29.536455] ? mm_update_next_owner+0x930/0x930 [ 29.541123] ? lock_release+0xd70/0xd70 [ 29.545093] ? check_noncircular+0x20/0x20 [ 29.549336] ? tun_chr_read_iter+0x1e0/0x1e0 [ 29.553775] ? check_noncircular+0x20/0x20 [ 29.558026] ? __handle_mm_fault+0x587/0x39c0 [ 29.562632] ? __pmd_alloc+0x4e0/0x4e0 [ 29.566563] ? find_held_lock+0x39/0x1d0 [ 29.570651] ? lock_downgrade+0x990/0x990 [ 29.574814] ? handle_mm_fault+0x4a2/0x860 [ 29.579050] ? down_read_trylock+0xdb/0x170 [ 29.583380] ? __handle_mm_fault+0x39c0/0x39c0 [ 29.587961] ? vmacache_find+0x61/0x270 [ 29.591928] do_group_exit+0x149/0x400 [ 29.595816] ? lockdep_sys_exit+0x1c4/0x2b0 [ 29.600152] ? SyS_exit+0x30/0x30 [ 29.603601] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 29.608621] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 29.613388] SyS_exit_group+0x1d/0x20 [ 29.617186] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 29.621931] RIP: 0033:0x443ad8 [ 29.625544] RSP: 002b:00007ffd8497de48 EFLAGS: 00000246 ORIG_RAX: 00000000000000e7 [ 29.633842] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 0000000000443ad8 [ 29.641108] RDX: 0000000000000000 RSI: 000000000000003c RDI: 0000000000000000 [ 29.648390] RBP: 0000000000000086 R08: 00000000000000e7 R09: ffffffffffffffd4 [ 29.655674] R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000001 [ 29.662955] R13: 00000000006d6180 R14: 0000000000000000 R15: 0000000000000000 [ 29.670256] [ 29.671868] Allocated by task 2983: [ 29.675659] save_stack_trace+0x16/0x20 [ 29.679657] save_stack+0x43/0xd0 [ 29.683098] kasan_kmalloc+0xad/0xe0 [ 29.686898] __kmalloc_node+0x47/0x70 [ 29.690685] kvmalloc_node+0x64/0xd0 [ 29.694390] alloc_netdev_mqs+0x16e/0xed0 [ 29.698531] __tun_chr_ioctl+0x12be/0x3d20 [ 29.702760] tun_chr_ioctl+0x2a/0x40 [ 29.706462] do_vfs_ioctl+0x1b1/0x1530 [ 29.710341] SyS_ioctl+0x8f/0xc0 [ 29.713710] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 29.718711] [ 29.720316] Freed by task 2983: [ 29.723583] save_stack_trace+0x16/0x20 [ 29.727546] save_stack+0x43/0xd0 [ 29.730981] kasan_slab_free+0x71/0xc0 [ 29.734861] kfree+0xca/0x250 [ 29.737954] kvfree+0x36/0x60 [ 29.741048] free_netdev+0x2cf/0x360 [ 29.744750] __tun_chr_ioctl+0x2cf6/0x3d20 [ 29.748974] tun_chr_ioctl+0x2a/0x40 [ 29.752680] do_vfs_ioctl+0x1b1/0x1530 [ 29.756553] SyS_ioctl+0x8f/0xc0 [ 29.759917] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 29.764660] [ 29.766272] The buggy address belongs to the object at ffff8801ce570380 [ 29.766272] which belongs to the cache kmalloc-16384 of size 16384 [ 29.779268] The buggy address is located 13312 bytes inside of [ 29.779268] 16384-byte region [ffff8801ce570380, ffff8801ce574380) [ 29.791476] The buggy address belongs to the page: [ 29.796403] page:ffffea0007395c00 count:1 mapcount:0 mapping:ffff8801ce570380 index:0x0 compound_mapcount: 0 [ 29.806386] flags: 0x200000000008100(slab|head) [ 29.811047] raw: 0200000000008100 ffff8801ce570380 0000000000000000 0000000100000001 [ 29.819390] raw: ffffea00073a6a20 ffff8801dac01c50 ffff8801dac02200 0000000000000000 [ 29.827432] page dumped because: kasan: bad access detected [ 29.833134] [ 29.834736] Memory state around the buggy address: [ 29.839653] ffff8801ce573680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 29.847002] ffff8801ce573700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 29.854351] >ffff8801ce573780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 29.861695] ^ [ 29.865058] ffff8801ce573800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 29.872423] ffff8801ce573880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 29.879767] ================================================================== [ 29.887111] Disabling lock debugging due to kernel taint [ 29.892536] Kernel panic - not syncing: panic_on_warn set ... [ 29.892536] [ 29.899889] CPU: 1 PID: 2983 Comm: syzkaller591262 Tainted: G B 4.13.0-rc7-next-20170829+ #11 [ 29.909661] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 29.918999] Call Trace: [ 29.921570] dump_stack+0x194/0x257 [ 29.925187] ? arch_local_irq_restore+0x53/0x53 [ 29.929842] ? vprintk_default+0x28/0x30 [ 29.933892] ? detach_if_pending+0x4b0/0x610 [ 29.938293] panic+0x1e4/0x41c [ 29.941466] ? refcount_error_report+0x214/0x214 [ 29.946257] ? detach_if_pending+0x557/0x610 [ 29.950660] kasan_end_report+0x50/0x50 [ 29.954618] kasan_report+0x137/0x340 [ 29.958415] __asan_report_store8_noabort+0x17/0x20 [ 29.963427] detach_if_pending+0x557/0x610 [ 29.967658] ? trace_raw_output_tick_stop+0x130/0x130 [ 29.972831] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 29.977485] ? lock_timer_base+0x1a3/0x2b0 [ 29.981702] ? lock_timer_base+0x1eb/0x2b0 [ 29.985918] ? __internal_add_timer+0x2d0/0x2d0 [ 29.990570] ? trace_hardirqs_on+0xd/0x10 [ 29.994708] try_to_del_timer_sync+0xa2/0x120 [ 29.999190] ? del_timer+0x130/0x130 [ 30.002893] ? del_timer_sync+0xeb/0x240 [ 30.006947] del_timer_sync+0x18a/0x240 [ 30.010910] tun_free_netdev+0x105/0x1b0 [ 30.014956] ? tun_xdp+0x410/0x410 [ 30.018480] ? cpumask_next+0x24/0x30 [ 30.022278] ? netdev_refcnt_read+0xed/0x150 [ 30.026675] ? tun_xdp+0x410/0x410 [ 30.030201] netdev_run_todo+0x870/0xca0 [ 30.034280] ? do_group_exit+0x149/0x400 [ 30.038335] ? register_netdev+0x30/0x30 [ 30.042379] ? lock_downgrade+0x990/0x990 [ 30.046524] ? trace_hardirqs_on+0xd/0x10 [ 30.050672] ? refcount_sub_and_test+0x115/0x1b0 [ 30.055414] ? refcount_inc+0x50/0x50 [ 30.059200] ? refcount_inc+0x50/0x50 [ 30.062990] ? sk_destruct+0x4c/0x80 [ 30.066703] ? __sk_free+0x5c/0x230 [ 30.070323] ? sk_free+0x2f/0x40 [ 30.073669] ? __tun_detach+0x176/0x1390 [ 30.077716] ? tun_attach+0xf90/0xf90 [ 30.081500] ? do_raw_spin_trylock+0x190/0x190 [ 30.086066] ? locks_remove_file+0x3fa/0x5a0 [ 30.090460] ? fcntl_setlk+0x10d0/0x10d0 [ 30.094501] ? __fsnotify_parent+0xb4/0x3a0 [ 30.098802] ? fsnotify+0x1af0/0x1af0 [ 30.102587] ? rcu_note_context_switch+0x710/0x710 [ 30.107509] ? __tun_detach+0x1390/0x1390 [ 30.111647] ? __tun_detach+0x1390/0x1390 [ 30.115788] rtnl_unlock+0xe/0x10 [ 30.119232] tun_chr_close+0x49/0x60 [ 30.122941] __fput+0x333/0x7f0 [ 30.126199] ? fput+0x140/0x140 [ 30.129469] ? check_same_owner+0x320/0x320 [ 30.133775] ? _raw_spin_unlock_irq+0x27/0x70 [ 30.138441] ____fput+0x15/0x20 [ 30.141718] task_work_run+0x199/0x270 [ 30.145593] ? task_work_cancel+0x210/0x210 [ 30.149895] ? _raw_spin_unlock+0x22/0x30 [ 30.154026] ? switch_task_namespaces+0x87/0xc0 [ 30.158680] do_exit+0xa52/0x1b40 [ 30.162114] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 30.167120] ? trace_hardirqs_on+0xd/0x10 [ 30.171255] ? __handle_mm_fault+0xe21/0x39c0 [ 30.175734] ? mm_update_next_owner+0x930/0x930 [ 30.180395] ? lock_release+0xd70/0xd70 [ 30.184356] ? check_noncircular+0x20/0x20 [ 30.188591] ? tun_chr_read_iter+0x1e0/0x1e0 [ 30.193170] ? check_noncircular+0x20/0x20 [ 30.197388] ? __handle_mm_fault+0x587/0x39c0 [ 30.201866] ? __pmd_alloc+0x4e0/0x4e0 [ 30.205740] ? find_held_lock+0x39/0x1d0 [ 30.209789] ? lock_downgrade+0x990/0x990 [ 30.213930] ? handle_mm_fault+0x4a2/0x860 [ 30.218158] ? down_read_trylock+0xdb/0x170 [ 30.222460] ? __handle_mm_fault+0x39c0/0x39c0 [ 30.227025] ? vmacache_find+0x61/0x270 [ 30.230979] do_group_exit+0x149/0x400 [ 30.234852] ? lockdep_sys_exit+0x1c4/0x2b0 [ 30.239167] ? SyS_exit+0x30/0x30