Re: [syzbot] [net?] [virt?] [kvm?] KASAN: slab-use-after-free Read in vhost_task_fn

Hillf Danton
2024-04-30T11:02:16Z

On Tue, 30 Apr 2024 01:25:26 -0700
> syzbot found the following issue on:
>
> HEAD commit: bb7a2467e6be Add linux-next specific files for 20240426
> git tree: linux-next
> C reproducer: https://syzkaller.appspot.com/x/repro.c?x=16c30028980000

#syz test https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git bb7a2467e6be

--- x/kernel/vhost_task.c
+++ y/kernel/vhost_task.c
@@ -100,6 +100,8 @@ void vhost_task_stop(struct vhost_task *
* freeing it below.
*/
wait_for_completion(&vtsk->exited);
+ mutex_lock(&vtsk->exit_mutex);
+ mutex_unlock(&vtsk->exit_mutex);
kfree(vtsk);
}
EXPORT_SYMBOL_GPL(vhost_task_stop);
--