CVE-2026-99684: hwrng: virtio - prevent use-after-free after a failed restore
In the Linux kernel, the following vulnerability has been resolved:
hwrng: virtio - prevent use-after-free after a failed restore
removecommon() frees the driver data during freeze, but does not clear vdev->priv, which points to freed memory. If probecommon() then fails during restore, a later remove or freeze can dereference the dangling pointer.
Clear vdev->priv on the probecommon() error cleanup path and before freeing the driver data in removecommon(). Also reset the device and return early from removecommon() if vdev->priv is already NULL for a safe teardown after a failed restore.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 6.12.118 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 6.18.64 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 7.3.5 - Upgrade
Upgrade
debian/linuxto a version that resolves this vulnerability.Fixed in 7.3.5-1 - Compensating control
In the virtio hwrng driver, clear vdev->priv on the probe_common() error cleanup path and before freeing driver data in remove_common(); make remove_common() return early when vdev->priv is NULL.
Event History
Frequently Asked Questions
What conditions are required to trigger the issue?
The affected virtio hardware RNG driver must be frozen, freeing its driver data, followed by a failed restore in which probe_common() fails. A later remove or freeze operation can then dereference the stale vdev->priv pointer.
Which systems are exposed?
Systems using the Linux kernel's virtio hardware RNG driver are relevant. The described failure path specifically involves device freeze and restore handling, rather than ordinary operation alone.
What happens if restoration fails?
Before the fix, vdev->priv can continue to reference freed driver data after the failed restore. Subsequent teardown or freeze processing can dereference that dangling pointer, causing a use-after-free.
What mitigation is described when the failed-restore state is encountered?
The fix clears vdev->priv during probe error cleanup and before freeing driver data. It also resets the device and returns early from remove_common() when vdev->priv is already NULL, allowing safe teardown after a failed restore.