CVE-2025-38339 (GCVE-0-2025-38339)
Vulnerability from cvelistv5
Published
2025-07-10 08:15
Modified
2025-07-28 04:19
Severity ?
VLAI Severity ?
EPSS score ?
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.
References
Impacted products
{ "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." } ], "providerMetadata": { "dateUpdated": "2025-07-28T04:19:21.444Z", "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": "2025-07-28T04:19:21.444Z", "state": "PUBLISHED" }, "dataType": "CVE_RECORD", "dataVersion": "5.1", "vulnerability-lookup:meta": { "nvd": "{\"cve\":{\"id\":\"CVE-2025-38339\",\"sourceIdentifier\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\",\"published\":\"2025-07-10T09:15:28.633\",\"lastModified\":\"2025-07-10T13:17:30.017\",\"vulnStatus\":\"Awaiting Analysis\",\"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.\"}],\"metrics\":{},\"references\":[{\"url\":\"https://git.kernel.org/stable/c/59ba025948be2a92e8bc9ae1cbdaf197660bd508\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\"},{\"url\":\"https://git.kernel.org/stable/c/7833deb95e05bec146414b3a2feb24f025ca27c0\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\"}]}}" } }
Loading…
Loading…
Sightings
Author | Source | Type | Date |
---|
Nomenclature
- Seen: The vulnerability was mentioned, discussed, or seen somewhere by the user.
- Confirmed: The vulnerability is confirmed from an analyst perspective.
- Exploited: This vulnerability was exploited and seen by the user reporting the sighting.
- Patched: This vulnerability was successfully patched by the user reporting the sighting.
- Not exploited: This vulnerability was not exploited or seen by the user reporting the sighting.
- Not confirmed: The user expresses doubt about the veracity of the vulnerability.
- Not patched: This vulnerability was not successfully patched by the user reporting the sighting.
Loading…
Loading…