{
  "id": "CVE-2025-38339",
  "url": "https://poc.griffinguard.io/cve/CVE-2025-38339",
  "published_at": "2025-07-10T08:15:09.646Z",
  "title": "powerpc/bpf: fix JIT code size calculation of bpf trampoline",
  "vendor": "Linux",
  "product": "Linux",
  "cvss": {
    "score": 7.8,
    "source": "cna",
    "vector": "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H"
  },
  "kev": {
    "in_kev": false,
    "added_at": null,
    "days_after_publication": null
  },
  "first_poc": null,
  "poc_repo_count": 0,
  "exploit_count": 0,
  "suspicious_repo_count": 0,
  "edge_device": null,
  "description": "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'ing 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't 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'ing.",
  "cpes": [
    "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*"
  ],
  "cvss_by_source": {
    "cna": 7.8,
    "nvd": 5.5
  },
  "repos": [],
  "remediation": {
    "affected": [
      {
        "vendor": "Linux",
        "product": "Linux",
        "ranges": [
          "\u003e= d243b62b7bd3d5314382d3b54e4992226245e936, \u003c 7833deb95e05bec146414b3a2feb24f025ca27c0",
          "\u003e= d243b62b7bd3d5314382d3b54e4992226245e936, \u003c 59ba025948be2a92e8bc9ae1cbdaf197660bd508"
        ],
        "fixed_in": [
          "7833deb95e05bec146414b3a2feb24f025ca27c0",
          "59ba025948be2a92e8bc9ae1cbdaf197660bd508"
        ]
      },
      {
        "vendor": "Linux",
        "product": "Linux",
        "ranges": [
          "6.13"
        ],
        "fixed_in": [
          "0",
          "6.15.4",
          "6.16"
        ]
      }
    ],
    "upgrade": [
      "Upgrade Linux to 7833deb95e05bec146414b3a2feb24f025ca27c0 or 59ba025948be2a92e8bc9ae1cbdaf197660bd508 or later.",
      "Upgrade Linux to 0 or 6.15.4 or 6.16 or later."
    ]
  },
  "exploit_refs": [],
  "hunt_profile": [],
  "rules": []
}
