<?xml version="1.0" encoding="UTF-8"?>
<cvrfdoc xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:cpe="http://cpe.mitre.org/language/2.0" xmlns:cvrf="http://docs.oasis-open.org/csaf/ns/csaf-cvrf/v1.2/cvrf" xmlns:cvrf-common="http://docs.oasis-open.org/csaf/ns/csaf-cvrf/v1.2/common" xmlns:cvssv2="http://scap.nist.gov/schema/cvss-v2/1.0" xmlns:cvssv3="https://www.first.org/cvss/cvss-v3.0.xsd" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:ns0="http://purl.org/dc/elements/1.1/" xmlns:prod="http://docs.oasis-open.org/csaf/ns/csaf-cvrf/v1.2/prod" xmlns:scap-core="http://scap.nist.gov/schema/scap-core/1.0" xmlns:sch="http://purl.oclc.org/dsdl/schematron" xmlns:vuln="http://docs.oasis-open.org/csaf/ns/csaf-cvrf/v1.2/vuln" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://docs.oasis-open.org/csaf/ns/csaf-cvrf/v1.2/cvrf">
  <DocumentTitle xml:lang="en">CVE-2024-40974</DocumentTitle>
  <DocumentType>SUSE CVE</DocumentType>
  <DocumentPublisher Type="Vendor">
    <ContactDetails>security@suse.de</ContactDetails>
    <IssuingAuthority>SUSE Security Team</IssuingAuthority>
  </DocumentPublisher>
  <DocumentTracking>
    <Identification>
      <ID>SUSE CVE-2024-40974</ID>
    </Identification>
    <Status>Interim</Status>
    <Version>1</Version>
    <RevisionHistory>
      <Revision>
        <Number>21</Number>
        <Date>2025-03-24T00:36:09Z</Date>
        <Description>current</Description>
      </Revision>
    </RevisionHistory>
    <InitialReleaseDate>2024-07-16T23:10:13Z</InitialReleaseDate>
    <CurrentReleaseDate>2025-03-24T00:36:09Z</CurrentReleaseDate>
    <Generator>
      <Engine>cve-database/bin/generate-cvrf-cve.pl</Engine>
      <Date>2020-12-27T01:00:00Z</Date>
    </Generator>
  </DocumentTracking>
  <DocumentNotes>
    <Note Title="CVE" Type="Summary" Ordinal="1" xml:lang="en">CVE-2024-40974</Note>
    <Note Title="Mitre CVE Description" Type="Description" Ordinal="2" xml:lang="en">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.</Note>
    <Note Title="Terms of Use" Type="Legal Disclaimer" Ordinal="4" xml:lang="en">The CVRF data is provided by SUSE under the Creative Commons License 4.0 with Attribution (CC-BY-4.0).</Note>
  </DocumentNotes>
  <DocumentReferences>
    <Reference Type="Self">
      <URL>https://www.suse.com/support/security/rating/</URL>
      <Description>SUSE Security Ratings</Description>
    </Reference>
  </DocumentReferences>
  <ProductTree xmlns="http://docs.oasis-open.org/csaf/ns/csaf-cvrf/v1.2/prod">
    <Branch Type="Product Family" Name="SUSE Liberty Linux 8">
      <Branch Type="Product Name" Name="SUSE Liberty Linux 8">
        <FullProductName ProductID="SUSE Liberty Linux 8" CPE="cpe:/o:suse:sll:8">SUSE Liberty Linux 8</FullProductName>
      </Branch>
    </Branch>
    <Branch Type="Product Version" Name="bpftool-4.18.0-553.16.1.el8_10">
      <FullProductName ProductID="bpftool-4.18.0-553.16.1.el8_10">bpftool-4.18.0-553.16.1.el8_10</FullProductName>
    </Branch>
    <Branch Type="Product Version" Name="kernel-4.18.0-553.16.1.el8_10">
      <FullProductName ProductID="kernel-4.18.0-553.16.1.el8_10">kernel-4.18.0-553.16.1.el8_10</FullProductName>
    </Branch>
    <Branch Type="Product Version" Name="kernel-abi-stablelists-4.18.0-553.16.1.el8_10">
      <FullProductName ProductID="kernel-abi-stablelists-4.18.0-553.16.1.el8_10">kernel-abi-stablelists-4.18.0-553.16.1.el8_10</FullProductName>
    </Branch>
    <Branch Type="Product Version" Name="kernel-core-4.18.0-553.16.1.el8_10">
      <FullProductName ProductID="kernel-core-4.18.0-553.16.1.el8_10">kernel-core-4.18.0-553.16.1.el8_10</FullProductName>
    </Branch>
    <Branch Type="Product Version" Name="kernel-cross-headers-4.18.0-553.16.1.el8_10">
      <FullProductName ProductID="kernel-cross-headers-4.18.0-553.16.1.el8_10">kernel-cross-headers-4.18.0-553.16.1.el8_10</FullProductName>
    </Branch>
    <Branch Type="Product Version" Name="kernel-debug-4.18.0-553.16.1.el8_10">
      <FullProductName ProductID="kernel-debug-4.18.0-553.16.1.el8_10" CPE="cpe:2.3:a:linux:linux_kernel:4.18.0:*:*:*:*:*:*:*">kernel-debug-4.18.0-553.16.1.el8_10</FullProductName>
    </Branch>
    <Branch Type="Product Version" Name="kernel-debug-core-4.18.0-553.16.1.el8_10">
      <FullProductName ProductID="kernel-debug-core-4.18.0-553.16.1.el8_10">kernel-debug-core-4.18.0-553.16.1.el8_10</FullProductName>
    </Branch>
    <Branch Type="Product Version" Name="kernel-debug-devel-4.18.0-553.16.1.el8_10">
      <FullProductName ProductID="kernel-debug-devel-4.18.0-553.16.1.el8_10">kernel-debug-devel-4.18.0-553.16.1.el8_10</FullProductName>
    </Branch>
    <Branch Type="Product Version" Name="kernel-debug-modules-4.18.0-553.16.1.el8_10">
      <FullProductName ProductID="kernel-debug-modules-4.18.0-553.16.1.el8_10">kernel-debug-modules-4.18.0-553.16.1.el8_10</FullProductName>
    </Branch>
    <Branch Type="Product Version" Name="kernel-debug-modules-extra-4.18.0-553.16.1.el8_10">
      <FullProductName ProductID="kernel-debug-modules-extra-4.18.0-553.16.1.el8_10">kernel-debug-modules-extra-4.18.0-553.16.1.el8_10</FullProductName>
    </Branch>
    <Branch Type="Product Version" Name="kernel-devel-4.18.0-553.16.1.el8_10">
      <FullProductName ProductID="kernel-devel-4.18.0-553.16.1.el8_10" CPE="cpe:2.3:o:linux:linux_kernel:4.18.0:*:*:*:*:*:*:*">kernel-devel-4.18.0-553.16.1.el8_10</FullProductName>
    </Branch>
    <Branch Type="Product Version" Name="kernel-doc-4.18.0-553.16.1.el8_10">
      <FullProductName ProductID="kernel-doc-4.18.0-553.16.1.el8_10">kernel-doc-4.18.0-553.16.1.el8_10</FullProductName>
    </Branch>
    <Branch Type="Product Version" Name="kernel-headers-4.18.0-553.16.1.el8_10">
      <FullProductName ProductID="kernel-headers-4.18.0-553.16.1.el8_10">kernel-headers-4.18.0-553.16.1.el8_10</FullProductName>
    </Branch>
    <Branch Type="Product Version" Name="kernel-modules-4.18.0-553.16.1.el8_10">
      <FullProductName ProductID="kernel-modules-4.18.0-553.16.1.el8_10">kernel-modules-4.18.0-553.16.1.el8_10</FullProductName>
    </Branch>
    <Branch Type="Product Version" Name="kernel-modules-extra-4.18.0-553.16.1.el8_10">
      <FullProductName ProductID="kernel-modules-extra-4.18.0-553.16.1.el8_10">kernel-modules-extra-4.18.0-553.16.1.el8_10</FullProductName>
    </Branch>
    <Branch Type="Product Version" Name="kernel-tools-4.18.0-553.16.1.el8_10">
      <FullProductName ProductID="kernel-tools-4.18.0-553.16.1.el8_10">kernel-tools-4.18.0-553.16.1.el8_10</FullProductName>
    </Branch>
    <Branch Type="Product Version" Name="kernel-tools-libs-4.18.0-553.16.1.el8_10">
      <FullProductName ProductID="kernel-tools-libs-4.18.0-553.16.1.el8_10">kernel-tools-libs-4.18.0-553.16.1.el8_10</FullProductName>
    </Branch>
    <Branch Type="Product Version" Name="kernel-tools-libs-devel-4.18.0-553.16.1.el8_10">
      <FullProductName ProductID="kernel-tools-libs-devel-4.18.0-553.16.1.el8_10">kernel-tools-libs-devel-4.18.0-553.16.1.el8_10</FullProductName>
    </Branch>
    <Branch Type="Product Version" Name="perf-4.18.0-553.16.1.el8_10">
      <FullProductName ProductID="perf-4.18.0-553.16.1.el8_10">perf-4.18.0-553.16.1.el8_10</FullProductName>
    </Branch>
    <Branch Type="Product Version" Name="python3-perf-4.18.0-553.16.1.el8_10">
      <FullProductName ProductID="python3-perf-4.18.0-553.16.1.el8_10">python3-perf-4.18.0-553.16.1.el8_10</FullProductName>
    </Branch>
    <Relationship ProductReference="bpftool-4.18.0-553.16.1.el8_10" RelationType="Default Component Of" RelatesToProductReference="SUSE Liberty Linux 8">
      <FullProductName ProductID="SUSE Liberty Linux 8:bpftool-4.18.0-553.16.1.el8_10">bpftool-4.18.0-553.16.1.el8_10 as a component of SUSE Liberty Linux 8</FullProductName>
    </Relationship>
    <Relationship ProductReference="kernel-4.18.0-553.16.1.el8_10" RelationType="Default Component Of" RelatesToProductReference="SUSE Liberty Linux 8">
      <FullProductName ProductID="SUSE Liberty Linux 8:kernel-4.18.0-553.16.1.el8_10">kernel-4.18.0-553.16.1.el8_10 as a component of SUSE Liberty Linux 8</FullProductName>
    </Relationship>
    <Relationship ProductReference="kernel-abi-stablelists-4.18.0-553.16.1.el8_10" RelationType="Default Component Of" RelatesToProductReference="SUSE Liberty Linux 8">
      <FullProductName ProductID="SUSE Liberty Linux 8:kernel-abi-stablelists-4.18.0-553.16.1.el8_10">kernel-abi-stablelists-4.18.0-553.16.1.el8_10 as a component of SUSE Liberty Linux 8</FullProductName>
    </Relationship>
    <Relationship ProductReference="kernel-core-4.18.0-553.16.1.el8_10" RelationType="Default Component Of" RelatesToProductReference="SUSE Liberty Linux 8">
      <FullProductName ProductID="SUSE Liberty Linux 8:kernel-core-4.18.0-553.16.1.el8_10">kernel-core-4.18.0-553.16.1.el8_10 as a component of SUSE Liberty Linux 8</FullProductName>
    </Relationship>
    <Relationship ProductReference="kernel-cross-headers-4.18.0-553.16.1.el8_10" RelationType="Default Component Of" RelatesToProductReference="SUSE Liberty Linux 8">
      <FullProductName ProductID="SUSE Liberty Linux 8:kernel-cross-headers-4.18.0-553.16.1.el8_10">kernel-cross-headers-4.18.0-553.16.1.el8_10 as a component of SUSE Liberty Linux 8</FullProductName>
    </Relationship>
    <Relationship ProductReference="kernel-debug-4.18.0-553.16.1.el8_10" RelationType="Default Component Of" RelatesToProductReference="SUSE Liberty Linux 8">
      <FullProductName ProductID="SUSE Liberty Linux 8:kernel-debug-4.18.0-553.16.1.el8_10">kernel-debug-4.18.0-553.16.1.el8_10 as a component of SUSE Liberty Linux 8</FullProductName>
    </Relationship>
    <Relationship ProductReference="kernel-debug-core-4.18.0-553.16.1.el8_10" RelationType="Default Component Of" RelatesToProductReference="SUSE Liberty Linux 8">
      <FullProductName ProductID="SUSE Liberty Linux 8:kernel-debug-core-4.18.0-553.16.1.el8_10">kernel-debug-core-4.18.0-553.16.1.el8_10 as a component of SUSE Liberty Linux 8</FullProductName>
    </Relationship>
    <Relationship ProductReference="kernel-debug-devel-4.18.0-553.16.1.el8_10" RelationType="Default Component Of" RelatesToProductReference="SUSE Liberty Linux 8">
      <FullProductName ProductID="SUSE Liberty Linux 8:kernel-debug-devel-4.18.0-553.16.1.el8_10">kernel-debug-devel-4.18.0-553.16.1.el8_10 as a component of SUSE Liberty Linux 8</FullProductName>
    </Relationship>
    <Relationship ProductReference="kernel-debug-modules-4.18.0-553.16.1.el8_10" RelationType="Default Component Of" RelatesToProductReference="SUSE Liberty Linux 8">
      <FullProductName ProductID="SUSE Liberty Linux 8:kernel-debug-modules-4.18.0-553.16.1.el8_10">kernel-debug-modules-4.18.0-553.16.1.el8_10 as a component of SUSE Liberty Linux 8</FullProductName>
    </Relationship>
    <Relationship ProductReference="kernel-debug-modules-extra-4.18.0-553.16.1.el8_10" RelationType="Default Component Of" RelatesToProductReference="SUSE Liberty Linux 8">
      <FullProductName ProductID="SUSE Liberty Linux 8:kernel-debug-modules-extra-4.18.0-553.16.1.el8_10">kernel-debug-modules-extra-4.18.0-553.16.1.el8_10 as a component of SUSE Liberty Linux 8</FullProductName>
    </Relationship>
    <Relationship ProductReference="kernel-devel-4.18.0-553.16.1.el8_10" RelationType="Default Component Of" RelatesToProductReference="SUSE Liberty Linux 8">
      <FullProductName ProductID="SUSE Liberty Linux 8:kernel-devel-4.18.0-553.16.1.el8_10">kernel-devel-4.18.0-553.16.1.el8_10 as a component of SUSE Liberty Linux 8</FullProductName>
    </Relationship>
    <Relationship ProductReference="kernel-doc-4.18.0-553.16.1.el8_10" RelationType="Default Component Of" RelatesToProductReference="SUSE Liberty Linux 8">
      <FullProductName ProductID="SUSE Liberty Linux 8:kernel-doc-4.18.0-553.16.1.el8_10">kernel-doc-4.18.0-553.16.1.el8_10 as a component of SUSE Liberty Linux 8</FullProductName>
    </Relationship>
    <Relationship ProductReference="kernel-headers-4.18.0-553.16.1.el8_10" RelationType="Default Component Of" RelatesToProductReference="SUSE Liberty Linux 8">
      <FullProductName ProductID="SUSE Liberty Linux 8:kernel-headers-4.18.0-553.16.1.el8_10">kernel-headers-4.18.0-553.16.1.el8_10 as a component of SUSE Liberty Linux 8</FullProductName>
    </Relationship>
    <Relationship ProductReference="kernel-modules-4.18.0-553.16.1.el8_10" RelationType="Default Component Of" RelatesToProductReference="SUSE Liberty Linux 8">
      <FullProductName ProductID="SUSE Liberty Linux 8:kernel-modules-4.18.0-553.16.1.el8_10">kernel-modules-4.18.0-553.16.1.el8_10 as a component of SUSE Liberty Linux 8</FullProductName>
    </Relationship>
    <Relationship ProductReference="kernel-modules-extra-4.18.0-553.16.1.el8_10" RelationType="Default Component Of" RelatesToProductReference="SUSE Liberty Linux 8">
      <FullProductName ProductID="SUSE Liberty Linux 8:kernel-modules-extra-4.18.0-553.16.1.el8_10">kernel-modules-extra-4.18.0-553.16.1.el8_10 as a component of SUSE Liberty Linux 8</FullProductName>
    </Relationship>
    <Relationship ProductReference="kernel-tools-4.18.0-553.16.1.el8_10" RelationType="Default Component Of" RelatesToProductReference="SUSE Liberty Linux 8">
      <FullProductName ProductID="SUSE Liberty Linux 8:kernel-tools-4.18.0-553.16.1.el8_10">kernel-tools-4.18.0-553.16.1.el8_10 as a component of SUSE Liberty Linux 8</FullProductName>
    </Relationship>
    <Relationship ProductReference="kernel-tools-libs-4.18.0-553.16.1.el8_10" RelationType="Default Component Of" RelatesToProductReference="SUSE Liberty Linux 8">
      <FullProductName ProductID="SUSE Liberty Linux 8:kernel-tools-libs-4.18.0-553.16.1.el8_10">kernel-tools-libs-4.18.0-553.16.1.el8_10 as a component of SUSE Liberty Linux 8</FullProductName>
    </Relationship>
    <Relationship ProductReference="kernel-tools-libs-devel-4.18.0-553.16.1.el8_10" RelationType="Default Component Of" RelatesToProductReference="SUSE Liberty Linux 8">
      <FullProductName ProductID="SUSE Liberty Linux 8:kernel-tools-libs-devel-4.18.0-553.16.1.el8_10">kernel-tools-libs-devel-4.18.0-553.16.1.el8_10 as a component of SUSE Liberty Linux 8</FullProductName>
    </Relationship>
    <Relationship ProductReference="perf-4.18.0-553.16.1.el8_10" RelationType="Default Component Of" RelatesToProductReference="SUSE Liberty Linux 8">
      <FullProductName ProductID="SUSE Liberty Linux 8:perf-4.18.0-553.16.1.el8_10">perf-4.18.0-553.16.1.el8_10 as a component of SUSE Liberty Linux 8</FullProductName>
    </Relationship>
    <Relationship ProductReference="python3-perf-4.18.0-553.16.1.el8_10" RelationType="Default Component Of" RelatesToProductReference="SUSE Liberty Linux 8">
      <FullProductName ProductID="SUSE Liberty Linux 8:python3-perf-4.18.0-553.16.1.el8_10">python3-perf-4.18.0-553.16.1.el8_10 as a component of SUSE Liberty Linux 8</FullProductName>
    </Relationship>
  </ProductTree>
  <Vulnerability xmlns="http://docs.oasis-open.org/csaf/ns/csaf-cvrf/v1.2/vuln" Ordinal="1">
    <Notes>
      <Note Title="Vulnerability Description" Type="General" Ordinal="1" xml:lang="en">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.</Note>
    </Notes>
    <CVE>CVE-2024-40974</CVE>
    <ProductStatuses>
      <Status Type="Fixed">
        <ProductID>SUSE Liberty Linux 8:bpftool-4.18.0-553.16.1.el8_10</ProductID>
        <ProductID>SUSE Liberty Linux 8:kernel-4.18.0-553.16.1.el8_10</ProductID>
        <ProductID>SUSE Liberty Linux 8:kernel-abi-stablelists-4.18.0-553.16.1.el8_10</ProductID>
        <ProductID>SUSE Liberty Linux 8:kernel-core-4.18.0-553.16.1.el8_10</ProductID>
        <ProductID>SUSE Liberty Linux 8:kernel-cross-headers-4.18.0-553.16.1.el8_10</ProductID>
        <ProductID>SUSE Liberty Linux 8:kernel-debug-4.18.0-553.16.1.el8_10</ProductID>
        <ProductID>SUSE Liberty Linux 8:kernel-debug-core-4.18.0-553.16.1.el8_10</ProductID>
        <ProductID>SUSE Liberty Linux 8:kernel-debug-devel-4.18.0-553.16.1.el8_10</ProductID>
        <ProductID>SUSE Liberty Linux 8:kernel-debug-modules-4.18.0-553.16.1.el8_10</ProductID>
        <ProductID>SUSE Liberty Linux 8:kernel-debug-modules-extra-4.18.0-553.16.1.el8_10</ProductID>
        <ProductID>SUSE Liberty Linux 8:kernel-devel-4.18.0-553.16.1.el8_10</ProductID>
        <ProductID>SUSE Liberty Linux 8:kernel-doc-4.18.0-553.16.1.el8_10</ProductID>
        <ProductID>SUSE Liberty Linux 8:kernel-headers-4.18.0-553.16.1.el8_10</ProductID>
        <ProductID>SUSE Liberty Linux 8:kernel-modules-4.18.0-553.16.1.el8_10</ProductID>
        <ProductID>SUSE Liberty Linux 8:kernel-modules-extra-4.18.0-553.16.1.el8_10</ProductID>
        <ProductID>SUSE Liberty Linux 8:kernel-tools-4.18.0-553.16.1.el8_10</ProductID>
        <ProductID>SUSE Liberty Linux 8:kernel-tools-libs-4.18.0-553.16.1.el8_10</ProductID>
        <ProductID>SUSE Liberty Linux 8:kernel-tools-libs-devel-4.18.0-553.16.1.el8_10</ProductID>
        <ProductID>SUSE Liberty Linux 8:perf-4.18.0-553.16.1.el8_10</ProductID>
        <ProductID>SUSE Liberty Linux 8:python3-perf-4.18.0-553.16.1.el8_10</ProductID>
      </Status>
    </ProductStatuses>
    <Threats>
      <Threat Type="Impact">
        <Description>moderate</Description>
      </Threat>
    </Threats>
    <CVSSScoreSets>
      <ScoreSetV3>
        <BaseScoreV3>5.5</BaseScoreV3>
        <VectorV3>CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H</VectorV3>
      </ScoreSetV3>
    </CVSSScoreSets>
  </Vulnerability>
</cvrfdoc>
