VDB

CVE-2024-40974

CVE-2024-40974 PUBLISHED CVSS 7.8 HIGH

powerpc/pseries: Enforce hcall result buffer validity and size

Reported by linux · Published July 12, 2024

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.

Fixed versions

Upgrade to a fixed version or later. Language registries are listed first, then Linux distributions, then vendor products.

PackageEcosystemFixed in
linux_kernellinux6.9.7, 6.6.36, 6.1.96, 5.15.162, 5.10.221, 5.4.279, 4.19.317
LinuxLinuxaa6107dcc4ce9a3451f2d729204713783b657257

Risk scores

CVSS 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

VendorProductVersions
LinuxLinuxb9377ffc3a03cde558d76349a262a1adbb6d3112, b9377ffc3a03cde558d76349a262a1adbb6d3112, b9377ffc3a03cde558d76349a262a1adbb6d3112
LinuxLinux2.6.19, 0, 4.19.317
LinuxLinux*, 6.9.7, 5.4.279
linuxlinux_kernel2.6.19, 2.6.19, 2.6.19

Timeline

  • Jul 12, 2024 CVE Published
  • Jul 13, 2024 EPSS Score (30 in total, the first dated here)
  • Oct 4, 2024 Coalition ESS Score (10 in total, the first dated here)
  • Jan 7, 2026 Security Advisory (315 in total, the first dated here)
  • Jan 7, 2026 CVE Updated
  • Mar 30, 2026 Distribution Patch (215 in total, the first dated here)

Query this with the API

The same record, from the CLI:

vulnetix vdb vuln CVE-2024-40974
vulnetix vdb fixes CVE-2024-40974

Or with curl, using the org id and key from your account page:

curl -s -H "Authorization: ApiKey ${VULNETIX_ORG_ID}:${VULNETIX_API_KEY}" \
  "https://api.vdb.vulnetix.com/v2/vuln/CVE-2024-40974/fixes/registry"

The Community plan is free and allows 50 queries a day. Get a free API key · API quickstart

Look up in the Resolve Platform →
$ Lookup Community · 50/day Open Lookup ›