2084AI 安全观察

CVE

CVE-2024-40974

CVE-2024-40974HIGH 7.8EPSS 23%

CNA 原文 · 原文(英文)

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.

受影响版本

Linux kernel 的全部漏洞 →

  • ≥ 6.7, < 6.9.7修复版本 6.9.7
  • ≥ 6.2, < 6.6.36修复版本 6.6.36
  • ≥ 5.16, < 6.1.96修复版本 6.1.96
  • ≥ 5.11, < 5.15.162修复版本 5.15.162
  • ≥ 5.5, < 5.10.221修复版本 5.10.221
  • ≥ 4.20, < 5.4.279修复版本 5.4.279
  • < 4.19.317修复版本 4.19.317

发行版软件包(Debian、Ubuntu、Red Hat 等)会回移补丁而不改上游版本号,请同时查看所用发行版的安全公告。

公告与补丁

数据来源:NVD(公有领域)、CISA KEV(CC0)、FIRST EPSS、OSV.dev / GitHub Advisory Database(CC-BY 4.0) · 本库只列受影响版本与修复版本,不托管、不链接任何利用代码。