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-4,10.128.0.9' (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: [ 53.119258] ================================================================== [ 53.120449] BUG: KASAN: use-after-free in detach_if_pending+0x557/0x610 [ 53.121367] Write of size 8 at addr ffff8801cf04b7c0 by task syzkaller826880/2986 [ 53.122369] [ 53.122608] CPU: 1 PID: 2986 Comm: syzkaller826880 Not tainted 4.13.0-rc7-next-20170901+ #13 [ 53.123735] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 53.125008] Call Trace: [ 53.125372] dump_stack+0x194/0x257 [ 53.125868] ? arch_local_irq_restore+0x53/0x53 [ 53.126496] ? show_regs_print_info+0x65/0x65 [ 53.127112] ? lock_timer_base+0x1a3/0x2b0 [ 53.127685] ? detach_if_pending+0x557/0x610 [ 53.128280] print_address_description+0x73/0x250 [ 53.128929] ? detach_if_pending+0x557/0x610 [ 53.129523] kasan_report+0x24e/0x340 [ 53.130055] __asan_report_store8_noabort+0x17/0x20 [ 53.130726] detach_if_pending+0x557/0x610 [ 53.131299] ? trace_raw_output_tick_stop+0x130/0x130 [ 53.132014] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 53.132640] ? lock_timer_base+0x1a3/0x2b0 [ 53.133211] ? lock_timer_base+0x1eb/0x2b0 [ 53.133787] ? __internal_add_timer+0x2d0/0x2d0 [ 53.134428] ? trace_hardirqs_on+0xd/0x10 [ 53.134995] try_to_del_timer_sync+0xa2/0x120 [ 53.135610] ? del_timer+0x130/0x130 [ 53.136118] ? del_timer_sync+0xeb/0x240 [ 53.136673] del_timer_sync+0x18a/0x240 [ 53.137248] tun_free_netdev+0x105/0x1b0 [ 53.137799] ? tun_xdp+0x410/0x410 [ 53.138278] ? cpumask_next+0x24/0x30 [ 53.138809] ? netdev_refcnt_read+0xed/0x150 [ 53.139442] ? tun_xdp+0x410/0x410 [ 53.142956] netdev_run_todo+0x870/0xca0 [ 53.146990] ? do_group_exit+0x149/0x400 [ 53.151032] ? register_netdev+0x30/0x30 [ 53.155069] ? lock_downgrade+0x990/0x990 [ 53.159201] ? trace_hardirqs_on+0xd/0x10 [ 53.163345] ? refcount_sub_and_test+0x115/0x1b0 [ 53.168076] ? refcount_inc+0x50/0x50 [ 53.171972] ? refcount_inc+0x50/0x50 [ 53.175758] ? sk_destruct+0x4c/0x80 [ 53.179456] ? __sk_free+0x5c/0x230 [ 53.183066] ? sk_free+0x2f/0x40 [ 53.186417] ? __tun_detach+0x176/0x1390 [ 53.190468] ? tun_attach+0xf90/0xf90 [ 53.194254] ? locks_remove_file+0x3fa/0x5a0 [ 53.198639] ? fcntl_setlk+0x10d0/0x10d0 [ 53.202678] ? __fsnotify_parent+0xb4/0x3a0 [ 53.206976] ? fsnotify+0x1af0/0x1af0 [ 53.210753] ? rcu_note_context_switch+0x710/0x710 [ 53.215668] ? __tun_detach+0x1390/0x1390 [ 53.219790] ? __tun_detach+0x1390/0x1390 [ 53.223924] rtnl_unlock+0xe/0x10 [ 53.227351] tun_chr_close+0x49/0x60 [ 53.231047] __fput+0x333/0x7f0 [ 53.234303] ? fput+0x140/0x140 [ 53.237558] ? check_same_owner+0x320/0x320 [ 53.241880] ____fput+0x15/0x20 [ 53.245133] task_work_run+0x199/0x270 [ 53.248995] ? task_work_cancel+0x210/0x210 [ 53.253290] ? free_nsproxy+0x185/0x1f0 [ 53.257238] ? switch_task_namespaces+0xa2/0xc0 [ 53.261885] do_exit+0xa52/0x1b40 [ 53.265313] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 53.270301] ? check_noncircular+0x20/0x20 [ 53.274516] ? mm_update_next_owner+0x930/0x930 [ 53.279167] ? __pmd_alloc+0x4e0/0x4e0 [ 53.283038] ? find_held_lock+0x39/0x1d0 [ 53.287091] ? lock_downgrade+0x990/0x990 [ 53.291230] ? handle_mm_fault+0x4a2/0x860 [ 53.295434] ? down_read_trylock+0xdb/0x170 [ 53.299728] ? __handle_mm_fault+0x39c0/0x39c0 [ 53.304280] ? vmacache_find+0x61/0x270 [ 53.308224] ? vmacache_update+0xfe/0x130 [ 53.312353] ? up_read+0x1a/0x40 [ 53.315691] ? __do_page_fault+0x35b/0xb60 [ 53.319896] ? do_vfs_ioctl+0x492/0x1530 [ 53.323947] ? do_page_fault+0xee/0x720 [ 53.327901] ? __do_page_fault+0xb60/0xb60 [ 53.332116] ? putname+0xf3/0x130 [ 53.335553] do_group_exit+0x149/0x400 [ 53.339412] ? lockdep_sys_exit+0x47/0xf0 [ 53.343530] ? SyS_exit+0x30/0x30 [ 53.346955] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 53.352031] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 53.356770] SyS_exit_group+0x1d/0x20 [ 53.360545] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 53.365273] RIP: 0033:0x444db9 [ 53.368435] RSP: 002b:00007ffd7ae7b7f8 EFLAGS: 00000206 ORIG_RAX: 00000000000000e7 [ 53.376118] RAX: ffffffffffffffda RBX: 00007ffd7ae7b840 RCX: 0000000000444db9 [ 53.383379] RDX: 0000000000444db9 RSI: 00000000207dcfd8 RDI: 0000000000000001 [ 53.390633] RBP: 0000000000000082 R08: 0000000000000000 R09: 00007ffd7ae7b840 [ 53.397880] R10: 0000000000000000 R11: 0000000000000206 R12: 0000000000402160 [ 53.405127] R13: 00000000004021f0 R14: 0000000000000000 R15: 0000000000000000 [ 53.412393] [ 53.413999] Allocated by task 2986: [ 53.417631] save_stack_trace+0x16/0x20 [ 53.421580] save_stack+0x43/0xd0 [ 53.425005] kasan_kmalloc+0xad/0xe0 [ 53.428693] __kmalloc_node+0x47/0x70 [ 53.432469] kvmalloc_node+0x64/0xd0 [ 53.436158] alloc_netdev_mqs+0x16e/0xed0 [ 53.440288] __tun_chr_ioctl+0x12be/0x3d20 [ 53.444495] tun_chr_ioctl+0x2a/0x40 [ 53.448181] do_vfs_ioctl+0x1b1/0x1530 [ 53.452039] SyS_ioctl+0x8f/0xc0 [ 53.455379] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 53.460101] [ 53.461698] Freed by task 2986: [ 53.464950] save_stack_trace+0x16/0x20 [ 53.468895] save_stack+0x43/0xd0 [ 53.472315] kasan_slab_free+0x71/0xc0 [ 53.476179] kfree+0xca/0x250 [ 53.479253] kvfree+0x36/0x60 [ 53.482328] free_netdev+0x2cf/0x360 [ 53.486012] __tun_chr_ioctl+0x2cf6/0x3d20 [ 53.490216] tun_chr_ioctl+0x2a/0x40 [ 53.493919] do_vfs_ioctl+0x1b1/0x1530 [ 53.497774] SyS_ioctl+0x8f/0xc0 [ 53.501110] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 53.505832] [ 53.507431] The buggy address belongs to the object at ffff8801cf0483c0 [ 53.507431] which belongs to the cache kmalloc-16384 of size 16384 [ 53.520405] The buggy address is located 13312 bytes inside of [ 53.520405] 16384-byte region [ffff8801cf0483c0, ffff8801cf04c3c0) [ 53.532595] The buggy address belongs to the page: [ 53.537495] page:ffffea00073c1200 count:1 mapcount:0 mapping:ffff8801cf0483c0 index:0x0 compound_mapcount: 0 [ 53.547442] flags: 0x200000000008100(slab|head) [ 53.552085] raw: 0200000000008100 ffff8801cf0483c0 0000000000000000 0000000100000001 [ 53.559945] raw: ffffea000738f220 ffff8801dac01c50 ffff8801dac02200 0000000000000000 [ 53.567793] page dumped because: kasan: bad access detected [ 53.573475] [ 53.575073] Memory state around the buggy address: [ 53.579980] ffff8801cf04b680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 53.587308] ffff8801cf04b700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 53.594637] >ffff8801cf04b780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 53.601975] ^ [ 53.607394] ffff8801cf04b800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 53.614730] ffff8801cf04b880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 53.622056] ================================================================== [ 53.629384] Disabling lock debugging due to kernel taint [ 53.634798] Kernel panic - not syncing: panic_on_warn set ... [ 53.634798] [ 53.642135] CPU: 1 PID: 2986 Comm: syzkaller826880 Tainted: G B 4.13.0-rc7-next-20170901+ #13 [ 53.651887] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 53.661205] Call Trace: [ 53.663759] dump_stack+0x194/0x257 [ 53.667352] ? arch_local_irq_restore+0x53/0x53 [ 53.671989] ? vprintk_default+0x28/0x30 [ 53.676020] ? detach_if_pending+0x4e0/0x610 [ 53.680395] panic+0x1e4/0x417 [ 53.683552] ? __warn+0x1d9/0x1d9 [ 53.686991] ? detach_if_pending+0x557/0x610 [ 53.691364] kasan_end_report+0x50/0x50 [ 53.695303] kasan_report+0x137/0x340 [ 53.699070] __asan_report_store8_noabort+0x17/0x20 [ 53.704051] detach_if_pending+0x557/0x610 [ 53.708251] ? trace_raw_output_tick_stop+0x130/0x130 [ 53.713410] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 53.718050] ? lock_timer_base+0x1a3/0x2b0 [ 53.722250] ? lock_timer_base+0x1eb/0x2b0 [ 53.726450] ? __internal_add_timer+0x2d0/0x2d0 [ 53.731101] ? trace_hardirqs_on+0xd/0x10 [ 53.735217] try_to_del_timer_sync+0xa2/0x120 [ 53.739688] ? del_timer+0x130/0x130 [ 53.743369] ? del_timer_sync+0xeb/0x240 [ 53.747401] del_timer_sync+0x18a/0x240 [ 53.751341] tun_free_netdev+0x105/0x1b0 [ 53.755368] ? tun_xdp+0x410/0x410 [ 53.758871] ? cpumask_next+0x24/0x30 [ 53.762646] ? netdev_refcnt_read+0xed/0x150 [ 53.767036] ? tun_xdp+0x410/0x410 [ 53.770541] netdev_run_todo+0x870/0xca0 [ 53.774566] ? do_group_exit+0x149/0x400 [ 53.778613] ? register_netdev+0x30/0x30 [ 53.782648] ? lock_downgrade+0x990/0x990 [ 53.786762] ? trace_hardirqs_on+0xd/0x10 [ 53.790886] ? refcount_sub_and_test+0x115/0x1b0 [ 53.795606] ? refcount_inc+0x50/0x50 [ 53.799374] ? refcount_inc+0x50/0x50 [ 53.803144] ? sk_destruct+0x4c/0x80 [ 53.806822] ? __sk_free+0x5c/0x230 [ 53.810425] ? sk_free+0x2f/0x40 [ 53.813766] ? __tun_detach+0x176/0x1390 [ 53.817797] ? tun_attach+0xf90/0xf90 [ 53.821571] ? locks_remove_file+0x3fa/0x5a0 [ 53.825948] ? fcntl_setlk+0x10d0/0x10d0 [ 53.829979] ? __fsnotify_parent+0xb4/0x3a0 [ 53.834265] ? fsnotify+0x1af0/0x1af0 [ 53.838030] ? rcu_note_context_switch+0x710/0x710 [ 53.842923] ? __tun_detach+0x1390/0x1390 [ 53.847034] ? __tun_detach+0x1390/0x1390 [ 53.851146] rtnl_unlock+0xe/0x10 [ 53.854563] tun_chr_close+0x49/0x60 [ 53.858241] __fput+0x333/0x7f0 [ 53.861489] ? fput+0x140/0x140 [ 53.864735] ? check_same_owner+0x320/0x320 [ 53.869024] ____fput+0x15/0x20 [ 53.872270] task_work_run+0x199/0x270 [ 53.876124] ? task_work_cancel+0x210/0x210 [ 53.880412] ? free_nsproxy+0x185/0x1f0 [ 53.884353] ? switch_task_namespaces+0xa2/0xc0 [ 53.888991] do_exit+0xa52/0x1b40 [ 53.892409] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 53.897392] ? check_noncircular+0x20/0x20 [ 53.901596] ? mm_update_next_owner+0x930/0x930 [ 53.906229] ? __pmd_alloc+0x4e0/0x4e0 [ 53.910087] ? find_held_lock+0x39/0x1d0 [ 53.914116] ? lock_downgrade+0x990/0x990 [ 53.918238] ? handle_mm_fault+0x4a2/0x860 [ 53.922446] ? down_read_trylock+0xdb/0x170 [ 53.926738] ? __handle_mm_fault+0x39c0/0x39c0 [ 53.931285] ? vmacache_find+0x61/0x270 [ 53.935223] ? vmacache_update+0xfe/0x130 [ 53.939346] ? up_read+0x1a/0x40 [ 53.942692] ? __do_page_fault+0x35b/0xb60 [ 53.946892] ? do_vfs_ioctl+0x492/0x1530 [ 53.950921] ? do_page_fault+0xee/0x720 [ 53.954860] ? __do_page_fault+0xb60/0xb60 [ 53.959059] ? putname+0xf3/0x130 [ 53.962482] do_group_exit+0x149/0x400 [ 53.966344] ? lockdep_sys_exit+0x47/0xf0 [ 53.970461] ? SyS_exit+0x30/0x30 [ 53.973878] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 53.978861] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 53.983594] SyS_exit_group+0x1d/0x20 [ 53.987361] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 53.992453] RIP: 0033:0x444db9 [ 53.995616] RSP: 002b:00007ffd7ae7b7f8 EFLAGS: 00000206 ORIG_RAX: 00000000000000e7 [ 54.003292] RAX: ffffffffffffffda RBX: 00007ffd7ae7b840 RCX: 0000000000444db9 [ 54.010534] RDX: 0000000000444db9 RSI: 00000000207dcfd8 RDI: 0000000000000001 [ 54.017781] RBP: 0000000000000082 R08: 0000000000000000 R09: 00007ffd7ae7b840 [ 54.025019] R10: 0000000000000000 R11: 0000000000000206 R12: 0000000000402160 [ 54.032263] R13: 00000000004021f0 R14: 0000000000000000 R15: 0000000000000000