CVE-2022-50631
BaseFortify
Publication date: 2025-12-09
Last updated on: 2025-12-09
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 on RISC-V architecture related to the kexec functionality. Specifically, when the kernel reloads or unloads using kexec, a buffer allocated to store the flattened device tree (fdt) is not freed properly, causing a memory leak. The issue was detected by the kmemleak detector and fixed by adding a RISC-V specific cleanup function to free the buffer after loading the kexec image.
How can this vulnerability impact me? :
The memory leak caused by this vulnerability can lead to increased memory usage over time when using kexec on RISC-V systems. This could degrade system performance or stability, especially in environments where kexec is used frequently, potentially leading to resource exhaustion.
How can this vulnerability be detected on my network or system? Can you suggest some commands?
This vulnerability can be detected by using the kmemleak detector in the Linux kernel, which reports unreferenced memory objects related to the kexec process. To detect it, you can enable and check kmemleak reports. For example, you can enable kmemleak by adding 'kmemleak=on' to the kernel boot parameters and then check the kmemleak status and reports via the following commands: 1. Enable kmemleak (if not already enabled): reboot with kernel parameter 'kmemleak=on' 2. Check kmemleak status: cat /sys/kernel/debug/kmemleak 3. Trigger kmemleak scan: echo scan > /sys/kernel/debug/kmemleak 4. Review reported leaks: cat /sys/kernel/debug/kmemleak Look specifically for entries related to the 'kexec' command and memory allocations as described in the vulnerability report.
What immediate steps should I take to mitigate this vulnerability?
To mitigate this vulnerability immediately, update your Linux kernel to a version that includes the fix for the kexec memory leak on RISC-V architectures. The fix involves freeing the allocated fdt buffer during kexec kernel reload or unload by introducing the riscv specific function arch_kimage_file_post_load_cleanup(). Until the update is applied, avoid frequent use of kexec on affected systems to reduce the risk of memory leaks.