CVE-2023-54065
Description
In the Linux kernel, the following vulnerability has been resolved:
net: dsa: realtek: fix out-of-bounds access
The probe function sets priv->chip_data to (void *)priv + sizeof(*priv) with the expectation that priv has enough trailing space.
However, only realtek-smi actually allocated this chip_data space. Do likewise in realtek-mdio to fix out-of-bounds accesses.
These accesses likely went unnoticed so far, because of an (unused) buf[4096] member in struct realtek_priv, which caused kmalloc to round up the allocated buffer to a big enough size, so nothing of value was overwritten. With a different allocator (like in the barebox bootloader port of the driver) or with KASAN, the memory corruption becomes quickly apparent.
AI Insight
LLM-synthesized narrative grounded in this CVE's description and references.
In the Linux kernel's realtek DSA driver, an out-of-bounds access occurs because realtek-mdio did not allocate additional chip_data space, unlike realtek-smi; fixed by allocating trailing space.
The vulnerability is an out-of-bounds memory access in the Linux kernel's Realtek DSA (Distributed Switch Architecture) driver. The probe function sets priv->chip_data to point to memory beyond the realtek_priv structure, assuming that additional space was allocated. However, only the realtek-smi sub-driver allocated this trailing space; realtek-mdio did not, leading to out-of-bounds writes when accessing chip_data.
Exploitation requires loading the affected driver on a system with a Realtek switch connected via MDIO. The bug manifests as memory corruption, which may cause system crashes or be leveraged for privilege escalation. The presence of an unused buf[4096] member in struct realtek_priv previously masked the issue by causing kmalloc to overallocate, but with different allocators or KASAN enabled, the corruption is evident.
The fix ensures that realtek-mdio allocates the necessary trailing space, matching the behavior of realtek-smi. The patch has been merged into the Linux kernel stable tree [1]. Users should update to a kernel version containing this commit to mitigate the vulnerability.
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
3cc0f9bb99735fe668aa499b4b93eb5648693Vulnerability mechanics
Generated on May 9, 2026. Inputs: CWE entries + fix-commit diffs from this CVE's patches. Citations validated against bundle.
References
3News mentions
0No linked articles in our index yet.