CVE-2025-38339 (GCVE-0-2025-38339)

Vulnerability from cvelistv5 – Published: 2025-07-10 08:15 – Updated: 2026-08-05 12:01
VLAI
Title
powerpc/bpf: fix JIT code size calculation of bpf trampoline
Summary
In the Linux kernel, the following vulnerability has been resolved: powerpc/bpf: fix JIT code size calculation of bpf trampoline arch_bpf_trampoline_size() provides JIT size of the BPF trampoline before the buffer for JIT'ing it is allocated. The total number of instructions emitted for BPF trampoline JIT code depends on where the final image is located. So, the size arrived at with the dummy pass in arch_bpf_trampoline_size() can vary from the actual size needed in arch_prepare_bpf_trampoline(). When the instructions accounted in arch_bpf_trampoline_size() is less than the number of instructions emitted during the actual JIT compile of the trampoline, the below warning is produced: WARNING: CPU: 8 PID: 204190 at arch/powerpc/net/bpf_jit_comp.c:981 __arch_prepare_bpf_trampoline.isra.0+0xd2c/0xdcc which is: /* Make sure the trampoline generation logic doesn't overflow */ if (image && WARN_ON_ONCE(&image[ctx->idx] > (u32 *)rw_image_end - BPF_INSN_SAFETY)) { So, during the dummy pass, instead of providing some arbitrary image location, account for maximum possible instructions if and when there is a dependency with image location for JIT'ing.
Assigner
Linux CNA
Impacted products
Vendor Product Version
Linux Linux Affected: d243b62b7bd3d5314382d3b54e4992226245e936 , < 7833deb95e05bec146414b3a2feb24f025ca27c0 (git)
Affected: d243b62b7bd3d5314382d3b54e4992226245e936 , < 59ba025948be2a92e8bc9ae1cbdaf197660bd508 (git)
Create a notification for this product.
Linux Linux Affected: 6.13
Unaffected: 0 , < 6.13 (semver)
Unaffected: 6.15.4 , ≤ 6.15.* (semver)
Unaffected: 6.16 , ≤ * (original_commit_for_fix)
Create a notification for this product.
Show details on NVD website

{
  "containers": {
    "cna": {
      "affected": [
        {
          "defaultStatus": "unaffected",
          "product": "Linux",
          "programFiles": [
            "arch/powerpc/net/bpf_jit.h",
            "arch/powerpc/net/bpf_jit_comp.c",
            "arch/powerpc/net/bpf_jit_comp32.c",
            "arch/powerpc/net/bpf_jit_comp64.c"
          ],
          "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
          "vendor": "Linux",
          "versions": [
            {
              "lessThan": "7833deb95e05bec146414b3a2feb24f025ca27c0",
              "status": "affected",
              "version": "d243b62b7bd3d5314382d3b54e4992226245e936",
              "versionType": "git"
            },
            {
              "lessThan": "59ba025948be2a92e8bc9ae1cbdaf197660bd508",
              "status": "affected",
              "version": "d243b62b7bd3d5314382d3b54e4992226245e936",
              "versionType": "git"
            }
          ]
        },
        {
          "defaultStatus": "affected",
          "product": "Linux",
          "programFiles": [
            "arch/powerpc/net/bpf_jit.h",
            "arch/powerpc/net/bpf_jit_comp.c",
            "arch/powerpc/net/bpf_jit_comp32.c",
            "arch/powerpc/net/bpf_jit_comp64.c"
          ],
          "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
          "vendor": "Linux",
          "versions": [
            {
              "status": "affected",
              "version": "6.13"
            },
            {
              "lessThan": "6.13",
              "status": "unaffected",
              "version": "0",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "6.15.*",
              "status": "unaffected",
              "version": "6.15.4",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "*",
              "status": "unaffected",
              "version": "6.16",
              "versionType": "original_commit_for_fix"
            }
          ]
        }
      ],
      "cpeApplicability": [
        {
          "nodes": [
            {
              "cpeMatch": [
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "6.15.4",
                  "versionStartIncluding": "6.13",
                  "vulnerable": true
                },
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "6.16",
                  "versionStartIncluding": "6.13",
                  "vulnerable": true
                }
              ],
              "negate": false,
              "operator": "OR"
            }
          ]
        }
      ],
      "descriptions": [
        {
          "lang": "en",
          "value": "In the Linux kernel, the following vulnerability has been resolved:\n\npowerpc/bpf: fix JIT code size calculation of bpf trampoline\n\narch_bpf_trampoline_size() provides JIT size of the BPF trampoline\nbefore the buffer for JIT\u0027ing it is allocated. The total number of\ninstructions emitted for BPF trampoline JIT code depends on where\nthe final image is located. So, the size arrived at with the dummy\npass in arch_bpf_trampoline_size() can vary from the actual size\nneeded in  arch_prepare_bpf_trampoline().  When the instructions\naccounted in  arch_bpf_trampoline_size() is less than the number of\ninstructions emitted during the actual JIT compile of the trampoline,\nthe below warning is produced:\n\n  WARNING: CPU: 8 PID: 204190 at arch/powerpc/net/bpf_jit_comp.c:981 __arch_prepare_bpf_trampoline.isra.0+0xd2c/0xdcc\n\nwhich is:\n\n  /* Make sure the trampoline generation logic doesn\u0027t overflow */\n  if (image \u0026\u0026 WARN_ON_ONCE(\u0026image[ctx-\u003eidx] \u003e\n  \t\t\t(u32 *)rw_image_end - BPF_INSN_SAFETY)) {\n\nSo, during the dummy pass, instead of providing some arbitrary image\nlocation, account for maximum possible instructions if and when there\nis a dependency with image location for JIT\u0027ing."
        }
      ],
      "metrics": [
        {
          "cvssV3_1": {
            "baseScore": 7.8,
            "baseSeverity": "HIGH",
            "vectorString": "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H",
            "version": "3.1"
          },
          "scenarios": [
            {
              "lang": "en",
              "value": "AV:L - The vulnerable trampoline JIT path is reached only through the bpf(2) syscall (BPF_LINK_CREATE/BPF_RAW_TRACEPOINT_OPEN \u2192 bpf_tracing_prog_attach \u2192 bpf_trampoline_update), which requires local access to the machine. No remote or adjacent-network input reaches arch_bpf_trampoline_size().\nAC:L - The attacker deterministically triggers the size miscalculation by attaching fentry/fexit/fmod_ret programs; there is no race and no condition outside their control, and they can amplify the accounting drift by attaching many links (up to BPF_MAX_TRAMP_LINKS) and influencing JIT image placement by repeated attach/detach.\nPR:L - Attaching tracing programs needs CAP_BPF+CAP_PERFMON, which bpf_token_capable() evaluates against a BPF token\u0027s user namespace, so an unprivileged container user holding a delegated token \u2014 or a non-root tracing daemon with only these caps \u2014 can reach the code without being a real administrator.\nUI:N - The attaching process triggers the JIT compilation entirely on its own; no victim action, file open, or mount is needed.\nS:U - The miscomputed buffer and the resulting corruption are both within the kernel\u0027s own security authority; no VM, IOMMU, or sandbox boundary is crossed.\nC:H - The undersized JIT buffer permits writes past the end of the kvmalloc\u0027d rw_image, and such heap corruption of adjacent slab objects (pointers, length fields) can be leveraged into arbitrary kernel-memory disclosure.\nI:H - EMIT()/PLANT_INSTR() writes are completely unchecked until after the fact, so instruction words \u2014 including attacker-chosen bpf_cookie immediates emitted via PPC_LI32 \u2014 are written out of bounds into the heap, an out-of-bounds write usable for control-flow-relevant corruption.\nA:H - The demonstrated effect is a WARN_ON_ONCE splat in __arch_prepare_bpf_trampoline() (panic under panic_on_warn) and, when the drift exceeds the 64-instruction safety margin, heap corruption that oopses the kernel."
            }
          ]
        }
      ],
      "providerMetadata": {
        "dateUpdated": "2026-08-05T12:01:12.779Z",
        "orgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
        "shortName": "Linux"
      },
      "references": [
        {
          "url": "https://git.kernel.org/stable/c/7833deb95e05bec146414b3a2feb24f025ca27c0"
        },
        {
          "url": "https://git.kernel.org/stable/c/59ba025948be2a92e8bc9ae1cbdaf197660bd508"
        }
      ],
      "title": "powerpc/bpf: fix JIT code size calculation of bpf trampoline",
      "x_generator": {
        "engine": "bippy-1.2.0"
      }
    }
  },
  "cveMetadata": {
    "assignerOrgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
    "assignerShortName": "Linux",
    "cveId": "CVE-2025-38339",
    "datePublished": "2025-07-10T08:15:09.646Z",
    "dateReserved": "2025-04-16T04:51:24.005Z",
    "dateUpdated": "2026-08-05T12:01:12.779Z",
    "state": "PUBLISHED"
  },
  "dataType": "CVE_RECORD",
  "dataVersion": "5.2",
  "vulnerability-lookup:meta": {
    "epss": {
      "cve": "CVE-2025-38339",
      "date": "2026-11-19",
      "epss": "0.00162",
      "percentile": "0.05455"
    },
    "redhat_vex": {
      "aggregate_severity": "Low",
      "current_release_date": "2026-11-09T18:28:09+00:00",
      "cve": "CVE-2025-38339",
      "id": "CVE-2025-38339",
      "initial_release_date": "2025-07-10T00:00:00+00:00",
      "product_status:known_not_affected": "200",
      "source": "Red Hat CSAF VEX",
      "status": "final",
      "title": "kernel: powerpc/bpf: fix JIT code size calculation of bpf trampoline",
      "url": "https://security.access.redhat.com/data/csaf/v2/vex/2025/cve-2025-38339.json",
      "version": "3"
    }
  }
}



Log in or create an account to share your comment.




Tags
Taxonomy of the tags.


Loading…

Loading…

Loading…

Drag nodes to arrange them. Double-click a related vulnerability to open it, or a source to visit its link. The Physics button on the left tunes the layout and the simulation; the legend at the bottom left hides or shows nodes by kind and by sighting type.

Forecast uses a logistic model when the trend is rising, or an exponential decay model when the trend is falling. Fitted via linearized least squares.

Sightings

Author Source Type Date Other

Nomenclature

  • Seen: The vulnerability was mentioned, discussed, or observed by the user.
  • Confirmed: The vulnerability has been validated from an analyst's perspective.
  • Published Proof of Concept: A public proof of concept is available for this vulnerability.
  • Exploited: The vulnerability was observed as exploited by the user who reported the sighting.
  • Patched: The vulnerability was observed as successfully patched by the user who reported the sighting.
  • Not exploited: The vulnerability was not observed as exploited by the user who reported the sighting.
  • Not confirmed: The user expressed doubt about the validity of the vulnerability.
  • Not patched: The vulnerability was not observed as successfully patched by the user who reported the sighting.
Vulnerability timeline

Sightings and recorded dates, grouped by day · UTC

JSON
How durations are calculated

Following the VTEM framework (Black Hat USA 2015), time to patch starts when the vendor or a coordinator was informed, total time to patch at discovery, and disclosure to patch at public disclosure; vendor response time runs from the report to its acknowledgement. Time to exploit and time unpatched start at the earliest discovery or report, falling back to public disclosure. Unpatched time ends at the first recorded patch, or the calculation time when no patch is recorded. Exploitation to patch shows the interval between those two events; a published proof of concept is a public exploit, not exploitation.

Each result shows its source dates. A negative interval means the end event came first; when date-only inputs leave the order open, the result says so. Date-only inputs are approximate. The earliest evidence wins: KEV report dates and sightings are labelled as such. Records describing another vulnerability are listed but never calculated from, and a PoC alone does not establish exploitation. Missing patch evidence does not prove that no patch exists. Filters below change the event list only.

Events included in the timeline

Loading timeline…


    Loading…

    Loading…

    Loading…

    Related by attack behaviour

    Vulnerabilities whose description is nearest to this one in the vector space of the CIRCL/vulnerability-attack-technique-biencoder model. This is a similarity search over the bi-encoder space (plain cosine), not a classification, and it has no measured accuracy.