CVE-2023-53826
Description
In the Linux kernel, the following vulnerability has been resolved:
ubi: Fix UAF wear-leveling entry in eraseblk_count_seq_show()
Wear-leveling entry could be freed in error path, which may be accessed again in eraseblk_count_seq_show(), for example:
__erase_worker eraseblk_count_seq_show wl = ubi->lookuptbl[*block_number] if (wl) wl_entry_destroy ubi->lookuptbl[e->pnum] = NULL kmem_cache_free(ubi_wl_entry_slab, e) erase_count = wl->ec // UAF!
Wear-leveling entry updating/accessing in ubi->lookuptbl should be protected by ubi->wl_lock, fix it by adding ubi->wl_lock to serialize wl entry accessing between wl_entry_destroy() and eraseblk_count_seq_show().
Fetch a reproducer in [Link].
AI Insight
LLM-synthesized narrative grounded in this CVE's description and references.
A use-after-free in the Linux kernel's UBI wear-leveling subsystem can be triggered via a race condition when reading the eraseblk_count file.
Vulnerability
Description
In the Linux kernel, the UBI (Unsorted Block Images) subsystem's wear-leveling logic contains a use-after-free (UAF) vulnerability. The flaw resides in the eraseblk_count_seq_show() function, which reads wear-leveling entry data from the ubi->lookuptbl array without proper synchronization. A race condition occurs when wl_entry_destroy() concurrently frees an entry and sets the corresponding array pointer to NULL, while eraseblk_count_seq_show() accesses the same pointer and reads its ec (erase count) field, leading to a UAF read.
The root cause is that both updating/accessing entries in ubi->lookuptbl are not consistently protected by the ubi->wl_lock spinlock. The provided commit [3] fixes this by adding the missing locking in eraseblk_count_seq_show(), ensuring that the teardown path (under wl_lock) completes before the show path traverses the table.
Attack
Surface & Exploitation
Triggering the vulnerability requires the ability to concurrently issue a read of the /sys/kernel/debug/ubi/ubiX/eraseblk_count file (or equivalent debugfs interface) while erase worker error processing is in progress. This is a local race condition that depends on timing; an attacker would need to either have low-level access to the debug filesystem or be able to craft a scenario where an I/O error causes __erase_worker to call wl_entry_destroy. No special privileges beyond those needed to read debugfs files are required, but the race window makes reliable exploitation challenging without specific control over the storage backend.
Impact
A successful race results in a use-after-free read of a slab-allocated ubi_wl_entry structure. While the CVE description labels this as a UAF (read), it can potentially be leveraged for information disclosure or, in a more severe scenario, for memory corruption if the freed memory is reallocated before the read completes. The kernel's memory safety mechanisms may mitigate exploitation on some configurations, but the presence of a plain UAF is a stability and security risk.
Mitigation
Patches have been merged into the mainline Linux kernel and backported to stable branches. The fix remains 9d448dd6bcb6 (and equivalent commits) that adds ubi->wl_lock protection in eraseblk_count_seq_show() [3]. Users should apply the latest stable kernel updates from their distribution. No workaround other than disabling debugfs (which removes the sysfs interface) is available, but that also hinders legitimate debugging.
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
2Patches
83f9b63dfce4484250da1c63c1cb14c06d6039d448dd6bcb679548ccdd99284253f3c2dada100de2974d2a240bc5c4313Vulnerability 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/1cb14c06d6035539ef4215c4ba0871aea71d7c38nvd
- git.kernel.org/stable/c/3f9b63dfce44a7c3c095dd93d910408e07ab1845nvd
- git.kernel.org/stable/c/79548ccdd992707879b4b683b7251c58ddf26f12nvd
- git.kernel.org/stable/c/84250da1c63cb7d421a3b4812b5c2ce2e47d31a1nvd
- git.kernel.org/stable/c/84253f3c2dad6be10d30c92626c763d9a9f512adnvd
- git.kernel.org/stable/c/9d448dd6bcb61a508204b57ea1f454ba9bac2f24nvd
- git.kernel.org/stable/c/a100de2974d208cfca032179b02ed4d1a0a7f143nvd
- git.kernel.org/stable/c/a240bc5c43130c6aa50831d7caaa02a1d84e1bcenvd
News mentions
0No linked articles in our index yet.