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-2,10.128.15.206' (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: [ 37.606419] ================================================================== [ 37.613884] BUG: KASAN: use-after-free in detach_if_pending+0x557/0x610 [ 37.620609] Write of size 8 at addr ffff8801ce77b780 by task syzkaller042288/2988 [ 37.628197] [ 37.629800] CPU: 0 PID: 2988 Comm: syzkaller042288 Not tainted 4.13.0-mm1+ #7 [ 37.637043] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 37.646371] Call Trace: [ 37.648938] dump_stack+0x194/0x257 [ 37.652543] ? arch_local_irq_restore+0x53/0x53 [ 37.657185] ? show_regs_print_info+0x65/0x65 [ 37.661653] ? lock_timer_base+0x1a3/0x2b0 [ 37.665863] ? detach_if_pending+0x557/0x610 [ 37.670246] print_address_description+0x73/0x250 [ 37.675064] ? detach_if_pending+0x557/0x610 [ 37.679447] kasan_report+0x24e/0x340 [ 37.683225] __asan_report_store8_noabort+0x17/0x20 [ 37.688212] detach_if_pending+0x557/0x610 [ 37.692525] ? trace_raw_output_tick_stop+0x130/0x130 [ 37.697689] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 37.702327] ? lock_timer_base+0x1a3/0x2b0 [ 37.706548] ? lock_timer_base+0x1eb/0x2b0 [ 37.710757] ? __internal_add_timer+0x2d0/0x2d0 [ 37.715403] ? trace_hardirqs_on+0xd/0x10 [ 37.719532] try_to_del_timer_sync+0xa2/0x120 [ 37.723997] ? del_timer+0x130/0x130 [ 37.727685] ? del_timer_sync+0xeb/0x240 [ 37.731722] del_timer_sync+0x18a/0x240 [ 37.735673] tun_free_netdev+0x105/0x1b0 [ 37.739705] ? tun_xdp+0x410/0x410 [ 37.743215] ? cpumask_next+0x24/0x30 [ 37.746989] ? netdev_refcnt_read+0xed/0x150 [ 37.751373] ? tun_xdp+0x410/0x410 [ 37.754883] netdev_run_todo+0x870/0xca0 [ 37.758916] ? do_group_exit+0x149/0x400 [ 37.762954] ? register_netdev+0x30/0x30 [ 37.766990] ? lock_downgrade+0x990/0x990 [ 37.771108] ? trace_hardirqs_on+0xd/0x10 [ 37.775249] ? refcount_sub_and_test+0x115/0x1b0 [ 37.779976] ? refcount_inc+0x50/0x50 [ 37.783745] ? refcount_inc+0x50/0x50 [ 37.787522] ? sk_destruct+0x4c/0x80 [ 37.791207] ? __sk_free+0x5c/0x230 [ 37.794806] ? sk_free+0x2f/0x40 [ 37.798145] ? __tun_detach+0x176/0x1390 [ 37.802190] ? tun_attach+0xf90/0xf90 [ 37.805971] ? locks_remove_file+0x3fa/0x5a0 [ 37.810352] ? fcntl_setlk+0x10d0/0x10d0 [ 37.814387] ? __fsnotify_parent+0xb4/0x3a0 [ 37.818681] ? fsnotify+0x1af0/0x1af0 [ 37.822457] ? __tun_detach+0x1390/0x1390 [ 37.826575] ? __tun_detach+0x1390/0x1390 [ 37.830694] rtnl_unlock+0xe/0x10 [ 37.834119] tun_chr_close+0x49/0x60 [ 37.837806] __fput+0x333/0x7f0 [ 37.841063] ? fput+0x140/0x140 [ 37.844318] ? check_same_owner+0x320/0x320 [ 37.848617] ____fput+0x15/0x20 [ 37.851868] task_work_run+0x199/0x270 [ 37.855731] ? task_work_cancel+0x210/0x210 [ 37.860024] ? free_nsproxy+0x185/0x1f0 [ 37.863970] ? switch_task_namespaces+0xa2/0xc0 [ 37.868616] do_exit+0xa52/0x1b40 [ 37.872043] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 37.877035] ? check_noncircular+0x20/0x20 [ 37.881250] ? mm_update_next_owner+0x930/0x930 [ 37.885894] ? __pmd_alloc+0x4e0/0x4e0 [ 37.889764] ? find_held_lock+0x39/0x1d0 [ 37.893807] ? lock_downgrade+0x990/0x990 [ 37.897948] ? handle_mm_fault+0x410/0x8d0 [ 37.902152] ? down_read_trylock+0xdb/0x170 [ 37.906445] ? __handle_mm_fault+0x39c0/0x39c0 [ 37.910999] ? vmacache_find+0x61/0x270 [ 37.914942] ? vmacache_update+0xfe/0x130 [ 37.919067] ? up_read+0x1a/0x40 [ 37.922404] ? __do_page_fault+0x35b/0xb60 [ 37.926607] ? do_vfs_ioctl+0x492/0x1530 [ 37.930644] ? do_page_fault+0xee/0x720 [ 37.934591] ? __do_page_fault+0xb60/0xb60 [ 37.938797] ? putname+0xf3/0x130 [ 37.942227] do_group_exit+0x149/0x400 [ 37.946084] ? lockdep_sys_exit+0x47/0xf0 [ 37.950203] ? SyS_exit+0x30/0x30 [ 37.953628] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 37.958614] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 37.963345] SyS_exit_group+0x1d/0x20 [ 37.967123] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 37.971862] RIP: 0033:0x445109 [ 37.975035] RSP: 002b:00000000007efe48 EFLAGS: 00000206 ORIG_RAX: 00000000000000e7 [ 37.982717] RAX: ffffffffffffffda RBX: 79acadf5a02c44d5 RCX: 0000000000445109 [ 37.989959] RDX: 0000000000445109 RSI: 0000000020001fd8 RDI: 0000000000000001 [ 37.997199] RBP: 0000000000000082 R08: 0000000000000000 R09: 0000000000000000 [ 38.004450] R10: 0000000000000000 R11: 0000000000000206 R12: 0000000000402760 [ 38.011690] R13: 00000000004027f0 R14: 0000000000000000 R15: 0000000000000000 [ 38.018949] [ 38.020549] Allocated by task 2988: [ 38.024151] save_stack_trace+0x16/0x20 [ 38.028103] save_stack+0x43/0xd0 [ 38.031525] kasan_kmalloc+0xad/0xe0 [ 38.035207] __kmalloc_node+0x47/0x70 [ 38.038978] kvmalloc_node+0x64/0xd0 [ 38.042666] alloc_netdev_mqs+0x16e/0xed0 [ 38.046784] __tun_chr_ioctl+0x12be/0x3d20 [ 38.050987] tun_chr_ioctl+0x2a/0x40 [ 38.054671] do_vfs_ioctl+0x1b1/0x1530 [ 38.058526] SyS_ioctl+0x8f/0xc0 [ 38.061864] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 38.066591] [ 38.068191] Freed by task 2988: [ 38.071440] save_stack_trace+0x16/0x20 [ 38.075385] save_stack+0x43/0xd0 [ 38.078808] kasan_slab_free+0x71/0xc0 [ 38.082663] kfree+0xca/0x250 [ 38.085737] kvfree+0x36/0x60 [ 38.088813] free_netdev+0x2cf/0x360 [ 38.092495] __tun_chr_ioctl+0x2cf6/0x3d20 [ 38.096717] tun_chr_ioctl+0x2a/0x40 [ 38.100400] do_vfs_ioctl+0x1b1/0x1530 [ 38.104257] SyS_ioctl+0x8f/0xc0 [ 38.107592] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 38.112321] [ 38.113921] The buggy address belongs to the object at ffff8801ce778380 [ 38.113921] which belongs to the cache kmalloc-16384 of size 16384 [ 38.126892] The buggy address is located 13312 bytes inside of [ 38.126892] 16384-byte region [ffff8801ce778380, ffff8801ce77c380) [ 38.139082] The buggy address belongs to the page: [ 38.143984] page:ffffea000739de00 count:1 mapcount:0 mapping:ffff8801ce778380 index:0x0 compound_mapcount: 0 [ 38.153929] flags: 0x200000000008100(slab|head) [ 38.158569] raw: 0200000000008100 ffff8801ce778380 0000000000000000 0000000100000001 [ 38.166419] raw: ffffea00073c5420 ffff8801dac01c50 ffff8801dac02200 0000000000000000 [ 38.174264] page dumped because: kasan: bad access detected [ 38.179939] [ 38.181535] Memory state around the buggy address: [ 38.186434] ffff8801ce77b680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 38.193763] ffff8801ce77b700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 38.201094] >ffff8801ce77b780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 38.208419] ^ [ 38.211754] ffff8801ce77b800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 38.219081] ffff8801ce77b880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 38.226409] ================================================================== [ 38.233736] Disabling lock debugging due to kernel taint [ 38.239149] Kernel panic - not syncing: panic_on_warn set ... [ 38.239149] [ 38.246476] CPU: 0 PID: 2988 Comm: syzkaller042288 Tainted: G B 4.13.0-mm1+ #7 [ 38.254926] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 38.264243] Call Trace: [ 38.266802] dump_stack+0x194/0x257 [ 38.270396] ? arch_local_irq_restore+0x53/0x53 [ 38.275042] ? vprintk_default+0x28/0x30 [ 38.279070] ? detach_if_pending+0x550/0x610 [ 38.283446] panic+0x1e4/0x417 [ 38.286603] ? __warn+0x1d9/0x1d9 [ 38.290027] ? detach_if_pending+0x557/0x610 [ 38.294399] kasan_end_report+0x50/0x50 [ 38.298341] kasan_report+0x137/0x340 [ 38.302109] __asan_report_store8_noabort+0x17/0x20 [ 38.307090] detach_if_pending+0x557/0x610 [ 38.311292] ? trace_raw_output_tick_stop+0x130/0x130 [ 38.316449] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 38.321084] ? lock_timer_base+0x1a3/0x2b0 [ 38.325285] ? lock_timer_base+0x1eb/0x2b0 [ 38.329487] ? __internal_add_timer+0x2d0/0x2d0 [ 38.334124] ? trace_hardirqs_on+0xd/0x10 [ 38.338248] try_to_del_timer_sync+0xa2/0x120 [ 38.342708] ? del_timer+0x130/0x130 [ 38.346389] ? del_timer_sync+0xeb/0x240 [ 38.350429] del_timer_sync+0x18a/0x240 [ 38.354372] tun_free_netdev+0x105/0x1b0 [ 38.358397] ? tun_xdp+0x410/0x410 [ 38.361904] ? cpumask_next+0x24/0x30 [ 38.365674] ? netdev_refcnt_read+0xed/0x150 [ 38.370047] ? tun_xdp+0x410/0x410 [ 38.373553] netdev_run_todo+0x870/0xca0 [ 38.377584] ? do_group_exit+0x149/0x400 [ 38.381621] ? register_netdev+0x30/0x30 [ 38.385650] ? lock_downgrade+0x990/0x990 [ 38.389761] ? trace_hardirqs_on+0xd/0x10 [ 38.393884] ? refcount_sub_and_test+0x115/0x1b0 [ 38.398604] ? refcount_inc+0x50/0x50 [ 38.402369] ? refcount_inc+0x50/0x50 [ 38.406139] ? sk_destruct+0x4c/0x80 [ 38.409817] ? __sk_free+0x5c/0x230 [ 38.413408] ? sk_free+0x2f/0x40 [ 38.416739] ? __tun_detach+0x176/0x1390 [ 38.420770] ? tun_attach+0xf90/0xf90 [ 38.424550] ? locks_remove_file+0x3fa/0x5a0 [ 38.428930] ? fcntl_setlk+0x10d0/0x10d0 [ 38.432960] ? __fsnotify_parent+0xb4/0x3a0 [ 38.437247] ? fsnotify+0x1af0/0x1af0 [ 38.441013] ? __tun_detach+0x1390/0x1390 [ 38.445125] ? __tun_detach+0x1390/0x1390 [ 38.449248] rtnl_unlock+0xe/0x10 [ 38.452665] tun_chr_close+0x49/0x60 [ 38.456347] __fput+0x333/0x7f0 [ 38.459593] ? fput+0x140/0x140 [ 38.462838] ? check_same_owner+0x320/0x320 [ 38.467126] ____fput+0x15/0x20 [ 38.470372] task_work_run+0x199/0x270 [ 38.474224] ? task_work_cancel+0x210/0x210 [ 38.478514] ? free_nsproxy+0x185/0x1f0 [ 38.482455] ? switch_task_namespaces+0xa2/0xc0 [ 38.487092] do_exit+0xa52/0x1b40 [ 38.490512] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 38.495493] ? check_noncircular+0x20/0x20 [ 38.499697] ? mm_update_next_owner+0x930/0x930 [ 38.504331] ? __pmd_alloc+0x4e0/0x4e0 [ 38.508187] ? find_held_lock+0x39/0x1d0 [ 38.512217] ? lock_downgrade+0x990/0x990 [ 38.516340] ? handle_mm_fault+0x410/0x8d0 [ 38.520538] ? down_read_trylock+0xdb/0x170 [ 38.524825] ? __handle_mm_fault+0x39c0/0x39c0 [ 38.529371] ? vmacache_find+0x61/0x270 [ 38.533310] ? vmacache_update+0xfe/0x130 [ 38.537424] ? up_read+0x1a/0x40 [ 38.540761] ? __do_page_fault+0x35b/0xb60 [ 38.544964] ? do_vfs_ioctl+0x492/0x1530 [ 38.549006] ? do_page_fault+0xee/0x720 [ 38.552948] ? __do_page_fault+0xb60/0xb60 [ 38.557165] ? putname+0xf3/0x130 [ 38.560589] do_group_exit+0x149/0x400 [ 38.564445] ? lockdep_sys_exit+0x47/0xf0 [ 38.568559] ? SyS_exit+0x30/0x30 [ 38.571988] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 38.576972] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 38.581694] SyS_exit_group+0x1d/0x20 [ 38.585465] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 38.590186] RIP: 0033:0x445109 [ 38.593342] RSP: 002b:00000000007efe48 EFLAGS: 00000206 ORIG_RAX: 00000000000000e7 [ 38.601013] RAX: ffffffffffffffda RBX: 79acadf5a02c44d5 RCX: 0000000000445109