CVE-2023-54146
Description
In the Linux kernel, the following vulnerability has been resolved:
x86/kexec: Fix double-free of elf header buffer
After
b3e34a47f989 ("x86/kexec: fix memory leak of elf header buffer"),
freeing image->elf_headers in the error path of crash_load_segments() is not needed because kimage_file_post_load_cleanup() will take care of that later. And not clearing it could result in a double-free.
Drop the superfluous vfree() call at the error path of crash_load_segments().
AI Insight
LLM-synthesized narrative grounded in this CVE's description and references.
Double-free of elf header buffer in Linux kernel's kexec crash_load_segments() error path, fixed by removing superfluous vfree().
Vulnerability
Analysis
A double-free vulnerability exists in the Linux kernel's kexec code for the x86 architecture. In the function crash_load_segments(), after commit b3e34a47f989 introduced memory cleanup via kimage_file_post_load_cleanup(), an extra vfree(image->elf_headers) call remained in the error path. This can cause the elf_headers buffer to be freed twice: once in that error path and again during the normal cleanup in kimage_file_post_load_cleanup(). [1][2]
Exploitation
To trigger the bug, an attacker would need to cause crash_load_segments() to fail (e.g., by providing a malformed kexec image or triggering an allocation failure). This requires the ability to call the kexec_load() system call, which normally requires CAP_SYS_BOOT or root privileges. No user interaction is needed beyond the malicious syscall.
Impact
A double-free in kernel memory management can lead to memory corruption, potentially allowing an attacker to escalate privileges or cause a denial of service (system crash). The vulnerability is serious because it can corrupt kernel heap allocator metadata.
Mitigation
The fix removes the redundant vfree() call in the error path of crash_load_segments(). The patch is available in the stable kernel trees and should be applied to affected versions. [1][2]
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
54c71a552b97f554a880a1ffffbdbf8ac333d5bd3c7abeb69d00dd2f2645dVulnerability mechanics
Generated on May 9, 2026. Inputs: CWE entries + fix-commit diffs from this CVE's patches. Citations validated against bundle.
References
5- git.kernel.org/stable/c/4c71a552b97fb4f46eb300224434fe56fcf4f254nvd
- git.kernel.org/stable/c/554a880a1fff46dd5a355dec21cd77d542a0ddf2nvd
- git.kernel.org/stable/c/5bd3c7abeb69fb4133418b846a1c6dc11313d6f0nvd
- git.kernel.org/stable/c/d00dd2f2645dca04cf399d8fc692f3f69b6dd996nvd
- git.kernel.org/stable/c/fbdbf8ac333d3d47c0d9ea81d7d445654431d100nvd
News mentions
0No linked articles in our index yet.