vhost_vdpa: assign irq bypass producer token correctly
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ 2cf1ba9a4d15cb78b96ea97f727b93382c3f9a60 · < 7cf2fb51175cafe01df8c43fa15a06194a59c6e2| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
vhost_vdpa: assign irq bypass producer token correctly
We used to call irq_bypass_unregister_producer() in vhost_vdpa_setup_vq_irq() which is problematic as we don't know if the token pointer is still valid or not.
Actually, we use the eventfd_ctx as the token so the life cycle of the token should be bound to the VHOST_SET_VRING_CALL instead of vhost_vdpa_setup_vq_irq() which could be called by set_status().
Fixing this by setting up irq bypass producer's token when handling VHOST_SET_VRING_CALL and un-registering the producer before calling vhost_vring_ioctl() to prevent a possible use after free as eventfd could have been released in vhost_vring_ioctl(). And such registering and unregistering will only be done if DRIVER_OK is set.
From the CVE record · Linux
The Linux kernel’s vhost_vdpa driver can use an IRQ bypass producer token after its eventfd has been released. This can happen during VHOST_SET_VRING_CALL handling when DRIVER_OK is set; the input does not specify an exploit outcome or authentication requirements.
Engineers running Linux kernels with vhost_vdpa should check their kernel vendor’s advisory; affected versions are not specified.