CVE-2024-40974
Last modified
CVE-2024-40974 is a high-severity vulnerability rated 7.8/10 on the CVSS scale. 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. EPSS estimates a 0.30% chance of exploitation in the next 30 days.
Description
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.
Metrics
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
Weakness Enumeration
Affected Software
| Vendor | Product | Versions |
|---|---|---|
| Linux | Linux Kernel | < 4.19.317 |
| Linux | Linux Kernel | >= 4.20, < 5.4.279 |
| Linux | Linux Kernel | >= 5.5, < 5.10.221 |
| Linux | Linux Kernel | >= 5.11, < 5.15.162 |
| Linux | Linux Kernel | >= 5.16, < 6.1.96 |
| Linux | Linux Kernel | >= 6.2, < 6.6.36 |
| Linux | Linux Kernel | >= 6.7, < 6.9.7 |
References
Timeline
- Published
- Last Modified
- Status
- Modified
Frequently Asked Questions
What is CVE-2024-40974?
How severe is CVE-2024-40974?
How do I fix CVE-2024-40974?
How Strix Helps
- How Strix found a critical auth bypass in etcdStrix autonomously discovered a critical authentication bypass in etcd, later designated CVE-2026-33413.
- Autonomous PentestingAI agents that find and validate exploitable vulnerabilities like this one across your applications.
- PR ReviewsPentest every pull request so vulnerable code is caught before it ships to production.
- AI Penetration TestingHow AI-driven penetration testing continuously covers your attack surface.
Related CVEs from 2024
- CVE-2024-40969In the Linux kernel, the following vulnerability has been re…5.5
- CVE-2024-4097The Cost Calculator Builder plugin for WordPress is vulnerab…7.2
- CVE-2024-40970In the Linux kernel, the following vulnerability has been re…5.5
- CVE-2024-40971In the Linux kernel, the following vulnerability has been re…5.5
- CVE-2024-40972In the Linux kernel, the following vulnerability has been re…5.5
- CVE-2024-40973In the Linux kernel, the following vulnerability has been re…5.5
- CVE-2024-40975In the Linux kernel, the following vulnerability has been re…5.5
- CVE-2024-40976In the Linux kernel, the following vulnerability has been re…5.5
- CVE-2024-40977In the Linux kernel, the following vulnerability has been re…5.5
- CVE-2024-40978In the Linux kernel, the following vulnerability has been re…7.1
- CVE-2024-40979In the Linux kernel, the following vulnerability has been re…5.5
- CVE-2024-4098The Shariff Wrapper plugin for WordPress is vulnerable to Lo…9.8
Are you affected by CVE-2024-40974?
Run a free Strix scan to check your systems for this vulnerability.
Scan your code nowSource: NVD / NIST
