CVE-2024-40974·Kernel vulnerability
In the Linux kernel, the following vulnerability has been resolved: powerpc/pseries: Enforce hcall result buffer validity and size plpar_hcall(), plpar_hcall9(), and related functions expect callers to provide valid result buffers of certain minimum size. Currently this is communicated only through comments in the code and the compiler has no idea. For example, if I write a bug like this: long retbuf[PLPAR_HCALL_BUFSIZE]; // should be PLPAR_HCALL9_BUFSIZE plpar_hcall9(H_ALLOCATE_VAS_WINDOW, retbuf, ...); This compiles with no diagnostics emitted, but likely results in stack corruption at runtime when plpar_hcall9() stores results past the end of the array. (To be clear this is a contrived example and I have not found a real instance yet.) To make this class of error less likely, we can use explicitly-sized array parameters instead of pointers in the declarations for the hcall APIs. When compiled with -Warray-bounds[1], the code above now provokes a diagnostic like this: error: array argument is too small; is of size 32, callee requires at least 72 [-Werror,-Warray-bounds] 60 | plpar_hcall9(H_ALLOCATE_VAS_WINDOW, retbuf, | ^ ~~~~~~ [1] Enabled for LLVM builds but not GCC for now. See commit 0da6e5fd6c37 ("gcc: disable '-Warray-bounds' for gcc-13 too") and related changes.
- Severity
- high
- Software
- Kernel
- Fixed in
- 6.9.7
- Published
- 2024-07-12
Affected versions
From: 6.7
Until: 6.9.7
Fixed in: 6.9.7
How to fix this CVE
Update your Linux kernel to version 6.9.7 or later to resolve this vulnerability. The patch enforces strict buffer size validation for PowerPC hypervisor calls, preventing stack corruption that could occur when callers provide undersized result buffers. Systems running kernels 6.7 through 6.9.6 should prioritize this update.
sudo dnf update kernel kernel-develDefensia detects this vulnerability
How to check if you are affected
- Step 1: Check installed kernel version with `uname -r` and compare against the affected range (6.7.x to 6.9.6)
- Step 2: Verify if PowerPC architecture is in use with `uname -m` (look for ppc64 or ppc64le) — this vulnerability is PowerPC-specific
- Step 3: Review system logs for stack traces mentioning plpar_hcall, plpar_hcall9, or H_ALLOCATE_VAS_WINDOW with `journalctl -xe | grep -i 'plpar\|stack'`
- Step 4: After patching, confirm the new kernel version with `uname -r` and verify it is 6.9.7 or later
FAQ
What is CVE-2024-40974?
This is a memory safety vulnerability in the Linux kernel's PowerPC hypervisor call interface where insufficient buffer size validation could lead to stack corruption when hypervisor functions write results beyond caller-provided buffer boundaries.
Is CVE-2024-40974 being actively exploited?
No, this vulnerability is not listed in CISA's Known Exploited Vulnerabilities catalog and no public exploits are currently available.
What versions of Kernel are affected by CVE-2024-40974?
Linux kernel versions 6.7.x through 6.9.6 are affected; version 6.9.7 and later include the fix.
How do I check if my server is vulnerable to CVE-2024-40974?
Run `uname -r` to check your kernel version and `uname -m` to confirm PowerPC architecture (ppc64 or ppc64le). If your kernel falls between 6.7 and 6.9.6 on PowerPC, your system is vulnerable.
Does Defensia detect CVE-2024-40974?
Yes — Defensia's CVE advisory scanner compares installed package versions against the NVD database. If Kernel is installed on a monitored server, CVE-2024-40974 will appear in your dashboard with remediation steps.
Related Kernel CVEs
References
- https://git.kernel.org/stable/c/19c166ee42cf16d8b156a6cb4544122d9a65d3ca
- https://git.kernel.org/stable/c/262e942ff5a839b9e4f3302a8987928b0c8b8a2d
- https://git.kernel.org/stable/c/3ad0034910a57aa88ed9976b1431b7b8c84e0048
- https://git.kernel.org/stable/c/8aa11aa001576bf3b00dcb8559564ad7a3113588
- https://git.kernel.org/stable/c/a8c988d752b3d98d5cc1e3929c519a55ef55426c
Track CVEs across your fleet automatically
Defensia scans your Linux servers and tells you exactly which ones are running vulnerable versions — including CVE-2024-40974. Free for 1 server.
Get started free