{"id":"CVE-2025-39917","state":"PUBLISHED","title":"bpf: Fix out-of-bounds dynptr write in bpf_crypto_crypt","description":"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.","publishedAt":"2025-10-01T07:44:39.423Z","updatedAt":"2026-05-11T21:38:54.814Z","severity":{"score":7.8,"label":"High","version":"3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","source":"CISA-ADP"},"assigner":"Linux","products":["Linux Linux"],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"3e1c6f35409f9e447bf37f64840f5b65576bfb78","status":"affected","lessThan":"0126358df12d6f476f79251d9c398ac5c1b3062d","versionType":"git"},{"version":"3e1c6f35409f9e447bf37f64840f5b65576bfb78","status":"affected","lessThan":"c4be24ef0510c146dca4671effb127e97631534b","versionType":"git"},{"version":"3e1c6f35409f9e447bf37f64840f5b65576bfb78","status":"affected","lessThan":"f9bb6ffa7f5ad0f8ee0f53fc4a10655872ee4a14","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["kernel/bpf/crypto.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"6.10","status":"affected"},{"version":"0","status":"unaffected","lessThan":"6.10","versionType":"semver"},{"version":"6.12.48","status":"unaffected","lessThanOrEqual":"6.12.*","versionType":"semver"},{"version":"6.16.8","status":"unaffected","lessThanOrEqual":"6.16.*","versionType":"semver"},{"version":"6.17","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["kernel/bpf/crypto.c"]}],"references":["https://git.kernel.org/stable/c/0126358df12d6f476f79251d9c398ac5c1b3062d","https://git.kernel.org/stable/c/c4be24ef0510c146dca4671effb127e97631534b","https://git.kernel.org/stable/c/f9bb6ffa7f5ad0f8ee0f53fc4a10655872ee4a14"],"weaknesses":["CWE-787"],"ingestedAt":"2026-10-29T20:09:09.358Z","source":{"repository":"CVEProject/cvelistV5","path":"cves/2025/39xxx/CVE-2025-39917.json","commit":"556c9d3a8cd17e218bb8e452ba7cd619a384ff47"},"raw":{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2025-39917","state":"PUBLISHED","datePublished":"2025-10-01T07:44:39.423Z","dateUpdated":"2026-05-11T21:38:54.814Z","assignerShortName":"Linux","assignerOrgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateReserved":"2025-04-16T07:20:57.147Z"},"containers":{"cna":{"title":"bpf: Fix out-of-bounds dynptr write in bpf_crypto_crypt","descriptions":[{"lang":"en","value":"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."}],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"3e1c6f35409f9e447bf37f64840f5b65576bfb78","status":"affected","lessThan":"0126358df12d6f476f79251d9c398ac5c1b3062d","versionType":"git"},{"version":"3e1c6f35409f9e447bf37f64840f5b65576bfb78","status":"affected","lessThan":"c4be24ef0510c146dca4671effb127e97631534b","versionType":"git"},{"version":"3e1c6f35409f9e447bf37f64840f5b65576bfb78","status":"affected","lessThan":"f9bb6ffa7f5ad0f8ee0f53fc4a10655872ee4a14","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["kernel/bpf/crypto.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"6.10","status":"affected"},{"version":"0","status":"unaffected","lessThan":"6.10","versionType":"semver"},{"version":"6.12.48","status":"unaffected","lessThanOrEqual":"6.12.*","versionType":"semver"},{"version":"6.16.8","status":"unaffected","lessThanOrEqual":"6.16.*","versionType":"semver"},{"version":"6.17","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["kernel/bpf/crypto.c"]}],"references":[{"url":"https://git.kernel.org/stable/c/0126358df12d6f476f79251d9c398ac5c1b3062d"},{"url":"https://git.kernel.org/stable/c/c4be24ef0510c146dca4671effb127e97631534b"},{"url":"https://git.kernel.org/stable/c/f9bb6ffa7f5ad0f8ee0f53fc4a10655872ee4a14"}],"providerMetadata":{"shortName":"Linux","orgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateUpdated":"2026-05-11T21:38:54.814Z"},"cpeApplicability":[{"nodes":[{"operator":"OR","negate":false,"cpeMatch":[{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.10","versionEndExcluding":"6.12.48"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.10","versionEndExcluding":"6.16.8"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.10","versionEndExcluding":"6.17"}]}]}],"x_generator":{"engine":"bippy-1.2.0"}},"adp":[{"title":"CISA ADP Vulnrichment","metrics":[{"cvssV3_1":{"scope":"UNCHANGED","version":"3.1","baseScore":7.8,"attackVector":"LOCAL","baseSeverity":"HIGH","vectorString":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","integrityImpact":"HIGH","userInteraction":"NONE","attackComplexity":"LOW","availabilityImpact":"HIGH","privilegesRequired":"LOW","confidentialityImpact":"HIGH"}},{"other":{"type":"ssvc","content":{"id":"CVE-2025-39917","role":"CISA Coordinator","options":[{"Exploitation":"none"},{"Automatable":"no"},{"Technical Impact":"total"}],"version":"2.0.3","timestamp":"2026-01-14T17:43:01.533146Z"}}}],"problemTypes":[{"descriptions":[{"cweId":"CWE-787","lang":"en","type":"CWE","description":"CWE-787 Out-of-bounds Write"}]}],"providerMetadata":{"shortName":"CISA-ADP","orgId":"134c704f-9b21-4f2e-91b3-4a467353bcc0","dateUpdated":"2026-01-14T17:52:47.721Z"}}]}}}