Vulnerability · Published Jul 12, 2024 · Assigned by Linux

CVE-2024-40974powerpc/pseries: Enforce hcall result buffer validity and size

High 7.8

In plain English

A high-severity security flaw in Linux from Linux. There are no confirmed reports of exploitation so far. The chance it is exploited in the next 30 days is estimated at 0.3% (higher than 23% of all known vulnerabilities). Fixed versions are available - upgrade the affected package.

Severity (CVSS 3.1)7.8High
Exploit odds (30 days)0.3%top 76.9% of all CVEs
Exploited in the wildNo reportsCISA SSVC: none
Attack toolingNoneno public tooling known

Official 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.

Affected packages & fixed versions

EcosystemPackageFixed inAdvisory
Debian:12linux6.1.99-1DEBIAN-CVE-2024-40974
Debian:13linux6.9.7-1DEBIAN-CVE-2024-40974
Debian:14linux6.9.7-1DEBIAN-CVE-2024-40974
Ubuntu:22.04:LTSlinux5.15.0-121.131UBUNTU-CVE-2024-40974
Ubuntu:24.04:LTSlinux6.8.0-44.44UBUNTU-CVE-2024-40974
Ubuntu:22.04:LTSlinux-allwinner-5.19no fix listedUBUNTU-CVE-2024-40974
Ubuntu:22.04:LTSlinux-aws5.15.0-1069.75UBUNTU-CVE-2024-40974
Ubuntu:24.04:LTSlinux-aws6.8.0-1015.16UBUNTU-CVE-2024-40974
Ubuntu:22.04:LTSlinux-aws-5.19no fix listedUBUNTU-CVE-2024-40974
Ubuntu:22.04:LTSlinux-aws-6.2no fix listedUBUNTU-CVE-2024-40974
Ubuntu:22.04:LTSlinux-aws-6.5no fix listedUBUNTU-CVE-2024-40974
Ubuntu:22.04:LTSlinux-aws-6.86.8.0-1015.16~22.04.1UBUNTU-CVE-2024-40974
Ubuntu:22.04:LTSlinux-azure5.15.0-1072.81UBUNTU-CVE-2024-40974
Ubuntu:24.04:LTSlinux-azure6.8.0-1014.16UBUNTU-CVE-2024-40974
Ubuntu:22.04:LTSlinux-azure-5.19no fix listedUBUNTU-CVE-2024-40974
Ubuntu:22.04:LTSlinux-azure-6.2no fix listedUBUNTU-CVE-2024-40974
Ubuntu:22.04:LTSlinux-azure-6.5no fix listedUBUNTU-CVE-2024-40974
Ubuntu:22.04:LTSlinux-azure-6.86.8.0-1014.16~22.04.1UBUNTU-CVE-2024-40974
Ubuntu:22.04:LTSlinux-azure-fde5.15.0-1072.81.1UBUNTU-CVE-2024-40974
Ubuntu:22.04:LTSlinux-azure-fde-5.19no fix listedUBUNTU-CVE-2024-40974
Ubuntu:22.04:LTSlinux-azure-fde-6.2no fix listedUBUNTU-CVE-2024-40974
Ubuntu:22.04:LTSlinux-gcp5.15.0-1068.76UBUNTU-CVE-2024-40974
Ubuntu:24.04:LTSlinux-gcp6.8.0-1014.16UBUNTU-CVE-2024-40974
Ubuntu:22.04:LTSlinux-gcp-5.19no fix listedUBUNTU-CVE-2024-40974
Ubuntu:22.04:LTSlinux-gcp-6.2no fix listedUBUNTU-CVE-2024-40974
Ubuntu:22.04:LTSlinux-gcp-6.5no fix listedUBUNTU-CVE-2024-40974
Ubuntu:22.04:LTSlinux-gcp-6.86.8.0-1014.16~22.04.1UBUNTU-CVE-2024-40974
Ubuntu:22.04:LTSlinux-gke5.15.0-1066.72UBUNTU-CVE-2024-40974
Ubuntu:24.04:LTSlinux-gke6.8.0-1010.13UBUNTU-CVE-2024-40974
Ubuntu:22.04:LTSlinux-gkeop5.15.0-1052.59UBUNTU-CVE-2024-40974
Ubuntu:22.04:LTSlinux-hwe-5.19no fix listedUBUNTU-CVE-2024-40974
Ubuntu:22.04:LTSlinux-hwe-6.2no fix listedUBUNTU-CVE-2024-40974
Ubuntu:22.04:LTSlinux-hwe-6.5no fix listedUBUNTU-CVE-2024-40974
Ubuntu:22.04:LTSlinux-hwe-6.86.8.0-45.45~22.04.1UBUNTU-CVE-2024-40974
Ubuntu:22.04:LTSlinux-ibm5.15.0-1062.65UBUNTU-CVE-2024-40974
Ubuntu:24.04:LTSlinux-ibm6.8.0-1012.12UBUNTU-CVE-2024-40974
Ubuntu:22.04:LTSlinux-ibm-6.86.8.0-1012.12~22.04.1UBUNTU-CVE-2024-40974
Ubuntu:22.04:LTSlinux-intel-iotg5.15.0-1064.70UBUNTU-CVE-2024-40974
Ubuntu:22.04:LTSlinux-kvm5.15.0-1066.71UBUNTU-CVE-2024-40974
Ubuntu:22.04:LTSlinux-lowlatency5.15.0-121.131UBUNTU-CVE-2024-40974
Ubuntu:24.04:LTSlinux-lowlatency6.8.0-44.44.1UBUNTU-CVE-2024-40974
Ubuntu:22.04:LTSlinux-lowlatency-hwe-5.19no fix listedUBUNTU-CVE-2024-40974
Ubuntu:22.04:LTSlinux-lowlatency-hwe-6.2no fix listedUBUNTU-CVE-2024-40974
Ubuntu:22.04:LTSlinux-lowlatency-hwe-6.5no fix listedUBUNTU-CVE-2024-40974
Ubuntu:22.04:LTSlinux-lowlatency-hwe-6.86.8.0-44.44.1~22.04.1UBUNTU-CVE-2024-40974
Ubuntu:22.04:LTSlinux-nvidia5.15.0-1064.65UBUNTU-CVE-2024-40974
Ubuntu:24.04:LTSlinux-nvidia6.8.0-1013.14UBUNTU-CVE-2024-40974
Ubuntu:22.04:LTSlinux-nvidia-6.2no fix listedUBUNTU-CVE-2024-40974
Ubuntu:22.04:LTSlinux-nvidia-6.5no fix listedUBUNTU-CVE-2024-40974
Ubuntu:22.04:LTSlinux-nvidia-6.86.8.0-1013.14~22.04.1UBUNTU-CVE-2024-40974
Ubuntu:24.04:LTSlinux-nvidia-lowlatency6.8.0-1013.14.1UBUNTU-CVE-2024-40974
Ubuntu:22.04:LTSlinux-nvidia-tegra5.15.0-1028.28UBUNTU-CVE-2024-40974
Ubuntu:22.04:LTSlinux-nvidia-tegra-igx5.15.0-1016.16UBUNTU-CVE-2024-40974
Ubuntu:22.04:LTSlinux-oem-5.17no fix listedUBUNTU-CVE-2024-40974
Ubuntu:22.04:LTSlinux-oem-6.0no fix listedUBUNTU-CVE-2024-40974
Ubuntu:22.04:LTSlinux-oem-6.1no fix listedUBUNTU-CVE-2024-40974
Ubuntu:22.04:LTSlinux-oem-6.5no fix listedUBUNTU-CVE-2024-40974
Ubuntu:24.04:LTSlinux-oem-6.86.8.0-1012.12UBUNTU-CVE-2024-40974
Ubuntu:22.04:LTSlinux-oracle5.15.0-1067.73UBUNTU-CVE-2024-40974
Ubuntu:24.04:LTSlinux-oracle6.8.0-1012.12UBUNTU-CVE-2024-40974
Ubuntu:22.04:LTSlinux-oracle-6.5no fix listedUBUNTU-CVE-2024-40974
Ubuntu:22.04:LTSlinux-oracle-6.86.8.0-1012.12~22.04.1UBUNTU-CVE-2024-40974
Ubuntu:22.04:LTSlinux-raspi5.15.0-1062.65UBUNTU-CVE-2024-40974
Ubuntu:24.04:LTSlinux-raspi6.8.0-1011.12UBUNTU-CVE-2024-40974
Ubuntu:22.04:LTSlinux-realtimeno fix listedUBUNTU-CVE-2024-40974
Ubuntu:22.04:LTSlinux-riscvno fix listedUBUNTU-CVE-2024-40974
Ubuntu:24.04:LTSlinux-riscv6.8.0-44.44.1UBUNTU-CVE-2024-40974
Ubuntu:22.04:LTSlinux-riscv-5.19no fix listedUBUNTU-CVE-2024-40974
Ubuntu:22.04:LTSlinux-riscv-6.5no fix listedUBUNTU-CVE-2024-40974
Ubuntu:22.04:LTSlinux-riscv-6.86.8.0-44.44.1~22.04.1UBUNTU-CVE-2024-40974
Ubuntu:22.04:LTSlinux-starfive-5.19no fix listedUBUNTU-CVE-2024-40974
Ubuntu:22.04:LTSlinux-starfive-6.2no fix listedUBUNTU-CVE-2024-40974
Ubuntu:22.04:LTSlinux-starfive-6.5no fix listedUBUNTU-CVE-2024-40974
Ubuntu:22.04:LTSlinux-xilinx-zynqmp5.15.0-1035.39UBUNTU-CVE-2024-40974

Affected products (as reported)

VendorProductVersions
Linux Linux b9377ffc3a03cde558d76349a262a1adbb6d3112 – before acf2b80c31c37acab040baa3cf5f19fbd5140b18b9377ffc3a03cde558d76349a262a1adbb6d3112 – before 19c166ee42cf16d8b156a6cb4544122d9a65d3cab9377ffc3a03cde558d76349a262a1adbb6d3112 – before a8c988d752b3d98d5cc1e3929c519a55ef55426cb9377ffc3a03cde558d76349a262a1adbb6d3112 – before 262e942ff5a839b9e4f3302a8987928b0c8b8a2db9377ffc3a03cde558d76349a262a1adbb6d3112 – before 8aa11aa001576bf3b00dcb8559564ad7a3113588b9377ffc3a03cde558d76349a262a1adbb6d3112 – before 3ad0034910a57aa88ed9976b1431b7b8c84e0048b9377ffc3a03cde558d76349a262a1adbb6d3112 – before aa6107dcc4ce9a3451f2d729204713783b657257b9377ffc3a03cde558d76349a262a1adbb6d3112 – before ff2e185cf73df480ec69675936c4ee75a445c3e4
Linux Linux 2.6.19

References