summaryrefslogtreecommitdiff
path: root/scripts/Makefile.thinlto
diff options
context:
space:
mode:
authorLinfeng Sun  <linfeng.sun.dev@gamil.com>2026-06-20 18:09:59 +0800
committerMichael S. Tsirkin <mst@redhat.com>2026-08-03 23:08:16 -0400
commite5725e85d68541584e64e702785ce7445486df83 (patch)
tree9fe0b9c2171fa5ad1263b5dc4ca75a64ddacf190 /scripts/Makefile.thinlto
parent22172d588a7cfa61d347774cfc0b4419d6c6388e (diff)
downloadlinux-next-e5725e85d68541584e64e702785ce7445486df83.tar.gz
linux-next-e5725e85d68541584e64e702785ce7445486df83.zip
vdpa_sim: fix cleanup after worker creation failure
vdpasim_create() leaves vdpasim->worker as an ERR_PTR when kthread_run_worker() fails. The error path then drops the device reference, which releases the partially initialized simulator. vdpasim_free() unconditionally passes the worker pointer to kthread_destroy_worker(), so the ERR_PTR is dereferenced and can trigger a general protection fault. Store the worker error, clear the pointer, and only clean up the worker when it was successfully initialized. Also make the release path tolerate partially initialized objects by guarding virtqueue and IOTLB cleanup, since the same release path can be reached from other initialization failures. I found this bug myself, though the patch was written with AI assistance. Fixes: 76acfa7bc54f ("vdpa_sim: use kthread worker") Assisted-by: OpenAI-Codex:GPT-5 Reviewed-by: Eugenio Pérez <eperezma@redhat.com> Signed-off-by: Linfeng Sun <linfeng.sun.dev@gamil.com> Message-ID: <20260620100959.2070316-1-slf@hdu.edu.cn> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'scripts/Makefile.thinlto')
0 files changed, 0 insertions, 0 deletions