CVE-2025-39917
JSON

7.8high

bpf: Fix out-of-bounds dynptr write in bpf_crypto_crypt

Severity
7.8high CVSS:3.1 by CISA-ADP
Exploit likelihood
0.16% (higher than 5% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
Linux

Description

In the Linux kernel, the following vulnerability has been resolved: bpf: Fix out-of-bounds dynptr write in bpf_crypto_crypt Stanislav reported that in bpf_crypto_crypt() the destination dynptr's size is not validated to be at least as large as the source dynptr's size before calling into the crypto backend with 'len = src_len'. This can result in an OOB write when the destination is smaller than the source. Concretely, in mentioned function, psrc and pdst are both linear buffers fetched from each dynptr: psrc = __bpf_dynptr_data(src, src_len); [...] pdst = __bpf_dynptr_data_rw(dst, dst_len); [...] err = decrypt ? ctx->type->decrypt(ctx->tfm, psrc, pdst, src_len, piv) : ctx->type->encrypt(ctx->tfm, psrc, pdst, src_len, piv); The crypto backend expects pdst to be large enough with a src_len length that can be written. Add an additional src_len > dst_len check and bail out if it's the case. Note that these kfuncs are accessible under root privileges only.

Affected

Product or packageVersionsReported by
Linux Linuxfrom 3e1c6f35409f9e447bf37f64840f5b65576bfb78 before 0126358df12d6f476f79251d9c398ac5c1b3062d, from 3e1c6f35409f9e447bf37f64840f5b65576bfb78 before c4be24ef0510c146dca4671effb127e97631534b, from 3e1c6f35409f9e447bf37f64840f5b65576bfb78 before f9bb6ffa7f5ad0f8ee0f53fc4a10655872ee4a14, 6.10
Not affected: before 6.10, from 6.12.48 up to 6.12.*, from 6.16.8 up to 6.16.*, from 6.17 up to *
CVE List
linux linux_kernelfrom 6.10 before 6.12.48, from 6.13 before 6.16.8, 6.17NVD

All scores

CISA-ADP7.8high CVSS:3.1CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
NVD7.8high CVSS:3.1CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H

Classification

CWE-787

SSVC (CISA-ADP): exploitation none, automatable no, technical impact total.

What each source says

CVE List

In the Linux kernel, the following vulnerability has been resolved: bpf: Fix out-of-bounds dynptr write in bpf_crypto_crypt Stanislav reported that in bpf_crypto_crypt() the destination dynptr's size is not validated to be at least as large as the source dynptr's size before calling into the crypto backend with 'len = src_len'. This can result in an OOB write when the destination is smaller than the source. Concretely, in mentioned function, psrc and pdst are both linear buffers fetched from each dynptr: psrc = __bpf_dynptr_data(src, src_len); [...] pdst = __bpf_dynptr_data_rw(dst, dst_len); [...] err = decrypt ? ctx->type->decrypt(ctx->tfm, psrc, pdst, src_len, piv) : ctx->type->encrypt(ctx->tfm, psrc, pdst, src_len, piv); The crypto backend expects pdst to be large enough with a src_len length that can be written. Add an additional src_len > dst_len check and bail out if it's the case. Note that these kfuncs are accessible under root privileges only.

NVD (es)

En el kernel de Linux, la siguiente vulnerabilidad ha sido resuelta: bpf: Corrección de escritura de dynptr fuera de límites en bpf_crypto_crypt Stanislav informó que en bpf_crypto_crypt() el tamaño del dynptr de destino no se valida para que sea al menos tan grande como el tamaño del dynptr de origen antes de llamar al backend criptográfico con 'len = src_len'. Esto puede resultar en una escritura OOB cuando el destino es más pequeño que el origen. Concretamente, en la función mencionada, psrc y pdst son ambos búferes lineales obtenidos de cada dynptr: psrc = __bpf_dynptr_data(src, src_len); [...] pdst = __bpf_dynptr_data_rw(dst, dst_len); [...] err = decrypt ? ctx->type->decrypt(ctx->tfm, psrc, pdst, src_len, piv) : ctx->type->encrypt(ctx->tfm, psrc, pdst, src_len, piv); El backend criptográfico espera que pdst sea lo suficientemente grande con una longitud src_len que pueda ser escrita. Añadir una comprobación adicional de src_len > dst_len y salir si es el caso. Tenga en cuenta que estas kfuncs son accesibles solo con privilegios de root.

References

Sources

SourceRecordLicence
CVE ListCVE-2025-39917 changed 2026-05-11CVE Terms of Use
NVDCVE-2025-39917 changed 2026-10-19Public domain