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
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-08-06",
      "epss": "0.00137",
      "percentile": "0.03566"
    },
    "nvd": "{\"cve\":{\"id\":\"CVE-2025-38339\",\"sourceIdentifier\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\",\"published\":\"2025-07-10T09:15:28.633\",\"lastModified\":\"2026-07-30T06:23:07.730\",\"vulnStatus\":\"Modified\",\"cveTags\":[],\"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.\"},{\"lang\":\"es\",\"value\":\"En el kernel de Linux, se ha resuelto la siguiente vulnerabilidad: powerpc/bpf: correcci\u00f3n del c\u00e1lculo del tama\u00f1o del c\u00f3digo JIT del trampol\u00edn BPF. arch_bpf_trampoline_size() proporciona el tama\u00f1o JIT del trampol\u00edn BPF antes de asignar el b\u00fafer para su procesamiento JIT. El n\u00famero total de instrucciones emitidas para el c\u00f3digo JIT del trampol\u00edn BPF depende de la ubicaci\u00f3n de la imagen final. Por lo tanto, el tama\u00f1o obtenido con el paso ficticio en arch_bpf_trampoline_size() puede variar del tama\u00f1o real necesario en arch_prepare_bpf_trampoline(). Cuando las instrucciones contabilizadas en arch_bpf_trampoline_size() son menores que la cantidad de instrucciones emitidas durante la compilaci\u00f3n JIT real del trampol\u00edn, se produce la siguiente advertencia: ADVERTENCIA: CPU: 8 PID: 204190 en arch/powerpc/net/bpf_jit_comp.c:981 __arch_prepare_bpf_trampoline.isra.0+0xd2c/0xdcc que es: /* Aseg\u00farese de que la l\u00f3gica de generaci\u00f3n del trampol\u00edn no se desborde */ if (image \u0026amp;\u0026amp; WARN_ON_ONCE(\u0026amp;image[ctx-\u0026gt;idx] \u0026gt; (u32 *)rw_image_end - BPF_INSN_SAFETY)) { Entonces, durante el pase ficticio, en lugar de proporcionar una ubicaci\u00f3n de imagen arbitraria, tenga en cuenta la m\u00e1xima cantidad de instrucciones posibles si y cuando exista una dependencia con la ubicaci\u00f3n de la imagen para JIT.\"}],\"affected\":[{\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\",\"affectedData\":[{\"vendor\":\"Linux\",\"product\":\"Linux\",\"defaultStatus\":\"unaffected\",\"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\",\"versions\":[{\"version\":\"d243b62b7bd3d5314382d3b54e4992226245e936\",\"lessThan\":\"7833deb95e05bec146414b3a2feb24f025ca27c0\",\"versionType\":\"git\",\"status\":\"affected\"},{\"version\":\"d243b62b7bd3d5314382d3b54e4992226245e936\",\"lessThan\":\"59ba025948be2a92e8bc9ae1cbdaf197660bd508\",\"versionType\":\"git\",\"status\":\"affected\"}]},{\"vendor\":\"Linux\",\"product\":\"Linux\",\"defaultStatus\":\"affected\",\"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\",\"versions\":[{\"version\":\"6.13\",\"status\":\"affected\"},{\"version\":\"0\",\"lessThan\":\"6.13\",\"versionType\":\"semver\",\"status\":\"unaffected\"},{\"version\":\"6.15.4\",\"lessThanOrEqual\":\"6.15.*\",\"versionType\":\"semver\",\"status\":\"unaffected\"},{\"version\":\"6.16\",\"lessThanOrEqual\":\"*\",\"versionType\":\"original_commit_for_fix\",\"status\":\"unaffected\"}]}]}],\"metrics\":{\"cvssMetricV31\":[{\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\",\"type\":\"Secondary\",\"cvssData\":{\"version\":\"3.1\",\"vectorString\":\"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H\",\"baseScore\":7.8,\"baseSeverity\":\"HIGH\",\"attackVector\":\"LOCAL\",\"attackComplexity\":\"LOW\",\"privilegesRequired\":\"LOW\",\"userInteraction\":\"NONE\",\"scope\":\"UNCHANGED\",\"confidentialityImpact\":\"HIGH\",\"integrityImpact\":\"HIGH\",\"availabilityImpact\":\"HIGH\"},\"exploitabilityScore\":1.8,\"impactScore\":5.9},{\"source\":\"nvd@nist.gov\",\"type\":\"Primary\",\"cvssData\":{\"version\":\"3.1\",\"vectorString\":\"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H\",\"baseScore\":5.5,\"baseSeverity\":\"MEDIUM\",\"attackVector\":\"LOCAL\",\"attackComplexity\":\"LOW\",\"privilegesRequired\":\"LOW\",\"userInteraction\":\"NONE\",\"scope\":\"UNCHANGED\",\"confidentialityImpact\":\"NONE\",\"integrityImpact\":\"NONE\",\"availabilityImpact\":\"HIGH\"},\"exploitabilityScore\":1.8,\"impactScore\":3.6}]},\"weaknesses\":[{\"source\":\"nvd@nist.gov\",\"type\":\"Primary\",\"description\":[{\"lang\":\"en\",\"value\":\"NVD-CWE-noinfo\"}]}],\"configurations\":[{\"nodes\":[{\"operator\":\"OR\",\"negate\":false,\"cpeMatch\":[{\"vulnerable\":true,\"criteria\":\"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*\",\"versionStartIncluding\":\"6.13\",\"versionEndExcluding\":\"6.15.4\",\"matchCriteriaId\":\"DFD174C5-1AA2-4671-BDDC-1A9FCC753655\"}]}]}],\"references\":[{\"url\":\"https://git.kernel.org/stable/c/59ba025948be2a92e8bc9ae1cbdaf197660bd508\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\",\"tags\":[\"Patch\"]},{\"url\":\"https://git.kernel.org/stable/c/7833deb95e05bec146414b3a2feb24f025ca27c0\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\",\"tags\":[\"Patch\"]}]}}",
    "redhat_vex": {
      "aggregate_severity": "None",
      "current_release_date": "2026-06-30T10:32:36+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": "274",
      "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"
    },
    "suse_vex": {
      "aggregate_severity": "moderate",
      "current_release_date": "2026-07-15T06:10:51Z",
      "cve": "CVE-2025-38339",
      "id": "CVE-2025-38339",
      "initial_release_date": "2025-07-10T23:22:13Z",
      "product_status:first_fixed": "2",
      "product_status:known_not_affected": "414",
      "product_status:recommended": "127",
      "source": "SUSE CSAF VEX",
      "status": "interim",
      "title": "SUSE CVE CVE-2025-38339",
      "url": "https://ftp.suse.com/pub/projects/security/csaf-vex/cve-2025-38339.json",
      "version": "21"
    }
  }
}



Log in or create an account to share your comment.




Tags
Taxonomy of the tags.


Loading…

Loading…

Loading…

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.

Loading…

Detection rules are retrieved from Rulezet.

Loading…

Loading…

Loading…