CVE-2024-40974

powerpc/pseries: Enforce hcall result buffer validity and size

7.8 high EPSS 0.30%

Published 12 Jul 2024 Updated 5 Aug 2026 CNA: Linux

Check your servers for CVE-2024-40974

The Vulnpocalypse collector sends the package list of each Linux server and of its container images once a day. Vulnpocalypse shows every server where CVE-2024-40974 affects the running kernel, with the command that installs the fix. The free plan covers one server and one domain and does not need a credit card.

Check my servers

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.

Severity (CVSS)

7.8 high CVSS 3.1 from Linux (CNA)
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
Attack vector
local: the attacker needs local access, or a user has to open a prepared file
Attack complexity
low: an attack works without special conditions
Privileges required
low: the attacker needs an ordinary user account
User interaction
none: nobody has to click or open anything
Scope
unchanged: the damage stays inside the vulnerable component
Impact
confidentiality high, integrity high, availability high: what an attacker can read (confidentiality), change (integrity) or stop (availability)

Exploitation

EPSS 0.30%: the probability of exploitation activity in the next 30 days, from the EPSS model of FIRST. The score is higher than 24.7% of all scored CVEs. Scores of 1 Dec 2026.

The assessment of CISA (SSVC, 10 Sep 2024):

Exploitation
none: CISA did not find evidence of exploitation or a public proof of concept
Automatable
no: each attack takes manual steps
Technical impact
partial: limited control or limited data

Affected products

As the CNA lists them.

ProductVersions
Linux
affected from b9377ffc3a03cde558d76349a262a1adbb6d3112, before acf2b80c31c37acab040baa3cf5f19fbd5140b18
affected from b9377ffc3a03cde558d76349a262a1adbb6d3112, before 19c166ee42cf16d8b156a6cb4544122d9a65d3ca
affected from b9377ffc3a03cde558d76349a262a1adbb6d3112, before a8c988d752b3d98d5cc1e3929c519a55ef55426c
affected from b9377ffc3a03cde558d76349a262a1adbb6d3112, before 262e942ff5a839b9e4f3302a8987928b0c8b8a2d
affected from b9377ffc3a03cde558d76349a262a1adbb6d3112, before 8aa11aa001576bf3b00dcb8559564ad7a3113588
affected from b9377ffc3a03cde558d76349a262a1adbb6d3112, before 3ad0034910a57aa88ed9976b1431b7b8c84e0048
affected from b9377ffc3a03cde558d76349a262a1adbb6d3112, before aa6107dcc4ce9a3451f2d729204713783b657257
affected from b9377ffc3a03cde558d76349a262a1adbb6d3112, before ff2e185cf73df480ec69675936c4ee75a445c3e4
Other versions: unaffected
Linux
affected 2.6.19
unaffected before 2.6.19
unaffected from 4.19.317 up to and including 4.19.*
unaffected from 5.4.279 up to and including 5.4.*
unaffected from 5.10.221 up to and including 5.10.*
unaffected from 5.15.162 up to and including 5.15.*
unaffected from 6.1.96 up to and including 6.1.*
unaffected from 6.6.36 up to and including 6.6.*
unaffected from 6.9.7 up to and including 6.9.*
unaffected 6.10 and later
Other versions: affected

Is my server affected?

This CVE is in the Linux kernel. Compare the running kernel with the fixed kernel version of your distribution, and reboot after a kernel update:

uname -r
# Debian, Ubuntu: does the changelog of the running kernel name the CVE?
zgrep -l CVE-2024-40974 /usr/share/doc/linux-image-$(uname -r)/changelog.Debian.gz
# RHEL, Rocky, Alma
rpm -q --changelog kernel | grep CVE-2024-40974

With Trivy, on the host and for a container image. When a package is affected, it prints the installed and the fixed version:

trivy rootfs --scanners vuln / | grep CVE-2024-40974
trivy image --scanners vuln IMAGE | grep CVE-2024-40974

Vulnpocalypse makes this comparison every day for the package lists of your servers and container images, including language packages (npm, PyPI, Go, Maven and others), and sends the command that installs the fix. Start free with one server and one domain or read how to install the collector.

References

Other references

Source: the record CVE-2024-40974 of the CVE List (CVE Program), CVE Terms of Use; the CISA KEV catalog and the CISA ADP container; EPSS of FIRST. The text of the record is shown as published. Data sources and licences.