CVE-2024-38543: lib/test_hmm.c: handle src_pfns and dst_pfns allocation failure
In the Linux kernel, the following vulnerability has been resolved:
lib/testhmm.c: handle srcpfns and dstpfns allocation failure
The kcalloc() in dmirrordeviceevictchunk() will return null if the physical memory has run out. As a result, if srcpfns or dstpfns is dereferenced, the null pointer dereference bug will happen.
Moreover, the device is going away. If the kcalloc() fails, the pages mapping a chunk could not be evicted. So add a GFPNOFAIL flag in kcalloc().
Finally, as there is no need to have physically contiguous memory, Switch kcalloc() to kvcalloc() in order to avoid failing allocations.
Other sources
In the Linux kernel, the following vulnerability has been resolved:
lib/testhmm.c: handle srcpfns and dstpfns allocation failure
The Linux kernel CVE team has assigned CVE-2024-38543 to this issue.
Upstream advisory: https://lore.kernel.org/linux-cve-announce/2024061948-CVE-2024-38543-ff2e@gregkh/T
— Red Hat
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
debian/linuxto a version that resolves this vulnerability.Fixed in 6.1.129-1Fixed in 6.1.135-1Fixed in 6.12.25-1Fixed in 6.12.27-1 - Upgrade
Upgrade
redhat/kernelto a version that resolves this vulnerability.Fixed in 6.1.93 - Upgrade
Upgrade
redhat/kernelto a version that resolves this vulnerability.Fixed in 6.6.33 - Upgrade
Upgrade
redhat/kernelto a version that resolves this vulnerability.Fixed in 6.8.12 - Upgrade
Upgrade
redhat/kernelto a version that resolves this vulnerability.Fixed in 6.9.3 - Upgrade
Upgrade
redhat/kernelto a version that resolves this vulnerability.Fixed in 6.10 - Upgrade
Upgrade
Linux kernelto a version that resolves this vulnerability.Patch CVE-2024-38543 - Configuration
In dmirror_device_evict_chunk(), switch kcalloc() to kvcalloc() to avoid failing allocations.
Linux kernel (lib/test_hmm.c) dmirror_device_evict_chunk() allocation strategy: kcalloc() -> kvcalloc() = kvcalloc() - Configuration
In kcalloc(), add a __GFP_NOFAIL flag as stated in the resolution to prevent null-return allocation failures.
Linux kernel (lib/test_hmm.c) dmirror_device_evict_chunk() kcalloc() flags = __GFP_NOFAIL
Event History
Frequently Asked Questions
What is the severity of CVE-2024-38543?
CVE-2024-38543 has a severity rating that impacts memory allocation in the Linux kernel.
How do I fix CVE-2024-38543?
To fix CVE-2024-38543, update to kernel versions 6.1.93, 6.6.33, 6.8.12, 6.9.3, or 6.10 from Red Hat.
Which kernel versions are affected by CVE-2024-38543?
CVE-2024-38543 affects Linux kernel versions prior to 6.1.93, 6.6.33, 6.8.12, 6.9.3, and 6.10.
What type of vulnerability is CVE-2024-38543?
CVE-2024-38543 is a memory allocation vulnerability in the Linux kernel.
Is CVE-2024-38543 a local or remote vulnerability?
CVE-2024-38543 is classified as a local vulnerability that requires local access to exploit.