{"id":"CVE-2025-39917","aliases":["CVE-2025-39917"],"related":[],"kind":"vulnerability","state":"published","title":"bpf: Fix out-of-bounds dynptr write in bpf_crypto_crypt","summary":"In the Linux kernel, the following vulnerability has been resolved:\n\nbpf: Fix out-of-bounds dynptr write in bpf_crypto_crypt\n\nStanislav reported that in bpf_crypto_crypt() the destination dynptr's\nsize is not validated to be at least as large as the source dynptr's\nsize before calling into the crypto backend with 'len = src_len'. This\ncan result in an OOB write when the destination is smaller than the\nsource.\n\nConcretely, in mentioned function, psrc and pdst are both linear\nbuffers fetched from each dynptr:\n\n  psrc = __bpf_dynptr_data(src, src_len);\n  [...]\n  pdst = __bpf_dynptr_data_rw(dst, dst_len);\n  [...]\n  err = decrypt ?\n        ctx->type->decrypt(ctx->tfm, psrc, pdst, src_len, piv) :\n        ctx->type->encrypt(ctx->tfm, psrc, pdst, src_len, piv);\n\nThe crypto backend expects pdst to be large enough with a src_len length\nthat can be written. Add an additional src_len > dst_len check and bail\nout if it's the case. Note that these kfuncs are accessible under root\nprivileges only.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"In the Linux kernel, the following vulnerability has been resolved:\n\nbpf: Fix out-of-bounds dynptr write in bpf_crypto_crypt\n\nStanislav reported that in bpf_crypto_crypt() the destination dynptr's\nsize is not validated to be at least as large as the source dynptr's\nsize before calling into the crypto backend with 'len = src_len'. This\ncan result in an OOB write when the destination is smaller than the\nsource.\n\nConcretely, in mentioned function, psrc and pdst are both linear\nbuffers fetched from each dynptr:\n\n  psrc = __bpf_dynptr_data(src, src_len);\n  [...]\n  pdst = __bpf_dynptr_data_rw(dst, dst_len);\n  [...]\n  err = decrypt ?\n        ctx->type->decrypt(ctx->tfm, psrc, pdst, src_len, piv) :\n        ctx->type->encrypt(ctx->tfm, psrc, pdst, src_len, piv);\n\nThe crypto backend expects pdst to be large enough with a src_len length\nthat can be written. Add an additional src_len > dst_len check and bail\nout if it's the case. Note that these kfuncs are accessible under root\nprivileges only.","source":"cvelist"},{"lang":"es","text":"En el kernel de Linux, la siguiente vulnerabilidad ha sido resuelta:\n\nbpf: Corrección de escritura de dynptr fuera de límites en bpf_crypto_crypt\n\nStanislav 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.\n\nConcretamente, en la función mencionada, psrc y pdst son ambos búferes lineales obtenidos de cada dynptr:\n\n  psrc = __bpf_dynptr_data(src, src_len);\n  [...]\n  pdst = __bpf_dynptr_data_rw(dst, dst_len);\n  [...]\n  err = decrypt ?\n        ctx->type->decrypt(ctx->tfm, psrc, pdst, src_len, piv) :\n        ctx->type->encrypt(ctx->tfm, psrc, pdst, src_len, piv);\n\nEl 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.","source":"nvd"}],"published":"2025-10-01T07:44:39.423Z","modified":"2026-10-19T21:10:00.160Z","severity":{"scorer":"CISA-ADP","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","score":7.8,"rating":"HIGH"},"severities":[{"scorer":"CISA-ADP","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","score":7.8,"rating":"HIGH"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","score":7.8,"rating":"HIGH"}],"cwes":["CWE-787"],"affected":[{"ranges":[{"type":"git","introduced":"3e1c6f35409f9e447bf37f64840f5b65576bfb78","fixed":"0126358df12d6f476f79251d9c398ac5c1b3062d","status":"affected"},{"type":"git","introduced":"3e1c6f35409f9e447bf37f64840f5b65576bfb78","fixed":"c4be24ef0510c146dca4671effb127e97631534b","status":"affected"},{"type":"git","introduced":"3e1c6f35409f9e447bf37f64840f5b65576bfb78","fixed":"f9bb6ffa7f5ad0f8ee0f53fc4a10655872ee4a14","status":"affected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"},{"ranges":[{"version":"6.10","status":"affected"},{"type":"semver","introduced":"0","fixed":"6.10","status":"unaffected"},{"type":"semver","introduced":"6.12.48","lastAffected":"6.12.*","status":"unaffected"},{"type":"semver","introduced":"6.16.8","lastAffected":"6.16.*","status":"unaffected"},{"type":"original_commit_for_fix","introduced":"6.17","lastAffected":"*","status":"unaffected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"},{"ranges":[{"status":"affected","introduced":"6.10","fixed":"6.12.48"},{"status":"affected","introduced":"6.13","fixed":"6.16.8"},{"status":"affected","version":"6.17"},{"status":"affected","version":"6.17"},{"status":"affected","version":"6.17"},{"status":"affected","version":"6.17"},{"status":"affected","version":"6.17"}],"vendor":"linux","product":"linux_kernel","cpe":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","source":"nvd"}],"references":[{"url":"https://git.kernel.org/stable/c/0126358df12d6f476f79251d9c398ac5c1b3062d","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/c4be24ef0510c146dca4671effb127e97631534b","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/f9bb6ffa7f5ad0f8ee0f53fc4a10655872ee4a14","tags":["patch"],"sources":["cvelist","nvd"]}],"credits":[],"assigner":"Linux","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"no","technicalImpact":"total","date":"2026-01-14T17:43:01.533Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2025-39917","url":"https://www.cve.org/CVERecord?id=CVE-2025-39917","licence":"CVE Terms of Use","modified":"2026-05-11T21:38:54.814Z"},{"source":"nvd","name":"NVD","id":"CVE-2025-39917","url":"https://nvd.nist.gov/vuln/detail/CVE-2025-39917","licence":"Public domain","modified":"2026-10-19T21:10:00.160Z"}],"updatedAt":"2026-11-25T22:59:05.393Z","epss":{"score":0.00161,"percentile":0.05483,"date":"2026-12-01T12:00:22.000Z"}}