CVE-2023-53998
Description
In the Linux kernel, the following vulnerability has been resolved:
hwrng: virtio - Fix race on data_avail and actual data
The virtio rng device kicks off a new entropy request whenever the data available reaches zero. When a new request occurs at the end of a read operation, that is, when the result of that request is only needed by the next reader, then there is a race between the writing of the new data and the next reader.
This is because there is no synchronisation whatsoever between the writer and the reader.
Fix this by writing data_avail with smp_store_release and reading it with smp_load_acquire when we first enter read. The subsequent reads are safe because they're either protected by the first load acquire, or by the completion mechanism.
Also remove the redundant zeroing of data_idx in random_recv_done (data_idx must already be zero at this point) and data_avail in request_entropy (ditto).
AI Insight
LLM-synthesized narrative grounded in this CVE's description and references.
A race condition in the Linux kernel's virtio-rng driver can cause a read to return stale or uninitialized entropy data.
Vulnerability
CVE-2023-53998 is a race condition in the Linux kernel's virtio-rng (hardware random number generator) driver. The driver uses a shared data_avail counter to track how many entropy bytes are available in a buffer. When a read operation exhausts the available data, the buffer, the driver triggers a new request to the virtio device. However, there is no synchronization between the writer (the device's completion callback) and the reader (the read function), leading to a window where the reader can observe an updated data_avail value before the corresponding data has been written into the buffer [1].
Exploitation
An attacker would require local access to the kernel's /dev/hwrng device. The attacker must be able to open and read from the device file. The race window is narrow but can be triggered repeatedly by a malicious or buggy userspace program that reads from /dev/hwrng in a tight loop. No special privileges beyond read access to the device are required [2].
Impact
A successful exploit could cause a read operation to return stale or uninitialized data from the buffer, potentially leaking kernel memory contents to userspace. Since the random number generator is used by cryptographic subsystems and other security-sensitive components, this could weaken entropy guarantees or disclose sensitive information [3].
Mitigation
The fix was applied in Linux kernel stable releases via commits that commit [4]. Users should update to a kernel version containing the patch. The fix uses smp_store_release and smp_load_acquire to ensure proper ordering between the writer and reader, eliminating the race condition [1].
AI Insight generated on May 19, 2026. Synthesized from this CVE's description and the cited reference URLs; citations are validated against the source bundle.
Affected products
1Patches
8241ef15776a7a43bcb0b661c77471e4912d3c76d991b6f0122c30022cde6318657b4c2072fc91f156b3fac52578d6e8dVulnerability mechanics
Generated on May 9, 2026. Inputs: CWE entries + fix-commit diffs from this CVE's patches. Citations validated against bundle.
References
8- git.kernel.org/stable/c/22c30022cde6e2c88612b3a499223cfa912f1bc7nvd
- git.kernel.org/stable/c/241ef15776a7c8505008db689175b320d345ecd3nvd
- git.kernel.org/stable/c/2fc91f156b3f3446a1bce80cf4adedcbf41271c2nvd
- git.kernel.org/stable/c/318657b4c2077289659f1cd9e2a34f6a3b208e3envd
- git.kernel.org/stable/c/77471e4912d3960dafe141e268c44be8024fe4dcnvd
- git.kernel.org/stable/c/a43bcb0b661cbbf3ad797d2aee6b6fd06b8fc69dnvd
- git.kernel.org/stable/c/ac52578d6e8d300dd50f790f29a24169b1edd26cnvd
- git.kernel.org/stable/c/c76d991b6f01a5d931e7053a73bc9524975a5215nvd
News mentions
0No linked articles in our index yet.