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-mmots-kasan-gce-6,10.128.0.20' (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: [ 48.658489] ================================================================== [ 48.659634] BUG: KASAN: use-after-free in detach_if_pending+0x557/0x610 [ 48.660526] Write of size 8 at addr ffff8801ce2cb780 by task syzkaller115127/2980 [ 48.661527] [ 48.661762] CPU: 0 PID: 2980 Comm: syzkaller115127 Not tainted 4.13.0-mm1+ #7 [ 48.662746] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 48.664003] Call Trace: [ 48.664364] dump_stack+0x194/0x257 [ 48.664859] ? arch_local_irq_restore+0x53/0x53 [ 48.665484] ? show_regs_print_info+0x65/0x65 [ 48.666091] ? lock_timer_base+0x1a3/0x2b0 [ 48.666666] ? detach_if_pending+0x557/0x610 [ 48.667278] print_address_description+0x73/0x250 [ 48.667926] ? detach_if_pending+0x557/0x610 [ 48.668520] kasan_report+0x24e/0x340 [ 48.669040] __asan_report_store8_noabort+0x17/0x20 [ 48.669725] detach_if_pending+0x557/0x610 [ 48.670309] ? trace_raw_output_tick_stop+0x130/0x130 [ 48.671004] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 48.671626] ? lock_timer_base+0x1a3/0x2b0 [ 48.672212] ? lock_timer_base+0x1eb/0x2b0 [ 48.672817] ? __internal_add_timer+0x2d0/0x2d0 [ 48.673490] ? trace_hardirqs_on+0xd/0x10 [ 48.674058] try_to_del_timer_sync+0xa2/0x120 [ 48.674679] ? del_timer+0x130/0x130 [ 48.675184] ? del_timer_sync+0xeb/0x240 [ 48.675765] del_timer_sync+0x18a/0x240 [ 48.676308] tun_free_netdev+0x105/0x1b0 [ 48.676856] ? tun_xdp+0x410/0x410 [ 48.677336] ? cpumask_next+0x24/0x30 [ 48.677851] ? netdev_refcnt_read+0xed/0x150 [ 48.678447] ? tun_xdp+0x410/0x410 [ 48.681032] netdev_run_todo+0x870/0xca0 [ 48.685068] ? do_group_exit+0x149/0x400 [ 48.689109] ? register_netdev+0x30/0x30 [ 48.693143] ? lock_downgrade+0x990/0x990 [ 48.697261] ? trace_hardirqs_on+0xd/0x10 [ 48.701400] ? refcount_sub_and_test+0x115/0x1b0 [ 48.706126] ? refcount_inc+0x50/0x50 [ 48.709896] ? refcount_inc+0x50/0x50 [ 48.713671] ? sk_destruct+0x4c/0x80 [ 48.717354] ? __sk_free+0x5c/0x230 [ 48.720951] ? sk_free+0x2f/0x40 [ 48.724291] ? __tun_detach+0x176/0x1390 [ 48.728333] ? tun_attach+0xf90/0xf90 [ 48.732114] ? locks_remove_file+0x3fa/0x5a0 [ 48.736494] ? fcntl_setlk+0x10d0/0x10d0 [ 48.740528] ? __fsnotify_parent+0xb4/0x3a0 [ 48.744824] ? fsnotify+0x1af0/0x1af0 [ 48.748597] ? __tun_detach+0x1390/0x1390 [ 48.752715] ? __tun_detach+0x1390/0x1390 [ 48.756832] rtnl_unlock+0xe/0x10 [ 48.760252] tun_chr_close+0x49/0x60 [ 48.763937] __fput+0x333/0x7f0 [ 48.767191] ? fput+0x140/0x140 [ 48.770444] ? check_same_owner+0x320/0x320 [ 48.774740] ____fput+0x15/0x20 [ 48.777990] task_work_run+0x199/0x270 [ 48.781848] ? task_work_cancel+0x210/0x210 [ 48.786148] ? free_nsproxy+0x185/0x1f0 [ 48.790093] ? switch_task_namespaces+0xa2/0xc0 [ 48.794736] do_exit+0xa52/0x1b40 [ 48.798161] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 48.803149] ? check_noncircular+0x20/0x20 [ 48.807362] ? mm_update_next_owner+0x930/0x930 [ 48.812001] ? __pmd_alloc+0x4e0/0x4e0 [ 48.815868] ? find_held_lock+0x39/0x1d0 [ 48.819909] ? lock_downgrade+0x990/0x990 [ 48.824047] ? handle_mm_fault+0x410/0x8d0 [ 48.828250] ? down_read_trylock+0xdb/0x170 [ 48.832545] ? __handle_mm_fault+0x39c0/0x39c0 [ 48.837102] ? vmacache_find+0x61/0x270 [ 48.841045] ? vmacache_update+0xfe/0x130 [ 48.845168] ? up_read+0x1a/0x40 [ 48.848504] ? __do_page_fault+0x35b/0xb60 [ 48.852707] ? do_vfs_ioctl+0x492/0x1530 [ 48.856746] ? do_page_fault+0xee/0x720 [ 48.860693] ? __do_page_fault+0xb60/0xb60 [ 48.864898] ? putname+0xf3/0x130 [ 48.868341] do_group_exit+0x149/0x400 [ 48.872199] ? lockdep_sys_exit+0x47/0xf0 [ 48.876314] ? SyS_exit+0x30/0x30 [ 48.879740] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 48.884728] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 48.889460] SyS_exit_group+0x1d/0x20 [ 48.893232] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 48.897956] RIP: 0033:0x445159 [ 48.901114] RSP: 002b:00000000007efe48 EFLAGS: 00000206 ORIG_RAX: 00000000000000e7 [ 48.908793] RAX: ffffffffffffffda RBX: 67c9d5257df1818c RCX: 0000000000445159 [ 48.916033] RDX: 0000000000445159 RSI: 0000000020074000 RDI: 0000000000000001 [ 48.923275] RBP: 0000000000000082 R08: 0000000000000000 R09: 0000000000000000 [ 48.930515] R10: 0000000000000000 R11: 0000000000000206 R12: 00000000004027b0 [ 48.937754] R13: 0000000000402840 R14: 0000000000000000 R15: 0000000000000000 [ 48.945009] [ 48.946607] Allocated by task 2980: [ 48.950204] save_stack_trace+0x16/0x20 [ 48.954161] save_stack+0x43/0xd0 [ 48.957583] kasan_kmalloc+0xad/0xe0 [ 48.961283] __kmalloc_node+0x47/0x70 [ 48.965052] kvmalloc_node+0x64/0xd0 [ 48.968735] alloc_netdev_mqs+0x16e/0xed0 [ 48.972850] __tun_chr_ioctl+0x12be/0x3d20 [ 48.977053] tun_chr_ioctl+0x2a/0x40 [ 48.980736] do_vfs_ioctl+0x1b1/0x1530 [ 48.984590] SyS_ioctl+0x8f/0xc0 [ 48.987927] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 48.992649] [ 48.994247] Freed by task 2980: [ 48.997497] save_stack_trace+0x16/0x20 [ 49.001442] save_stack+0x43/0xd0 [ 49.004862] kasan_slab_free+0x71/0xc0 [ 49.008717] kfree+0xca/0x250 [ 49.012139] kvfree+0x36/0x60 [ 49.015213] free_netdev+0x2cf/0x360 [ 49.018893] __tun_chr_ioctl+0x2cf6/0x3d20 [ 49.023104] tun_chr_ioctl+0x2a/0x40 [ 49.026784] do_vfs_ioctl+0x1b1/0x1530 [ 49.030639] SyS_ioctl+0x8f/0xc0 [ 49.033973] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 49.038694] [ 49.040293] The buggy address belongs to the object at ffff8801ce2c8380 [ 49.040293] which belongs to the cache kmalloc-16384 of size 16384 [ 49.053268] The buggy address is located 13312 bytes inside of [ 49.053268] 16384-byte region [ffff8801ce2c8380, ffff8801ce2cc380) [ 49.065454] The buggy address belongs to the page: [ 49.070350] page:ffffea000738b200 count:1 mapcount:0 mapping:ffff8801ce2c8380 index:0x0 compound_mapcount: 0 [ 49.080295] flags: 0x200000000008100(slab|head) [ 49.084934] raw: 0200000000008100 ffff8801ce2c8380 0000000000000000 0000000100000001 [ 49.092783] raw: ffffea0007388220 ffff8801dac01c50 ffff8801dac02200 0000000000000000 [ 49.100630] page dumped because: kasan: bad access detected [ 49.106306] [ 49.107903] Memory state around the buggy address: [ 49.112802] ffff8801ce2cb680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 49.120129] ffff8801ce2cb700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 49.127458] >ffff8801ce2cb780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 49.134787] ^ [ 49.138121] ffff8801ce2cb800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 49.145448] ffff8801ce2cb880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 49.152781] ================================================================== [ 49.160107] Disabling lock debugging due to kernel taint [ 49.165518] Kernel panic - not syncing: panic_on_warn set ... [ 49.165518] [ 49.172843] CPU: 0 PID: 2980 Comm: syzkaller115127 Tainted: G B 4.13.0-mm1+ #7 [ 49.181291] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 49.190608] Call Trace: [ 49.193162] dump_stack+0x194/0x257 [ 49.196760] ? arch_local_irq_restore+0x53/0x53 [ 49.201393] ? vprintk_default+0x28/0x30 [ 49.205421] ? detach_if_pending+0x550/0x610 [ 49.209796] panic+0x1e4/0x417 [ 49.212951] ? __warn+0x1d9/0x1d9 [ 49.216373] ? detach_if_pending+0x557/0x610 [ 49.220746] kasan_end_report+0x50/0x50 [ 49.224682] kasan_report+0x137/0x340 [ 49.228448] __asan_report_store8_noabort+0x17/0x20 [ 49.233428] detach_if_pending+0x557/0x610 [ 49.237627] ? trace_raw_output_tick_stop+0x130/0x130 [ 49.242780] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 49.247409] ? lock_timer_base+0x1a3/0x2b0 [ 49.251606] ? lock_timer_base+0x1eb/0x2b0 [ 49.255806] ? __internal_add_timer+0x2d0/0x2d0 [ 49.260439] ? trace_hardirqs_on+0xd/0x10 [ 49.264552] try_to_del_timer_sync+0xa2/0x120 [ 49.269010] ? del_timer+0x130/0x130 [ 49.272686] ? del_timer_sync+0xeb/0x240 [ 49.276719] del_timer_sync+0x18a/0x240 [ 49.280664] tun_free_netdev+0x105/0x1b0 [ 49.284685] ? tun_xdp+0x410/0x410 [ 49.288186] ? cpumask_next+0x24/0x30 [ 49.291952] ? netdev_refcnt_read+0xed/0x150 [ 49.296325] ? tun_xdp+0x410/0x410 [ 49.299828] netdev_run_todo+0x870/0xca0 [ 49.303852] ? do_group_exit+0x149/0x400 [ 49.307883] ? register_netdev+0x30/0x30 [ 49.311908] ? lock_downgrade+0x990/0x990 [ 49.316026] ? trace_hardirqs_on+0xd/0x10 [ 49.320157] ? refcount_sub_and_test+0x115/0x1b0 [ 49.324875] ? refcount_inc+0x50/0x50 [ 49.328638] ? refcount_inc+0x50/0x50 [ 49.332406] ? sk_destruct+0x4c/0x80 [ 49.336082] ? __sk_free+0x5c/0x230 [ 49.339671] ? sk_free+0x2f/0x40 [ 49.343001] ? __tun_detach+0x176/0x1390 [ 49.347031] ? tun_attach+0xf90/0xf90 [ 49.350798] ? locks_remove_file+0x3fa/0x5a0 [ 49.355171] ? fcntl_setlk+0x10d0/0x10d0 [ 49.359235] ? __fsnotify_parent+0xb4/0x3a0 [ 49.363524] ? fsnotify+0x1af0/0x1af0 [ 49.367290] ? __tun_detach+0x1390/0x1390 [ 49.371409] ? __tun_detach+0x1390/0x1390 [ 49.375519] rtnl_unlock+0xe/0x10 [ 49.378936] tun_chr_close+0x49/0x60 [ 49.382612] __fput+0x333/0x7f0 [ 49.385857] ? fput+0x140/0x140 [ 49.389102] ? check_same_owner+0x320/0x320 [ 49.393388] ____fput+0x15/0x20 [ 49.396631] task_work_run+0x199/0x270 [ 49.400485] ? task_work_cancel+0x210/0x210 [ 49.404772] ? free_nsproxy+0x185/0x1f0 [ 49.408709] ? switch_task_namespaces+0xa2/0xc0 [ 49.413344] do_exit+0xa52/0x1b40 [ 49.416762] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 49.421744] ? check_noncircular+0x20/0x20 [ 49.425950] ? mm_update_next_owner+0x930/0x930 [ 49.430581] ? __pmd_alloc+0x4e0/0x4e0 [ 49.434450] ? find_held_lock+0x39/0x1d0 [ 49.438479] ? lock_downgrade+0x990/0x990 [ 49.442600] ? handle_mm_fault+0x410/0x8d0 [ 49.446797] ? down_read_trylock+0xdb/0x170 [ 49.451083] ? __handle_mm_fault+0x39c0/0x39c0 [ 49.455628] ? vmacache_find+0x61/0x270 [ 49.459562] ? vmacache_update+0xfe/0x130 [ 49.463675] ? up_read+0x1a/0x40 [ 49.467007] ? __do_page_fault+0x35b/0xb60 [ 49.471203] ? do_vfs_ioctl+0x492/0x1530 [ 49.475239] ? do_page_fault+0xee/0x720 [ 49.479185] ? __do_page_fault+0xb60/0xb60 [ 49.483386] ? putname+0xf3/0x130 [ 49.486808] do_group_exit+0x149/0x400 [ 49.490665] ? lockdep_sys_exit+0x47/0xf0 [ 49.494779] ? SyS_exit+0x30/0x30 [ 49.498198] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 49.503179] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 49.507898] SyS_exit_group+0x1d/0x20 [ 49.511665] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 49.516382] RIP: 0033:0x445159 [ 49.519537] RSP: 002b:00000000007efe48 EFLAGS: 00000206 ORIG_RAX: 00000000000000e7 [ 49.527208] RAX: ffffffffffffffda RBX: 67c9d5257df1818c RCX: 0000000000445159 [ 49.534442] RDX: 0000000000445159 RSI: 0000000020074000 RDI: 0000000000000001 [ 49.541678] RBP: 0000000000000082 R08: 0000000000000000 R09: 0000000000000000 [ 49.548914] R10: 0000000000000000 R11: 0000000000000206 R12: 00000000004027b0 [ 49.556148] R13: 0000000000402840 R14: 0000000000000000 R15: 0000000000000000