CVE-2024-40974 json
powerpc/pseries: Enforce hcall result buffer validity and size
published 2024-07-12 2 y ago modified 2026-08-05 3 mo ago also EUVD-2024-38771
- cvss
- 7.8
- version 3.1, CNA
- cisa kev
- Not listed
- not in CISA's catalog
- epss
- 0.3%
- EPSS 0.3% chance of exploitation in 30 days, percentile 23%
- public exploits
- 0
- none known
Summary
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.
Patch / fix
- Linux Linux 4.19.317, 5.4.279, 5.10.221, 5.15.162, 6.1.96, 6.6.36, 6.9.7, 6.10
- linux Debian 12 6.1.99-1
- linux Debian 14, Debian 13 6.9.7-1
debian advisories DEBIAN-CVE-2024-40974
- linux Ubuntu 20.04 LTS 5.4.0-195.215
- linux Ubuntu 22.04 LTS 5.15.0-121.131
- linux Ubuntu 24.04 LTS 6.8.0-44.44
- linux-aws Ubuntu 20.04 LTS 5.4.0-1132.142
- linux-aws Ubuntu 22.04 LTS 5.15.0-1069.75
- linux-aws Ubuntu 24.04 LTS 6.8.0-1015.16
- linux-gcp Ubuntu 20.04 LTS 5.4.0-1136.145
- linux-gcp Ubuntu 22.04 LTS 5.15.0-1068.76
ubuntu advisories UBUNTU-CVE-2024-40974
Ubuntu security data © Canonical Ltd., from https://github.com/canonical/ubuntu-security-notices via OSV; changed: normalised to fixed package versions per release. CC BY-SA 4.0
- kernel RHEL 8 4.18.0-553.16.1.el8_10
- perf RHEL 8 4.18.0-553.16.1.el8_10
- bpftool RHEL 8 4.18.0-553.16.1.el8_10
- kernel-core RHEL 8 4.18.0-553.16.1.el8_10
- kernel-tools RHEL 8 4.18.0-553.16.1.el8_10
- python3-perf RHEL 8 4.18.0-553.16.1.el8_10
- kernel-modules RHEL 8 4.18.0-553.16.1.el8_10
- kernel-zfcpdump RHEL 8 4.18.0-553.16.1.el8_10
red hat advisories RHSA-2024:5101
- kernel AlmaLinux 8 4.18.0-553.16.1.el8_10
- perf AlmaLinux 8 4.18.0-553.16.1.el8_10
- bpftool AlmaLinux 8 4.18.0-553.16.1.el8_10
- kernel-core AlmaLinux 8 4.18.0-553.16.1.el8_10
- kernel-tools AlmaLinux 8 4.18.0-553.16.1.el8_10
- python3-perf AlmaLinux 8 4.18.0-553.16.1.el8_10
- kernel-modules AlmaLinux 8 4.18.0-553.16.1.el8_10
- kernel-zfcpdump AlmaLinux 8 4.18.0-553.16.1.el8_10
almalinux advisories ALSA-2024:5101
- kernel Rocky Linux 8 4.18.0-553.16.1.el8_10.cloud.0.1
- kernel Rocky Linux 8 4.18.0-553.16.1.el8_10
rocky linux advisories RXSA-2024:5101RLSA-2024:5101
- git.kernel.org/stable/c/acf2b80c31c37acab040baa3cf5f19fbd5140b18 commit
- git.kernel.org/stable/c/19c166ee42cf16d8b156a6cb4544122d9a65d3ca commit
- git.kernel.org/stable/c/a8c988d752b3d98d5cc1e3929c519a55ef55426c commit
- git.kernel.org/stable/c/262e942ff5a839b9e4f3302a8987928b0c8b8a2d commit
- git.kernel.org/stable/c/8aa11aa001576bf3b00dcb8559564ad7a3113588 commit
- git.kernel.org/stable/c/3ad0034910a57aa88ed9976b1431b7b8c84e0048 commit
- git.kernel.org/stable/c/aa6107dcc4ce9a3451f2d729204713783b657257 commit
- git.kernel.org/stable/c/ff2e185cf73df480ec69675936c4ee75a445c3e4 commit
Vendor advisories
What the vendors themselves say about their products: affected, fixed or not affected, and what to do.
red hat product security vex CVE-2024-40974 updated cvss 6.6
kernel: powerpc/pseries: Enforce hcall result buffer validity and size
-
Red Hat Enterprise Linux 6 perf, kernel, python-perf, kernel-kdump, kernel-firmware, kernel-bootwrapper, +1 more Red Hat Enterprise Linux 7 perf, kernel, bpftool, kernel-rt, python-perf, kernel-kdump, +8 moreaffected: workaround, no fix planned “Out of support scope”
-
Red Hat Enterprise Linux 8 kernel-rt, kernel-rt-kvm, kernel-rt-core, kernel-rt-modules, kernel-rt-debug-kvm, kernel-rt-debug-core, +6 moreaffected: workaround, no fix planned “Will not fix”
-
Red Hat Enterprise Linux 9 rv, perf, rtla, kernel, bpftool, libperf, +83 moreaffected: workaround, no fix available, no fix planned “Will not fix”
-
Red Hat Enterprise Linux BaseOS (v. 8) perf 4.18.0-553.16.1.el8_10, kernel 4.18.0-553.16.1.el8_10, bpftool 4.18.0-553.16.1.el8_10, kernel-core 4.18.0-553.16.1.el8_10, kernel-tools 4.18.0-553.16.1.el8_10, python3-perf 4.18.0-553.16.1.el8_10, +15 more Red Hat Enterprise Linux CRB (v. 8) kernel-debuginfo-common-x86_64 4.18.0-553.16.1.el8_10, kernel-debuginfo-common-aarch64 4.18.0-553.16.1.el8_10, kernel-debuginfo-common-ppc64le 4.18.0-553.16.1.el8_10fixed: vendor fix RHSA-2024:5101
Red Hat CSAF VEX © Red Hat, Inc., from https://security.access.redhat.com/data/csaf/v2/vex/; changed: reduced to product statuses and remediations. CC BY 4.0 · csaf
cisa ICSA-25-226-07 updated
Siemens Third-Party Components in SINEC OS
-
Siemens RUGGEDCOM RST2428P (6GK6242-6PA00) Siemens SCALANCE XC-300/XR-300/XC-400/XR-500WG/XR-500 family Siemens SCALANCE XCM-/XRM-/XCH-/XRH-300 familynot affected
Facts from CISA's republication of the vendor's own advisory (CSAF); the linked advisory is the authoritative source. CISA notification · csaf
CISA SSVC
- Exploitation
- none
- Automatable
- no
- Technical impact
- partial
- Assessed
- 2 y ago
Exploit prediction
0.30% chance of exploitation in the next 30 days, higher than 23% of all scored CVEs (FIRST EPSS, 2026-11-08).
CVSS scores
| assigned by | version | score | vector |
|---|---|---|---|
| CNA | 3.1 | 7.8 | CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H |
| NVD | 3.1 | 7.8 | CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H |
Affected products
- Linux Linux
Classification
- Weakness
-
- CWE-787 Out-of-bounds Write
- Technology feeds
References
-
git.kernel.org
/stable/c/acf2b80c31c37acab040baa3cf5f19fbd5140b18
patch
-
git.kernel.org
/stable/c/19c166ee42cf16d8b156a6cb4544122d9a65d3ca
patch
-
git.kernel.org
/stable/c/a8c988d752b3d98d5cc1e3929c519a55ef55426c
patch
-
git.kernel.org
/stable/c/262e942ff5a839b9e4f3302a8987928b0c8b8a2d
patch
-
git.kernel.org
/stable/c/8aa11aa001576bf3b00dcb8559564ad7a3113588
patch
-
git.kernel.org
/stable/c/3ad0034910a57aa88ed9976b1431b7b8c84e0048
patch
-
git.kernel.org
/stable/c/aa6107dcc4ce9a3451f2d729204713783b657257
patch
-
git.kernel.org
/stable/c/ff2e185cf73df480ec69675936c4ee75a445c3e4
patch
- lists.debian.org /debian-lts-announce/2025/01/msg00001.html
Sources
- CVE List CVE-2024-40974
- NVD CVE-2024-40974
Fencer Vulns keeps one entry per vulnerability: the CVE id wins, then GHSA, and records that alias each other are merged, except that two CVEs always keep separate entries. The same data is available as JSON.