vhost-vdpa: protect config_ctx from being freed under the config callback
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
| No fix yet |
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
vhost-vdpa: protect config_ctx from being freed under the config callback
vhost_vdpa_config_cb() loads v->config_ctx and signals it without taking a reference and without holding any lock:
struct eventfd_ctx *config_ctx = v->config_ctx;
if (config_ctx) eventfd_signal(config_ctx);
VHOST_VDPA_SET_CONFIG_CALL replaces that field and drops what is normally the last reference to the old context:
swap(ctx, v->config_ctx);
if (ctx) eventfd_ctx_put(ctx);
From the CVE record · Linux
The Linux kernel’s vhost-vdpa config callback can use a freed eventfd context when it races with a call-fd replacement. A local user with access to /dev/vduse (root by default) can trigger the race by injecting configuration interrupts while another thread replaces the call fd; no additional user interaction is described.
Engineers running Linux kernels with vhost-vdpa and VDUSE should check whether their kernel includes the fix; affected versions are not specified.