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-6,10.128.15.219' (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: [ 31.932469] ================================================================== [ 31.933722] BUG: KASAN: use-after-free in detach_if_pending+0x557/0x610 [ 31.934628] Write of size 8 at addr ffff8801cf7ab800 by task syzkaller776517/2985 [ 31.935722] [ 31.935960] CPU: 1 PID: 2985 Comm: syzkaller776517 Not tainted 4.13.0-next-20170907+ #17 [ 31.937123] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 31.938377] Call Trace: [ 31.938742] dump_stack+0x194/0x257 [ 31.939253] ? arch_local_irq_restore+0x53/0x53 [ 31.939906] ? show_regs_print_info+0x65/0x65 [ 31.940543] ? lock_timer_base+0x1a3/0x2b0 [ 31.941115] ? detach_if_pending+0x557/0x610 [ 31.941709] print_address_description+0x73/0x250 [ 31.942470] ? detach_if_pending+0x557/0x610 [ 31.943082] kasan_report+0x24e/0x340 [ 31.943614] __asan_report_store8_noabort+0x17/0x20 [ 31.944324] detach_if_pending+0x557/0x610 [ 31.946238] ? trace_raw_output_tick_stop+0x130/0x130 [ 31.946985] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 31.947608] ? lock_timer_base+0x1a3/0x2b0 [ 31.948178] ? lock_timer_base+0x1eb/0x2b0 [ 31.948769] ? __internal_add_timer+0x2d0/0x2d0 [ 31.949439] ? trace_hardirqs_on+0xd/0x10 [ 31.950004] try_to_del_timer_sync+0xa2/0x120 [ 31.950619] ? del_timer+0x130/0x130 [ 31.951124] ? del_timer_sync+0xeb/0x240 [ 31.951740] del_timer_sync+0x18a/0x240 [ 31.952302] tun_free_netdev+0x105/0x1b0 [ 31.954327] ? tun_xdp+0x410/0x410 [ 31.957838] ? cpumask_next+0x24/0x30 [ 31.961611] ? netdev_refcnt_read+0xed/0x150 [ 31.965997] ? tun_xdp+0x410/0x410 [ 31.969512] netdev_run_todo+0x870/0xca0 [ 31.973562] ? do_group_exit+0x149/0x400 [ 31.977608] ? register_netdev+0x30/0x30 [ 31.981664] ? lock_downgrade+0x990/0x990 [ 31.985799] ? trace_hardirqs_on+0xd/0x10 [ 31.990296] ? refcount_sub_and_test+0x115/0x1b0 [ 31.995029] ? refcount_inc+0x50/0x50 [ 31.998813] ? refcount_inc+0x50/0x50 [ 32.002763] ? sk_destruct+0x4c/0x80 [ 32.006454] ? __sk_free+0x5c/0x230 [ 32.010062] ? sk_free+0x2f/0x40 [ 32.013405] ? __tun_detach+0x176/0x1390 [ 32.017707] ? tun_attach+0xf90/0xf90 [ 32.021495] ? locks_remove_file+0x3fa/0x5a0 [ 32.025879] ? fcntl_setlk+0x10d0/0x10d0 [ 32.029925] ? __fsnotify_parent+0xb4/0x3a0 [ 32.034221] ? fsnotify+0x1af0/0x1af0 [ 32.038000] ? __tun_detach+0x1390/0x1390 [ 32.042120] ? __tun_detach+0x1390/0x1390 [ 32.046244] rtnl_unlock+0xe/0x10 [ 32.049669] tun_chr_close+0x49/0x60 [ 32.053359] __fput+0x333/0x7f0 [ 32.056968] ? fput+0x140/0x140 [ 32.060325] ? check_same_owner+0x320/0x320 [ 32.064645] ____fput+0x15/0x20 [ 32.067904] task_work_run+0x199/0x270 [ 32.071771] ? task_work_cancel+0x210/0x210 [ 32.076072] ? free_nsproxy+0x185/0x1f0 [ 32.080024] ? switch_task_namespaces+0xa2/0xc0 [ 32.084669] do_exit+0xa52/0x1b40 [ 32.088100] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 32.093105] ? check_noncircular+0x20/0x20 [ 32.097323] ? mm_update_next_owner+0x930/0x930 [ 32.101966] ? __pmd_alloc+0x4e0/0x4e0 [ 32.105835] ? find_held_lock+0x39/0x1d0 [ 32.109882] ? lock_downgrade+0x990/0x990 [ 32.114028] ? handle_mm_fault+0x410/0x8d0 [ 32.118233] ? down_read_trylock+0xdb/0x170 [ 32.122537] ? __handle_mm_fault+0x39c0/0x39c0 [ 32.127099] ? vmacache_find+0x61/0x270 [ 32.131046] ? vmacache_update+0xfe/0x130 [ 32.135184] ? up_read+0x1a/0x40 [ 32.138534] ? __do_page_fault+0x35b/0xb60 [ 32.142748] ? do_vfs_ioctl+0x492/0x1530 [ 32.146802] ? do_page_fault+0xee/0x720 [ 32.150751] ? __do_page_fault+0xb60/0xb60 [ 32.154968] ? putname+0xf3/0x130 [ 32.158411] do_group_exit+0x149/0x400 [ 32.162275] ? lockdep_sys_exit+0x47/0xf0 [ 32.166396] ? SyS_exit+0x30/0x30 [ 32.169826] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 32.174826] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 32.179563] SyS_exit_group+0x1d/0x20 [ 32.183339] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 32.188066] RIP: 0033:0x445129 [ 32.191228] RSP: 002b:00000000007efe48 EFLAGS: 00000206 ORIG_RAX: 00000000000000e7 [ 32.198911] RAX: ffffffffffffffda RBX: f0d4311420b33096 RCX: 0000000000445129 [ 32.206154] RDX: 0000000000445129 RSI: 00000000206f8000 RDI: 0000000000000001 [ 32.213399] RBP: 0000000000000082 R08: 0000000000000000 R09: 0000000000000000 [ 32.220643] R10: 0000000000000000 R11: 0000000000000206 R12: 0000000000402780 [ 32.227897] R13: 0000000000402810 R14: 0000000000000000 R15: 0000000000000000 [ 32.235158] [ 32.236760] Allocated by task 2985: [ 32.240360] save_stack_trace+0x16/0x20 [ 32.244308] save_stack+0x43/0xd0 [ 32.247731] kasan_kmalloc+0xad/0xe0 [ 32.251419] __kmalloc_node+0x47/0x70 [ 32.255204] kvmalloc_node+0x64/0xd0 [ 32.258891] alloc_netdev_mqs+0x16e/0xed0 [ 32.263012] __tun_chr_ioctl+0x12be/0x3d20 [ 32.267217] tun_chr_ioctl+0x2a/0x40 [ 32.270903] do_vfs_ioctl+0x1b1/0x1530 [ 32.274764] SyS_ioctl+0x8f/0xc0 [ 32.278102] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 32.282825] [ 32.284427] Freed by task 2985: [ 32.287677] save_stack_trace+0x16/0x20 [ 32.291624] save_stack+0x43/0xd0 [ 32.295060] kasan_slab_free+0x71/0xc0 [ 32.298920] kfree+0xca/0x250 [ 32.301998] kvfree+0x36/0x60 [ 32.305077] free_netdev+0x2cf/0x360 [ 32.308762] __tun_chr_ioctl+0x2cf6/0x3d20 [ 32.312967] tun_chr_ioctl+0x2a/0x40 [ 32.316663] do_vfs_ioctl+0x1b1/0x1530 [ 32.320533] SyS_ioctl+0x8f/0xc0 [ 32.323885] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 32.328613] [ 32.330215] The buggy address belongs to the object at ffff8801cf7a8400 [ 32.330215] which belongs to the cache kmalloc-16384 of size 16384 [ 32.343196] The buggy address is located 13312 bytes inside of [ 32.343196] 16384-byte region [ffff8801cf7a8400, ffff8801cf7ac400) [ 32.355390] The buggy address belongs to the page: [ 32.360295] page:ffffea00073dea00 count:1 mapcount:0 mapping:ffff8801cf7a8400 index:0x0 compound_mapcount: 0 [ 32.370245] flags: 0x200000000008100(slab|head) [ 32.374887] raw: 0200000000008100 ffff8801cf7a8400 0000000000000000 0000000100000001 [ 32.382743] raw: ffffea000738a220 ffff8801dac01c50 ffff8801dac02200 0000000000000000 [ 32.390596] page dumped because: kasan: bad access detected [ 32.396277] [ 32.397877] Memory state around the buggy address: [ 32.402775] ffff8801cf7ab700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 32.410106] ffff8801cf7ab780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 32.417438] >ffff8801cf7ab800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 32.424771] ^ [ 32.428108] ffff8801cf7ab880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 32.435440] ffff8801cf7ab900: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 32.442770] ================================================================== [ 32.450102] Disabling lock debugging due to kernel taint [ 32.455516] Kernel panic - not syncing: panic_on_warn set ... [ 32.455516] [ 32.462847] CPU: 1 PID: 2985 Comm: syzkaller776517 Tainted: G B 4.13.0-next-20170907+ #17 [ 32.472256] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 32.481583] Call Trace: [ 32.484141] dump_stack+0x194/0x257 [ 32.487745] ? arch_local_irq_restore+0x53/0x53 [ 32.492383] ? vprintk_default+0x28/0x30 [ 32.496415] ? detach_if_pending+0x530/0x610 [ 32.500792] panic+0x1e4/0x417 [ 32.503953] ? __warn+0x1d9/0x1d9 [ 32.507380] ? detach_if_pending+0x557/0x610 [ 32.511764] kasan_end_report+0x50/0x50 [ 32.515715] kasan_report+0x137/0x340 [ 32.519487] __asan_report_store8_noabort+0x17/0x20 [ 32.524469] detach_if_pending+0x557/0x610 [ 32.528675] ? trace_raw_output_tick_stop+0x130/0x130 [ 32.533832] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 32.538469] ? lock_timer_base+0x1a3/0x2b0 [ 32.542669] ? lock_timer_base+0x1eb/0x2b0 [ 32.546873] ? __internal_add_timer+0x2d0/0x2d0 [ 32.551510] ? trace_hardirqs_on+0xd/0x10 [ 32.555629] try_to_del_timer_sync+0xa2/0x120 [ 32.560094] ? del_timer+0x130/0x130 [ 32.563862] ? del_timer_sync+0xeb/0x240 [ 32.567894] del_timer_sync+0x18a/0x240 [ 32.571838] tun_free_netdev+0x105/0x1b0 [ 32.575865] ? tun_xdp+0x410/0x410 [ 32.579371] ? cpumask_next+0x24/0x30 [ 32.583153] ? netdev_refcnt_read+0xed/0x150 [ 32.587530] ? tun_xdp+0x410/0x410 [ 32.591039] netdev_run_todo+0x870/0xca0 [ 32.595076] ? do_group_exit+0x149/0x400 [ 32.599116] ? register_netdev+0x30/0x30 [ 32.603146] ? lock_downgrade+0x990/0x990 [ 32.607260] ? trace_hardirqs_on+0xd/0x10 [ 32.611387] ? refcount_sub_and_test+0x115/0x1b0 [ 32.616123] ? refcount_inc+0x50/0x50 [ 32.619888] ? refcount_inc+0x50/0x50 [ 32.623657] ? sk_destruct+0x4c/0x80 [ 32.627336] ? __sk_free+0x5c/0x230 [ 32.630928] ? sk_free+0x2f/0x40 [ 32.634267] ? __tun_detach+0x176/0x1390 [ 32.638304] ? tun_attach+0xf90/0xf90 [ 32.642078] ? locks_remove_file+0x3fa/0x5a0 [ 32.646473] ? fcntl_setlk+0x10d0/0x10d0 [ 32.650512] ? __fsnotify_parent+0xb4/0x3a0 [ 32.654800] ? fsnotify+0x1af0/0x1af0 [ 32.658570] ? __tun_detach+0x1390/0x1390 [ 32.662683] ? __tun_detach+0x1390/0x1390 [ 32.666808] rtnl_unlock+0xe/0x10 [ 32.670227] tun_chr_close+0x49/0x60 [ 32.673909] __fput+0x333/0x7f0 [ 32.677168] ? fput+0x140/0x140 [ 32.680415] ? check_same_owner+0x320/0x320 [ 32.684706] ____fput+0x15/0x20 [ 32.687952] task_work_run+0x199/0x270 [ 32.691816] ? task_work_cancel+0x210/0x210 [ 32.696106] ? free_nsproxy+0x185/0x1f0 [ 32.700048] ? switch_task_namespaces+0xa2/0xc0 [ 32.704684] do_exit+0xa52/0x1b40 [ 32.708106] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 32.713090] ? check_noncircular+0x20/0x20 [ 32.717296] ? mm_update_next_owner+0x930/0x930 [ 32.721932] ? __pmd_alloc+0x4e0/0x4e0 [ 32.725802] ? find_held_lock+0x39/0x1d0 [ 32.729836] ? lock_downgrade+0x990/0x990 [ 32.733961] ? handle_mm_fault+0x410/0x8d0 [ 32.738171] ? down_read_trylock+0xdb/0x170 [ 32.742463] ? __handle_mm_fault+0x39c0/0x39c0 [ 32.747024] ? vmacache_find+0x61/0x270 [ 32.750972] ? vmacache_update+0xfe/0x130 [ 32.755090] ? up_read+0x1a/0x40 [ 32.758424] ? __do_page_fault+0x35b/0xb60 [ 32.762625] ? do_vfs_ioctl+0x492/0x1530 [ 32.766657] ? do_page_fault+0xee/0x720 [ 32.770597] ? __do_page_fault+0xb60/0xb60 [ 32.774797] ? putname+0xf3/0x130 [ 32.778220] do_group_exit+0x149/0x400 [ 32.782075] ? lockdep_sys_exit+0x47/0xf0 [ 32.786190] ? SyS_exit+0x30/0x30 [ 32.789610] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 32.794595] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 32.799318] SyS_exit_group+0x1d/0x20 [ 32.803089] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 32.807905] RIP: 0033:0x445129 [ 32.811068] RSP: 002b:00000000007efe48 EFLAGS: 00000206 ORIG_RAX: 00000000000000e7 [ 32.818744] RAX: ffffffffffffffda RBX: f0d4311420b33096 RCX: 0000000000445129 [ 32.825983] RDX: 0000000000445129 RSI: 00000000206f8000 RDI: 0000000000000001 [ 32.833220] RBP: 0000000000000082 R08: 0000000000000000 R09: 0000000000000000 [ 32.840456] R10: 0000000000000000 R11: 0000000000000206 R12: 0000000000402780 [ 32.847698] R13: 0000000000402810 R14: 0000000000000000 R15: 0000000000000000