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-kasan-gce-0,10.128.0.3' (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.315546] ================================================================== [ 31.322963] BUG: KASAN: use-after-free in detach_if_pending+0x557/0x610 [ 31.329689] Write of size 8 at addr ffff8801ce55b7c0 by task syzkaller115454/2983 [ 31.337280] [ 31.338887] CPU: 0 PID: 2983 Comm: syzkaller115454 Not tainted 4.13.0+ #72 [ 31.345871] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 31.355290] Call Trace: [ 31.357854] dump_stack+0x194/0x257 [ 31.361460] ? arch_local_irq_restore+0x53/0x53 [ 31.366106] ? show_regs_print_info+0x65/0x65 [ 31.370581] ? lock_timer_base+0x1a3/0x2b0 [ 31.374791] ? detach_if_pending+0x557/0x610 [ 31.379174] print_address_description+0x73/0x250 [ 31.383995] ? detach_if_pending+0x557/0x610 [ 31.388374] kasan_report+0x24e/0x340 [ 31.392324] __asan_report_store8_noabort+0x17/0x20 [ 31.397311] detach_if_pending+0x557/0x610 [ 31.401519] ? __next_timer_interrupt+0x150/0x150 [ 31.406333] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 31.410983] ? lock_timer_base+0x1a3/0x2b0 [ 31.415191] ? lock_timer_base+0x1eb/0x2b0 [ 31.419402] ? __internal_add_timer+0x2d0/0x2d0 [ 31.424050] ? trace_hardirqs_on+0xd/0x10 [ 31.428180] try_to_del_timer_sync+0xa2/0x120 [ 31.432647] ? del_timer+0x130/0x130 [ 31.436340] ? del_timer_sync+0xeb/0x240 [ 31.440386] del_timer_sync+0x18a/0x240 [ 31.444337] tun_free_netdev+0x105/0x1b0 [ 31.448370] ? tun_xdp+0x410/0x410 [ 31.451891] ? netdev_refcnt_read+0xf4/0x160 [ 31.456276] ? tun_xdp+0x410/0x410 [ 31.459790] netdev_run_todo+0x870/0xca0 [ 31.463822] ? do_group_exit+0x149/0x400 [ 31.467859] ? register_netdev+0x30/0x30 [ 31.471895] ? lock_downgrade+0x990/0x990 [ 31.476023] ? trace_hardirqs_on+0xd/0x10 [ 31.480161] ? refcount_sub_and_test+0x115/0x1b0 [ 31.484887] ? refcount_inc+0x50/0x50 [ 31.488661] ? refcount_inc+0x50/0x50 [ 31.492441] ? sk_destruct+0x4c/0x80 [ 31.496124] ? __sk_free+0x5c/0x230 [ 31.499720] ? sk_free+0x2f/0x40 [ 31.503059] ? __tun_detach+0x176/0x1390 [ 31.507101] ? tun_attach+0xf90/0xf90 [ 31.510876] ? do_raw_spin_trylock+0x190/0x190 [ 31.515441] ? locks_remove_file+0x3fa/0x5a0 [ 31.519823] ? fcntl_setlk+0x10d0/0x10d0 [ 31.523857] ? __fsnotify_parent+0xb4/0x3a0 [ 31.528157] ? fsnotify+0x1af0/0x1af0 [ 31.531940] ? __tun_detach+0x1390/0x1390 [ 31.536059] ? __tun_detach+0x1390/0x1390 [ 31.540178] rtnl_unlock+0xe/0x10 [ 31.543601] tun_chr_close+0x49/0x60 [ 31.547285] __fput+0x333/0x7f0 [ 31.550543] ? fput+0x140/0x140 [ 31.553795] ? check_same_owner+0x320/0x320 [ 31.558093] ? _raw_spin_unlock_irq+0x27/0x70 [ 31.562571] ____fput+0x15/0x20 [ 31.565822] task_work_run+0x199/0x270 [ 31.569681] ? task_work_cancel+0x210/0x210 [ 31.573973] ? _raw_spin_unlock+0x22/0x30 [ 31.578091] ? switch_task_namespaces+0x87/0xc0 [ 31.582751] do_exit+0xa52/0x1b40 [ 31.586175] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 31.591177] ? check_noncircular+0x20/0x20 [ 31.595390] ? mm_update_next_owner+0x930/0x930 [ 31.600028] ? __pmd_alloc+0x4e0/0x4e0 [ 31.603895] ? find_held_lock+0x39/0x1d0 [ 31.607936] ? lock_downgrade+0x990/0x990 [ 31.612076] ? handle_mm_fault+0x4a2/0x860 [ 31.616278] ? down_read_trylock+0xdb/0x170 [ 31.620571] ? __handle_mm_fault+0x3840/0x3840 [ 31.625122] ? vmacache_find+0x61/0x270 [ 31.629075] ? up_read+0x1a/0x40 [ 31.632411] ? __do_page_fault+0x35b/0xb60 [ 31.636614] ? do_vfs_ioctl+0x492/0x1530 [ 31.640652] ? do_page_fault+0xee/0x720 [ 31.644605] ? __do_page_fault+0xb60/0xb60 [ 31.648817] ? putname+0xf3/0x130 [ 31.652255] do_group_exit+0x149/0x400 [ 31.656121] ? lockdep_sys_exit+0x47/0xf0 [ 31.660244] ? SyS_exit+0x30/0x30 [ 31.663767] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 31.669671] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 31.674404] SyS_exit_group+0x1d/0x20 [ 31.678175] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 31.682906] RIP: 0033:0x4436d8 [ 31.686067] RSP: 002b:00007ffdb28f3d08 EFLAGS: 00000246 ORIG_RAX: 00000000000000e7 [ 31.693750] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00000000004436d8 [ 31.700990] RDX: 0000000000000000 RSI: 000000000000003c RDI: 0000000000000000 [ 31.708231] RBP: 0000000000000082 R08: 00000000000000e7 R09: ffffffffffffffd0 [ 31.715481] R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000001 [ 31.722722] R13: 00000000006d6180 R14: 0000000000000000 R15: 0000000000000000 [ 31.729979] [ 31.731587] Allocated by task 2983: [ 31.735188] save_stack_trace+0x16/0x20 [ 31.739132] save_stack+0x43/0xd0 [ 31.742554] kasan_kmalloc+0xad/0xe0 [ 31.746240] __kmalloc_node+0x47/0x70 [ 31.750010] kvmalloc_node+0x64/0xd0 [ 31.753699] alloc_netdev_mqs+0x16e/0xed0 [ 31.757827] __tun_chr_ioctl+0x12be/0x3d40 [ 31.762033] tun_chr_ioctl+0x2a/0x40 [ 31.765714] do_vfs_ioctl+0x1b1/0x1530 [ 31.769568] SyS_ioctl+0x8f/0xc0 [ 31.772905] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 31.777627] [ 31.779226] Freed by task 2983: [ 31.782477] save_stack_trace+0x16/0x20 [ 31.786427] save_stack+0x43/0xd0 [ 31.789848] kasan_slab_free+0x71/0xc0 [ 31.793704] kfree+0xca/0x250 [ 31.796778] kvfree+0x36/0x60 [ 31.799853] free_netdev+0x2cf/0x360 [ 31.803534] __tun_chr_ioctl+0x2cff/0x3d40 [ 31.807737] tun_chr_ioctl+0x2a/0x40 [ 31.811421] do_vfs_ioctl+0x1b1/0x1530 [ 31.815276] SyS_ioctl+0x8f/0xc0 [ 31.818623] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 31.823362] [ 31.824966] The buggy address belongs to the object at ffff8801ce5583c0 [ 31.824966] which belongs to the cache kmalloc-16384 of size 16384 [ 31.837938] The buggy address is located 13312 bytes inside of [ 31.837938] 16384-byte region [ffff8801ce5583c0, ffff8801ce55c3c0) [ 31.850127] The buggy address belongs to the page: [ 31.855033] page:ffffea0007395600 count:1 mapcount:0 mapping:ffff8801ce5583c0 index:0x0 compound_mapcount: 0 [ 31.864984] flags: 0x200000000008100(slab|head) [ 31.869625] raw: 0200000000008100 ffff8801ce5583c0 0000000000000000 0000000100000001 [ 31.877475] raw: ffffea00073c3020 ffff8801dac01c50 ffff8801dac02200 0000000000000000 [ 31.885495] page dumped because: kasan: bad access detected [ 31.891174] [ 31.892788] Memory state around the buggy address: [ 31.897692] ffff8801ce55b680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 31.905019] ffff8801ce55b700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 31.912347] >ffff8801ce55b780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 31.919681] ^ [ 31.925102] ffff8801ce55b800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 31.932437] ffff8801ce55b880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 31.939761] ================================================================== [ 31.947093] Disabling lock debugging due to kernel taint [ 31.952507] Kernel panic - not syncing: panic_on_warn set ... [ 31.952507] [ 31.959835] CPU: 0 PID: 2983 Comm: syzkaller115454 Tainted: G B 4.13.0+ #72 [ 31.968026] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 31.977344] Call Trace: [ 31.979911] dump_stack+0x194/0x257 [ 31.983506] ? arch_local_irq_restore+0x53/0x53 [ 31.988142] ? vprintk_default+0x28/0x30 [ 31.992170] ? detach_if_pending+0x4f0/0x610 [ 31.996544] panic+0x1e4/0x417 [ 31.999707] ? __warn+0x1d9/0x1d9 [ 32.003139] ? detach_if_pending+0x557/0x610 [ 32.007512] kasan_end_report+0x50/0x50 [ 32.011453] kasan_report+0x137/0x340 [ 32.015232] __asan_report_store8_noabort+0x17/0x20 [ 32.020213] detach_if_pending+0x557/0x610 [ 32.024415] ? __next_timer_interrupt+0x150/0x150 [ 32.029227] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 32.033947] ? lock_timer_base+0x1a3/0x2b0 [ 32.038157] ? lock_timer_base+0x1eb/0x2b0 [ 32.042367] ? __internal_add_timer+0x2d0/0x2d0 [ 32.047004] ? trace_hardirqs_on+0xd/0x10 [ 32.051120] try_to_del_timer_sync+0xa2/0x120 [ 32.055586] ? del_timer+0x130/0x130 [ 32.059265] ? del_timer_sync+0xeb/0x240 [ 32.063300] del_timer_sync+0x18a/0x240 [ 32.067245] tun_free_netdev+0x105/0x1b0 [ 32.071367] ? tun_xdp+0x410/0x410 [ 32.074873] ? netdev_refcnt_read+0xf4/0x160 [ 32.079250] ? tun_xdp+0x410/0x410 [ 32.082758] netdev_run_todo+0x870/0xca0 [ 32.086785] ? do_group_exit+0x149/0x400 [ 32.090814] ? register_netdev+0x30/0x30 [ 32.094942] ? lock_downgrade+0x990/0x990 [ 32.099063] ? trace_hardirqs_on+0xd/0x10 [ 32.103187] ? refcount_sub_and_test+0x115/0x1b0 [ 32.107906] ? refcount_inc+0x50/0x50 [ 32.111670] ? refcount_inc+0x50/0x50 [ 32.115446] ? sk_destruct+0x4c/0x80 [ 32.119212] ? __sk_free+0x5c/0x230 [ 32.122808] ? sk_free+0x2f/0x40 [ 32.126313] ? __tun_detach+0x176/0x1390 [ 32.130434] ? tun_attach+0xf90/0xf90 [ 32.134202] ? do_raw_spin_trylock+0x190/0x190 [ 32.138751] ? locks_remove_file+0x3fa/0x5a0 [ 32.143125] ? fcntl_setlk+0x10d0/0x10d0 [ 32.147154] ? __fsnotify_parent+0xb4/0x3a0 [ 32.151448] ? fsnotify+0x1af0/0x1af0 [ 32.155226] ? __tun_detach+0x1390/0x1390 [ 32.159437] ? __tun_detach+0x1390/0x1390 [ 32.163562] rtnl_unlock+0xe/0x10 [ 32.166994] tun_chr_close+0x49/0x60 [ 32.170671] __fput+0x333/0x7f0 [ 32.173925] ? fput+0x140/0x140 [ 32.177173] ? check_same_owner+0x320/0x320 [ 32.181461] ? _raw_spin_unlock_irq+0x27/0x70 [ 32.185930] ____fput+0x15/0x20 [ 32.189173] task_work_run+0x199/0x270 [ 32.193027] ? task_work_cancel+0x210/0x210 [ 32.197312] ? _raw_spin_unlock+0x22/0x30 [ 32.201422] ? switch_task_namespaces+0x87/0xc0 [ 32.206057] do_exit+0xa52/0x1b40 [ 32.209480] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 32.214462] ? check_noncircular+0x20/0x20 [ 32.218664] ? mm_update_next_owner+0x930/0x930 [ 32.223298] ? __pmd_alloc+0x4e0/0x4e0 [ 32.227156] ? find_held_lock+0x39/0x1d0 [ 32.231189] ? lock_downgrade+0x990/0x990 [ 32.235313] ? handle_mm_fault+0x4a2/0x860 [ 32.239512] ? down_read_trylock+0xdb/0x170 [ 32.243799] ? __handle_mm_fault+0x3840/0x3840 [ 32.248343] ? vmacache_find+0x61/0x270 [ 32.252286] ? up_read+0x1a/0x40 [ 32.255617] ? __do_page_fault+0x35b/0xb60 [ 32.259821] ? do_vfs_ioctl+0x492/0x1530 [ 32.263851] ? do_page_fault+0xee/0x720 [ 32.267790] ? __do_page_fault+0xb60/0xb60 [ 32.272006] ? putname+0xf3/0x130 [ 32.275428] do_group_exit+0x149/0x400 [ 32.279289] ? lockdep_sys_exit+0x47/0xf0 [ 32.283402] ? SyS_exit+0x30/0x30 [ 32.286820] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 32.291805] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 32.296527] SyS_exit_group+0x1d/0x20 [ 32.300294] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 32.305012] RIP: 0033:0x4436d8 [ 32.308181] RSP: 002b:00007ffdb28f3d08 EFLAGS: 00000246 ORIG_RAX: 00000000000000e7