# CVE-2025-39917: bpf: Fix out-of-bounds dynptr write in bpf_crypto_crypt

- Severity: High 7.8 (CVSS:3.1, scored by CISA-ADP) `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.16%, higher than 5% of CVEs (2026-12-01)
- Published: 2025-10-01T07:44:39.423Z
- Modified: 2026-10-19T21:10:00.160Z
- Weaknesses: CWE-787
- SSVC (CISA-ADP): exploitation none, automatable no, technical impact total
- 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.

(As written by CVE List.)

## Affected

- Linux Linux: from 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 *)
- linux linux_kernel: from 6.10 before 6.12.48; from 6.13 before 6.16.8; 6.17

## Every score

- CISA-ADP: CVSS:3.1 7.8 High `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H`
- NVD: CVSS:3.1 7.8 High `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H`

## References

- <https://git.kernel.org/stable/c/0126358df12d6f476f79251d9c398ac5c1b3062d> (patch)
- <https://git.kernel.org/stable/c/c4be24ef0510c146dca4671effb127e97631534b> (patch)
- <https://git.kernel.org/stable/c/f9bb6ffa7f5ad0f8ee0f53fc4a10655872ee4a14> (patch)

## Sources

- CVE List: [CVE-2025-39917](https://www.cve.org/CVERecord?id=CVE-2025-39917), CVE Terms of Use, modified 2026-05-11
- NVD: [CVE-2025-39917](https://nvd.nist.gov/vuln/detail/CVE-2025-39917), Public domain, modified 2026-10-19

---

Page: https://cve.day/CVE-2025-39917 · Whole record: https://cve.day/CVE-2025-39917.json · Rebuilt by cve.day 2026-11-25T22:59:05.393Z
