Cloudanix VulnDB

CVE-2024-40974

None

CVSS

—

EPSS

0.3%

Published

Jul 12, 2024

CISA due date

—

Cloudanix analysis

Schedule a fix SSVC: Track

A coding oversight in the Linux kernel for certain IBM server hardware could let memory get overwritten if the wrong buffer size is used, potentially causing crashes.

Exploitation
Local Privilege
Attacker needs
Local User
Complexity
Theoretical
Impact
Data Tampering
Component
OS kernel
Class
Buffer Overflow
Remediation
Patch
Effort
Medium
Patch risk
Low

What it actually does

The hcall wrapper functions accept undersized result buffers via pointer parameters, allowing stores beyond the provided array bounds and resulting in stack corruption on powerpc platforms.

Why it matters to the business

Kernel instability or crashes on affected powerpc systems if developer code passes undersized buffers; low ecosystem prevalence reduces overall operational risk but still requires kernel updates on IBM pseries hardware.

How an attack unfolds

An attacker would need to trigger paths that invoke the hcall APIs with undersized result arrays, causing the hypervisor call wrappers to write results past the end of the stack buffer; no public exploitation or real-world instances have been identified.

How to fix it

Update the Linux kernel to commit acf2b80c31c37acab040baa3cf5f19fbd5140b18 or later; rebuild with -Warray-bounds enabled where possible to catch similar issues at compile time.

How to confirm the fix worked

Verify the running kernel contains commit acf2b80c31c37acab040baa3cf5f19fbd5140b18; inspect declarations of plpar_hcall, plpar_hcall9 and related functions for explicit array sizes instead of pointers.

Typical attack path

  1. Identify or induce code paths calling plpar_hcall9 or similar with undersized retbuf arrays
  2. Trigger the hcall so that result writes exceed the declared buffer size
  3. Overwrite adjacent stack frames leading to corruption or control-flow hijack

How to detect it

Review kernel logs for unexpected stack corruption or oops messages involving hcall result handling on powerpc; examine source for any remaining undersized buffer usage around plpar_hcall functions.

What your security team should do

  • Apply the fixed kernel commit on all powerpc pseries systems
  • Enable compiler warnings for array bounds on supported toolchains
  • Audit internal kernel modules or out-of-tree code that calls the affected hcall wrappers

The record

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

Ecosystem Package Introduced Fixed
Debian:11 linux 0 5.10.221-1
Debian:11 linux-6.1 0 6.1.119-1~deb11u1
Debian:12 linux 0 6.1.99-1
Debian:13 linux 0 6.9.7-1
Debian:14 linux 0 6.9.7-1
Linux Kernel 0 4.19.317
Linux Kernel 2.6.19 4.19.317
Red Hat:enterprise_linux:8::baseos bpftool 0 0:4.18.0-553.16.1.el8_10
Red Hat:enterprise_linux:8::baseos bpftool-debuginfo 0 0:4.18.0-553.16.1.el8_10
Red Hat:enterprise_linux:8::baseos kernel 0 0:4.18.0-553.16.1.el8_10
Red Hat:enterprise_linux:8::baseos kernel-abi-stablelists 0 0:4.18.0-553.16.1.el8_10
Red Hat:enterprise_linux:8::baseos kernel-core 0 0:4.18.0-553.16.1.el8_10
Red Hat:enterprise_linux:8::baseos kernel-cross-headers 0 0:4.18.0-553.16.1.el8_10
Red Hat:enterprise_linux:8::baseos kernel-debug 0 0:4.18.0-553.16.1.el8_10
Red Hat:enterprise_linux:8::baseos kernel-debug-core 0 0:4.18.0-553.16.1.el8_10
Red Hat:enterprise_linux:8::baseos kernel-debug-debuginfo 0 0:4.18.0-553.16.1.el8_10
Red Hat:enterprise_linux:8::baseos kernel-debug-devel 0 0:4.18.0-553.16.1.el8_10
Red Hat:enterprise_linux:8::baseos kernel-debug-modules 0 0:4.18.0-553.16.1.el8_10
Red Hat:enterprise_linux:8::baseos kernel-debug-modules-extra 0 0:4.18.0-553.16.1.el8_10
Red Hat:enterprise_linux:8::baseos kernel-debuginfo 0 0:4.18.0-553.16.1.el8_10
Red Hat:enterprise_linux:8::baseos kernel-debuginfo-common-aarch64 0 0:4.18.0-553.16.1.el8_10
Red Hat:enterprise_linux:8::baseos kernel-debuginfo-common-ppc64le 0 0:4.18.0-553.16.1.el8_10
Red Hat:enterprise_linux:8::baseos kernel-debuginfo-common-s390x 0 0:4.18.0-553.16.1.el8_10
Red Hat:enterprise_linux:8::baseos kernel-debuginfo-common-x86_64 0 0:4.18.0-553.16.1.el8_10
Red Hat:enterprise_linux:8::baseos kernel-devel 0 0:4.18.0-553.16.1.el8_10
Red Hat:enterprise_linux:8::baseos kernel-doc 0 0:4.18.0-553.16.1.el8_10
Red Hat:enterprise_linux:8::baseos kernel-headers 0 0:4.18.0-553.16.1.el8_10
Red Hat:enterprise_linux:8::baseos kernel-modules 0 0:4.18.0-553.16.1.el8_10
Red Hat:enterprise_linux:8::baseos kernel-modules-extra 0 0:4.18.0-553.16.1.el8_10
Red Hat:enterprise_linux:8::baseos kernel-tools 0 0:4.18.0-553.16.1.el8_10
Red Hat:enterprise_linux:8::baseos kernel-tools-debuginfo 0 0:4.18.0-553.16.1.el8_10
Red Hat:enterprise_linux:8::baseos kernel-tools-libs 0 0:4.18.0-553.16.1.el8_10
Red Hat:enterprise_linux:8::baseos kernel-tools-libs-devel 0 0:4.18.0-553.16.1.el8_10
Red Hat:enterprise_linux:8::baseos kernel-zfcpdump 0 0:4.18.0-553.16.1.el8_10
Red Hat:enterprise_linux:8::baseos kernel-zfcpdump-core 0 0:4.18.0-553.16.1.el8_10
Red Hat:enterprise_linux:8::baseos kernel-zfcpdump-debuginfo 0 0:4.18.0-553.16.1.el8_10
Red Hat:enterprise_linux:8::baseos kernel-zfcpdump-devel 0 0:4.18.0-553.16.1.el8_10
Red Hat:enterprise_linux:8::baseos kernel-zfcpdump-modules 0 0:4.18.0-553.16.1.el8_10
Red Hat:enterprise_linux:8::baseos kernel-zfcpdump-modules-extra 0 0:4.18.0-553.16.1.el8_10
Red Hat:enterprise_linux:8::baseos perf 0 0:4.18.0-553.16.1.el8_10
Red Hat:enterprise_linux:8::baseos perf-debuginfo 0 0:4.18.0-553.16.1.el8_10
Red Hat:enterprise_linux:8::baseos python3-perf 0 0:4.18.0-553.16.1.el8_10
Red Hat:enterprise_linux:8::baseos python3-perf-debuginfo 0 0:4.18.0-553.16.1.el8_10
Red Hat:enterprise_linux:8::crb bpftool 0 0:4.18.0-553.16.1.el8_10
Red Hat:enterprise_linux:8::crb bpftool-debuginfo 0 0:4.18.0-553.16.1.el8_10
Red Hat:enterprise_linux:8::crb kernel 0 0:4.18.0-553.16.1.el8_10
Red Hat:enterprise_linux:8::crb kernel-abi-stablelists 0 0:4.18.0-553.16.1.el8_10
Red Hat:enterprise_linux:8::crb kernel-core 0 0:4.18.0-553.16.1.el8_10
Red Hat:enterprise_linux:8::crb kernel-cross-headers 0 0:4.18.0-553.16.1.el8_10
Red Hat:enterprise_linux:8::crb kernel-debug 0 0:4.18.0-553.16.1.el8_10
Red Hat:enterprise_linux:8::crb kernel-debug-core 0 0:4.18.0-553.16.1.el8_10
Red Hat:enterprise_linux:8::crb kernel-debug-debuginfo 0 0:4.18.0-553.16.1.el8_10
Red Hat:enterprise_linux:8::crb kernel-debug-devel 0 0:4.18.0-553.16.1.el8_10
Red Hat:enterprise_linux:8::crb kernel-debug-modules 0 0:4.18.0-553.16.1.el8_10
Red Hat:enterprise_linux:8::crb kernel-debug-modules-extra 0 0:4.18.0-553.16.1.el8_10
Red Hat:enterprise_linux:8::crb kernel-debuginfo 0 0:4.18.0-553.16.1.el8_10
Red Hat:enterprise_linux:8::crb kernel-debuginfo-common-aarch64 0 0:4.18.0-553.16.1.el8_10
Red Hat:enterprise_linux:8::crb kernel-debuginfo-common-ppc64le 0 0:4.18.0-553.16.1.el8_10
Red Hat:enterprise_linux:8::crb kernel-debuginfo-common-s390x 0 0:4.18.0-553.16.1.el8_10
Red Hat:enterprise_linux:8::crb kernel-debuginfo-common-x86_64 0 0:4.18.0-553.16.1.el8_10
Red Hat:enterprise_linux:8::crb kernel-devel 0 0:4.18.0-553.16.1.el8_10
Red Hat:enterprise_linux:8::crb kernel-doc 0 0:4.18.0-553.16.1.el8_10
Red Hat:enterprise_linux:8::crb kernel-headers 0 0:4.18.0-553.16.1.el8_10
Red Hat:enterprise_linux:8::crb kernel-modules 0 0:4.18.0-553.16.1.el8_10
Red Hat:enterprise_linux:8::crb kernel-modules-extra 0 0:4.18.0-553.16.1.el8_10
Red Hat:enterprise_linux:8::crb kernel-tools 0 0:4.18.0-553.16.1.el8_10
Red Hat:enterprise_linux:8::crb kernel-tools-debuginfo 0 0:4.18.0-553.16.1.el8_10
Red Hat:enterprise_linux:8::crb kernel-tools-libs 0 0:4.18.0-553.16.1.el8_10
Red Hat:enterprise_linux:8::crb kernel-tools-libs-devel 0 0:4.18.0-553.16.1.el8_10
Red Hat:enterprise_linux:8::crb kernel-zfcpdump 0 0:4.18.0-553.16.1.el8_10
Red Hat:enterprise_linux:8::crb kernel-zfcpdump-core 0 0:4.18.0-553.16.1.el8_10
Red Hat:enterprise_linux:8::crb kernel-zfcpdump-debuginfo 0 0:4.18.0-553.16.1.el8_10
Red Hat:enterprise_linux:8::crb kernel-zfcpdump-devel 0 0:4.18.0-553.16.1.el8_10
Red Hat:enterprise_linux:8::crb kernel-zfcpdump-modules 0 0:4.18.0-553.16.1.el8_10
Red Hat:enterprise_linux:8::crb kernel-zfcpdump-modules-extra 0 0:4.18.0-553.16.1.el8_10
Red Hat:enterprise_linux:8::crb perf 0 0:4.18.0-553.16.1.el8_10
Red Hat:enterprise_linux:8::crb perf-debuginfo 0 0:4.18.0-553.16.1.el8_10
Red Hat:enterprise_linux:8::crb python3-perf 0 0:4.18.0-553.16.1.el8_10
Red Hat:enterprise_linux:8::crb python3-perf-debuginfo 0 0:4.18.0-553.16.1.el8_10
Rocky Linux:8 kernel 0 0:4.18.0-553.16.1.el8_10
Rocky Linux:8 kernel 0 0:4.18.0-553.16.1.el8_10.cloud.0.1
Ubuntu:16.04:LTS linux-hwe-edge 0 No fix
Ubuntu:18.04:LTS linux-aws-5.0 0 No fix
Ubuntu:18.04:LTS linux-aws-5.3 0 No fix
Ubuntu:18.04:LTS linux-azure 0 No fix
Ubuntu:18.04:LTS linux-azure-5.3 0 No fix
Ubuntu:18.04:LTS linux-azure-edge 0 No fix
Ubuntu:18.04:LTS linux-gcp 0 No fix
Ubuntu:18.04:LTS linux-gcp-5.3 0 No fix
Ubuntu:18.04:LTS linux-gke-4.15 0 No fix
Ubuntu:18.04:LTS linux-gke-5.4 0 No fix
Ubuntu:18.04:LTS linux-gkeop-5.4 0 No fix
Ubuntu:18.04:LTS linux-hwe 0 No fix
Ubuntu:18.04:LTS linux-hwe-edge 0 No fix
Ubuntu:18.04:LTS linux-oem 0 No fix
Ubuntu:18.04:LTS linux-oracle-5.0 0 No fix
Ubuntu:18.04:LTS linux-oracle-5.3 0 No fix
Ubuntu:20.04:LTS linux 0 No fix
Ubuntu:20.04:LTS linux 0 5.4.0-195.215
Ubuntu:20.04:LTS linux-aws 0 No fix
Ubuntu:20.04:LTS linux-aws 0 5.4.0-1132.142
Ubuntu:20.04:LTS linux-aws-5.11 0 No fix
Ubuntu:20.04:LTS linux-aws-5.13 0 No fix
Ubuntu:20.04:LTS linux-aws-5.15 0 No fix
Ubuntu:20.04:LTS linux-aws-5.15 0 5.15.0-1069.75~20.04.1
Ubuntu:20.04:LTS linux-aws-5.8 0 No fix
Ubuntu:20.04:LTS linux-azure 0 No fix
Ubuntu:20.04:LTS linux-azure 0 5.4.0-1137.144
Ubuntu:20.04:LTS linux-azure-5.11 0 No fix
Ubuntu:20.04:LTS linux-azure-5.13 0 No fix
Ubuntu:20.04:LTS linux-azure-5.15 0 No fix
Ubuntu:20.04:LTS linux-azure-5.15 0 5.15.0-1072.81~20.04.1
Ubuntu:20.04:LTS linux-azure-5.8 0 No fix
Ubuntu:20.04:LTS linux-azure-fde 0 No fix
Ubuntu:20.04:LTS linux-azure-fde-5.15 0 No fix
Ubuntu:20.04:LTS linux-azure-fde-5.15 0 5.15.0-1072.81~20.04.1.1
Ubuntu:20.04:LTS linux-bluefield 0 No fix
Ubuntu:20.04:LTS linux-bluefield 0 5.4.0-1092.99
Ubuntu:20.04:LTS linux-gcp 0 No fix
Ubuntu:20.04:LTS linux-gcp 0 5.4.0-1136.145
Ubuntu:20.04:LTS linux-gcp-5.11 0 No fix
Ubuntu:20.04:LTS linux-gcp-5.13 0 No fix
Ubuntu:20.04:LTS linux-gcp-5.15 0 No fix
Ubuntu:20.04:LTS linux-gcp-5.15 0 5.15.0-1068.76~20.04.1
Ubuntu:20.04:LTS linux-gcp-5.8 0 No fix
Ubuntu:20.04:LTS linux-gke 0 No fix
Ubuntu:20.04:LTS linux-gke-5.15 0 No fix
Ubuntu:20.04:LTS linux-gkeop 0 No fix
Ubuntu:20.04:LTS linux-gkeop 0 5.4.0-1099.103
Ubuntu:20.04:LTS linux-gkeop-5.15 0 No fix
Ubuntu:20.04:LTS linux-gkeop-5.15 0 5.15.0-1052.59~20.04.1
Ubuntu:20.04:LTS linux-hwe-5.11 0 No fix
Ubuntu:20.04:LTS linux-hwe-5.13 0 No fix
Ubuntu:20.04:LTS linux-hwe-5.15 0 No fix
Ubuntu:20.04:LTS linux-hwe-5.15 0 5.15.0-121.131~20.04.1
Ubuntu:20.04:LTS linux-hwe-5.8 0 No fix
Ubuntu:20.04:LTS linux-ibm 0 No fix
Ubuntu:20.04:LTS linux-ibm 0 5.4.0-1079.84
Ubuntu:20.04:LTS linux-ibm-5.15 0 No fix
Ubuntu:20.04:LTS linux-ibm-5.15 0 5.15.0-1062.65~20.04.1
Ubuntu:20.04:LTS linux-intel-5.13 0 No fix
Ubuntu:20.04:LTS linux-intel-iotg-5.15 0 No fix
Ubuntu:20.04:LTS linux-intel-iotg-5.15 0 5.15.0-1064.70~20.04.1
Ubuntu:20.04:LTS linux-iot 0 No fix
Ubuntu:20.04:LTS linux-iot 0 5.4.0-1043.44
Ubuntu:20.04:LTS linux-kvm 0 No fix
Ubuntu:20.04:LTS linux-kvm 0 5.4.0-1120.128
Ubuntu:20.04:LTS linux-lowlatency-hwe-5.15 0 No fix
Ubuntu:20.04:LTS linux-lowlatency-hwe-5.15 0 5.15.0-121.131~20.04.1
Ubuntu:20.04:LTS linux-nvidia-tegra-5.15 0 5.15.0-1030.30~20.04.1
Ubuntu:20.04:LTS linux-oem-5.10 0 No fix
Ubuntu:20.04:LTS linux-oem-5.13 0 No fix
Ubuntu:20.04:LTS linux-oem-5.14 0 No fix
Ubuntu:20.04:LTS linux-oem-5.6 0 No fix
Ubuntu:20.04:LTS linux-oracle 0 No fix
Ubuntu:20.04:LTS linux-oracle 0 5.4.0-1131.140
Ubuntu:20.04:LTS linux-oracle-5.11 0 No fix
Ubuntu:20.04:LTS linux-oracle-5.13 0 No fix
Ubuntu:20.04:LTS linux-oracle-5.15 0 No fix
Ubuntu:20.04:LTS linux-oracle-5.15 0 5.15.0-1067.73~20.04.1
Ubuntu:20.04:LTS linux-oracle-5.8 0 No fix
Ubuntu:20.04:LTS linux-raspi 0 No fix
Ubuntu:20.04:LTS linux-raspi 0 5.4.0-1116.128
Ubuntu:20.04:LTS linux-raspi2 0 No fix
Ubuntu:20.04:LTS linux-riscv 0 No fix
Ubuntu:20.04:LTS linux-riscv-5.11 0 No fix
Ubuntu:20.04:LTS linux-riscv-5.15 0 No fix
Ubuntu:20.04:LTS linux-riscv-5.15 0 5.15.0-1065.69~20.04.1
Ubuntu:20.04:LTS linux-riscv-5.8 0 No fix
Ubuntu:20.04:LTS linux-xilinx-zynqmp 0 No fix
Ubuntu:20.04:LTS linux-xilinx-zynqmp 0 5.4.0-1051.55
Ubuntu:22.04:LTS linux 0 No fix
Ubuntu:22.04:LTS linux 0 5.15.0-121.131
Ubuntu:22.04:LTS linux-allwinner-5.19 0 No fix
Ubuntu:22.04:LTS linux-aws 0 No fix
Ubuntu:22.04:LTS linux-aws 0 5.15.0-1069.75
Ubuntu:22.04:LTS linux-aws-5.19 0 No fix
Ubuntu:22.04:LTS linux-aws-6.2 0 No fix
Ubuntu:22.04:LTS linux-aws-6.5 0 No fix
Ubuntu:22.04:LTS linux-aws-6.8 0 6.8.0-1015.16~22.04.1
Ubuntu:22.04:LTS linux-azure 0 No fix
Ubuntu:22.04:LTS linux-azure 0 5.15.0-1072.81
Ubuntu:22.04:LTS linux-azure-5.19 0 No fix
Ubuntu:22.04:LTS linux-azure-6.2 0 No fix
Ubuntu:22.04:LTS linux-azure-6.5 0 No fix
Ubuntu:22.04:LTS linux-azure-6.8 0 No fix
Ubuntu:22.04:LTS linux-azure-6.8 0 6.8.0-1014.16~22.04.1
Ubuntu:22.04:LTS linux-azure-fde 0 No fix
Ubuntu:22.04:LTS linux-azure-fde 0 5.15.0-1072.81.1
Ubuntu:22.04:LTS linux-azure-fde-5.19 0 No fix
Ubuntu:22.04:LTS linux-azure-fde-6.2 0 No fix
Ubuntu:22.04:LTS linux-gcp 0 No fix
Ubuntu:22.04:LTS linux-gcp 0 5.15.0-1068.76
Ubuntu:22.04:LTS linux-gcp-5.19 0 No fix
Ubuntu:22.04:LTS linux-gcp-6.2 0 No fix
Ubuntu:22.04:LTS linux-gcp-6.5 0 No fix
Ubuntu:22.04:LTS linux-gcp-6.8 0 6.8.0-1014.16~22.04.1
Ubuntu:22.04:LTS linux-gke 0 No fix
Ubuntu:22.04:LTS linux-gke 0 5.15.0-1066.72
Ubuntu:22.04:LTS linux-gkeop 0 No fix

Related vulnerabilities