CVE-2022-50765
Memory Leak in Linux Kernel RISC-V kexec elf Header Buffer
Publication date: 2025-12-24
Last updated on: 2025-12-24
Assigner: kernel.org
Description
Description
CVSS Scores
EPSS Scores
| Probability: | |
| Percentile: |
Meta Information
Affected Vendors & Products
| Vendor | Product | Version / Range |
|---|---|---|
| linux | linux_kernel | * |
Helpful Resources
Exploitability
| CWE ID | Description |
|---|---|
| CWE-UNKNOWN |
Attack-Flow Graph
AI Powered Q&A
Can you explain this vulnerability to me?
This vulnerability is a memory leak in the Linux kernel's RISC-V kexec functionality. Specifically, when loading ELF headers during a kexec operation, a buffer is allocated but not properly freed in certain failure scenarios, such as when reloading or unloading the kdump kernel or when the ELF header is set but the kdump kernel fails to load. This causes unreferenced memory to remain allocated, leading to a memory leak. The fix involves freeing this buffer during cleanup to prevent the leak.
How can this vulnerability impact me? :
The memory leak can cause increased memory usage over time, potentially leading to reduced system performance or stability issues, especially on systems frequently using kexec for kernel loading or crash dumping. This could result in resource exhaustion or system crashes if the leak is significant and not addressed.
How can this vulnerability be detected on my network or system? Can you suggest some commands?
This vulnerability can be detected using the kmemleak detector in the Linux kernel, which reports unreferenced memory objects related to the kexec process. You can check for memory leaks by enabling kmemleak and inspecting its output. For example, you can use the following commands: 1. Enable kmemleak (if not already enabled): echo scan > /sys/kernel/debug/kmemleak 2. Check for memory leaks: cat /sys/kernel/debug/kmemleak Look for entries related to 'kexec' and elf header buffers similar to the reported unreferenced object in the vulnerability description.
What immediate steps should I take to mitigate this vulnerability?
To mitigate this vulnerability, you should update your Linux kernel to a version where the fix has been applied. The fix involves freeing the elf header buffer in arch_kimage_file_post_load_cleanup() to prevent memory leaks during kexec operations. Applying the latest kernel patches or upgrading to a fixed kernel version will address this issue.