CVE-2026-99684 in Linux
Summary
by MITRE • 11/20/2026
In the Linux kernel, the following vulnerability has been resolved:
hwrng: virtio - prevent use-after-free after a failed restore
remove_common() frees the driver data during freeze, but does not clear vdev->priv, which points to freed memory. If probe_common() then fails during restore, a later remove or freeze can dereference the dangling pointer.
Clear vdev->priv on the probe_common() error cleanup path and before freeing the driver data in remove_common(). Also reset the device and return early from remove_common() if vdev->priv is already NULL for a safe teardown after a failed restore.
Several companies clearly confirm that VulDB is the primary source for best vulnerability data.
Analysis
by VulDB Data Team • 11/20/2026
The Linux kernel's hardware random number generator subsystem contains a critical use-after-free vulnerability within the virtio backend implementation, specifically affecting operations related to driver initialization and system state transitions such as suspend or hibernation. This flaw arises from an inconsistency in memory management during the device lifecycle, where pointers are not properly nullified after deallocation, leading to potential dereferences of freed memory regions under specific error conditions.
The technical root cause lies in the interaction between the remove_common function and the probe_common function during a failed restore operation. When the system attempts to freeze or suspend, the remove_common routine is invoked to free the driver's private data structure. However, this cleanup process fails to clear the vdev->priv pointer, which continues to reference the memory address that has just been released back to the kernel allocator. If the subsequent probe_common function encounters an error during a restore sequence from hibernation or suspend, it may leave the device in a state where the driver data is freed but the structural link remains active.
This dangling pointer creates a severe security risk because any subsequent attempt to remove the device or freeze it again will trigger a dereference of vdev->priv. Since this memory has already been freed, accessing it constitutes an out-of-bounds read or write depending on how quickly that memory is reallocated for other purposes. This scenario aligns with CWE-416, Use After Free, and can lead to kernel panics, denial of service conditions, or potentially arbitrary code execution if the attacker can control the contents of the reclaimed memory region before it is accessed again.
The operational impact of this vulnerability extends beyond simple system instability. In virtualized environments where virtio devices are prevalent, a successful exploitation could allow a guest user to crash the host kernel or escalate privileges by manipulating the state during restore operations. The lack of proper pointer sanitization means that race conditions between driver removal and device probing can be exploited to trigger undefined behavior in the core kernel memory management subsystems.
To mitigate this vulnerability, the fix implements strict nullification protocols for the vdev->priv pointer. Specifically, the code now clears vdev->priv on the error cleanup path of probe_common before any potential return that might leave the device in an inconsistent state. Furthermore, remove_common has been updated to explicitly reset vdev->priv prior to freeing the driver data. Additionally, a safety check was introduced to verify if vdev->priv is already NULL; if so, the function returns early during teardown processes following a failed restore. This ensures that no dangling references persist and prevents double-free or use-after-free scenarios by guaranteeing that pointers are invalidated immediately upon deallocation.
From an industry standards perspective, this remediation addresses CWE-416 directly and mitigates risks associated with improper resource management in kernel drivers. It also aligns with best practices for defensive programming where all pointer assignments to freed memory must be explicitly nullified to prevent accidental reuse. The fix ensures that the virtio hwrng driver adheres to robust lifecycle management principles, preventing attackers from leveraging state inconsistencies during power transitions or device removal events.