{"id":"CVE-2025-38660","state":"PUBLISHED","title":"[ceph] parse_longname(): strrchr() expects NUL-terminated string","description":"In the Linux kernel, the following vulnerability has been resolved:\n\n[ceph] parse_longname(): strrchr() expects NUL-terminated string\n\n... and parse_longname() is not guaranteed that.  That's the reason\nwhy it uses kmemdup_nul() to build the argument for kstrtou64();\nthe problem is, kstrtou64() is not the only thing that need it.\n\nJust get a NUL-terminated copy of the entire thing and be done\nwith that...","publishedAt":"2025-08-22T16:01:03.686Z","updatedAt":"2026-10-15T22:02:27.813Z","severity":{"score":9.8,"label":"Critical","version":"3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","source":"Linux"},"assigner":"Linux","products":["Linux Linux"],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"dd66df0053ef84add5e684df517aa9b498342381","status":"affected","lessThan":"4b9aee707c4580511983a0998547f3b28514e6a6","versionType":"git"},{"version":"dd66df0053ef84add5e684df517aa9b498342381","status":"affected","lessThan":"bb80f7618832d26f7e395f52f82b1dac76223e5f","versionType":"git"},{"version":"dd66df0053ef84add5e684df517aa9b498342381","status":"affected","lessThan":"3145b2b11492d61c512bbc59660bb823bc757f48","versionType":"git"},{"version":"dd66df0053ef84add5e684df517aa9b498342381","status":"affected","lessThan":"493479af8af3ab907f49e99323777d498a4fbd2b","versionType":"git"},{"version":"dd66df0053ef84add5e684df517aa9b498342381","status":"affected","lessThan":"101841c38346f4ca41dc1802c867da990ffb32eb","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["fs/ceph/crypto.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"6.6","status":"affected"},{"version":"0","status":"unaffected","lessThan":"6.6","versionType":"semver"},{"version":"6.6.157","status":"unaffected","lessThanOrEqual":"6.6.*","versionType":"semver"},{"version":"6.12.42","status":"unaffected","lessThanOrEqual":"6.12.*","versionType":"semver"},{"version":"6.15.10","status":"unaffected","lessThanOrEqual":"6.15.*","versionType":"semver"},{"version":"6.16.1","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":["fs/ceph/crypto.c"]}],"references":["https://git.kernel.org/stable/c/4b9aee707c4580511983a0998547f3b28514e6a6","https://git.kernel.org/stable/c/bb80f7618832d26f7e395f52f82b1dac76223e5f","https://git.kernel.org/stable/c/3145b2b11492d61c512bbc59660bb823bc757f48","https://git.kernel.org/stable/c/493479af8af3ab907f49e99323777d498a4fbd2b","https://git.kernel.org/stable/c/101841c38346f4ca41dc1802c867da990ffb32eb"],"weaknesses":[],"ingestedAt":"2026-10-29T20:09:09.358Z","source":{"repository":"CVEProject/cvelistV5","path":"cves/2025/38xxx/CVE-2025-38660.json","commit":"556c9d3a8cd17e218bb8e452ba7cd619a384ff47"},"raw":{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2025-38660","state":"PUBLISHED","datePublished":"2025-08-22T16:01:03.686Z","dateUpdated":"2026-10-15T22:02:27.813Z","assignerShortName":"Linux","assignerOrgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateReserved":"2025-04-16T04:51:24.031Z"},"containers":{"cna":{"title":"[ceph] parse_longname(): strrchr() expects NUL-terminated string","descriptions":[{"lang":"en","value":"In the Linux kernel, the following vulnerability has been resolved:\n\n[ceph] parse_longname(): strrchr() expects NUL-terminated string\n\n... and parse_longname() is not guaranteed that.  That's the reason\nwhy it uses kmemdup_nul() to build the argument for kstrtou64();\nthe problem is, kstrtou64() is not the only thing that need it.\n\nJust get a NUL-terminated copy of the entire thing and be done\nwith that..."}],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"dd66df0053ef84add5e684df517aa9b498342381","status":"affected","lessThan":"4b9aee707c4580511983a0998547f3b28514e6a6","versionType":"git"},{"version":"dd66df0053ef84add5e684df517aa9b498342381","status":"affected","lessThan":"bb80f7618832d26f7e395f52f82b1dac76223e5f","versionType":"git"},{"version":"dd66df0053ef84add5e684df517aa9b498342381","status":"affected","lessThan":"3145b2b11492d61c512bbc59660bb823bc757f48","versionType":"git"},{"version":"dd66df0053ef84add5e684df517aa9b498342381","status":"affected","lessThan":"493479af8af3ab907f49e99323777d498a4fbd2b","versionType":"git"},{"version":"dd66df0053ef84add5e684df517aa9b498342381","status":"affected","lessThan":"101841c38346f4ca41dc1802c867da990ffb32eb","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["fs/ceph/crypto.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"6.6","status":"affected"},{"version":"0","status":"unaffected","lessThan":"6.6","versionType":"semver"},{"version":"6.6.157","status":"unaffected","lessThanOrEqual":"6.6.*","versionType":"semver"},{"version":"6.12.42","status":"unaffected","lessThanOrEqual":"6.12.*","versionType":"semver"},{"version":"6.15.10","status":"unaffected","lessThanOrEqual":"6.15.*","versionType":"semver"},{"version":"6.16.1","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":["fs/ceph/crypto.c"]}],"references":[{"url":"https://git.kernel.org/stable/c/4b9aee707c4580511983a0998547f3b28514e6a6"},{"url":"https://git.kernel.org/stable/c/bb80f7618832d26f7e395f52f82b1dac76223e5f"},{"url":"https://git.kernel.org/stable/c/3145b2b11492d61c512bbc59660bb823bc757f48"},{"url":"https://git.kernel.org/stable/c/493479af8af3ab907f49e99323777d498a4fbd2b"},{"url":"https://git.kernel.org/stable/c/101841c38346f4ca41dc1802c867da990ffb32eb"}],"metrics":[{"cvssV3_1":{"version":"3.1","vectorString":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","baseScore":9.8,"baseSeverity":"CRITICAL"},"scenarios":[{"lang":"en","value":"AV:N - The unterminated string is dentry-name data read directly out of a Ceph MDS reply message (`info->dname = *p`, `_name = *p`) sitting in the kvmalloc'd `msg->front` buffer, so a malicious/compromised MDS or an on-path attacker on unencrypted cephfs traffic supplies it remotely. No local caller can produce a non-NUL-terminated name.\nAC:L - The attacker fully controls the reply contents and the exact `front_len`, so they can place the name flush against the end of the allocation and make the overread deterministic; the only build requirement is `CONFIG_FS_ENCRYPTION=y`, which is standard in distro and Android kernels, and no encryption key or encrypted directory is needed since `parse_longname()` runs before those checks.\nPR:N - The attacker holds no account or privilege on the victim client — the malicious reply is processed by the messenger/MDS-client code with no authorization check on the client side. Any process's routine directory access on the already-established mount suffices to consume it.\nUI:N - The snapdir condition depends on the server-supplied `snapid`, so a hostile MDS can mark an ordinary directory as `CEPH_SNAPDIR` and trigger the path on any normal readdir or lookup — no deliberate `.snap` access, remount, or other victim action is required.\nS:U - The out-of-bounds access is confined to kernel memory within the same security authority as the ceph client; no VM, IOMMU, or sandbox boundary is crossed.\nC:H - `strrchr()` reads unbounded adjacent kernel heap until it finds a NUL, and the resulting inflated `*name_len` causes those out-of-bounds bytes to be base64-decoded and propagated into the dentry name handed back toward userspace, giving an unbounded kernel memory disclosure primitive.\nI:H - The corrupted `*name_len` is no longer bounded by the `NAME_MAX` check (which was applied to the pre-parse copy), so `ceph_base64_decode()` and `fscrypt_fname_disk_to_usr()` write far past the end of the `NAME_MAX` fscrypt buffer or the message front buffer, yielding a heap out-of-bounds write with attacker-influenced data.\nA:H - The overread walks off a kvmalloc allocation and can hit a vmalloc guard page or unmapped memory, and the derived oversized length drives a heap overflow — either produces an oops/panic in the ceph messenger work context, and the attacker can repeat it on every reply."}]}],"providerMetadata":{"shortName":"Linux","orgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateUpdated":"2026-09-14T11:58:04.340Z"},"cpeApplicability":[{"nodes":[{"operator":"OR","negate":false,"cpeMatch":[{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.6","versionEndExcluding":"6.6.157"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.6","versionEndExcluding":"6.12.42"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.6","versionEndExcluding":"6.15.10"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.6","versionEndExcluding":"6.16.1"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.6","versionEndExcluding":"6.17"}]}]}],"x_generator":{"engine":"bippy-1.2.0"}},"adp":[{"title":"CISA ADP Vulnrichment","metrics":[{"other":{"type":"ssvc","content":{"id":"CVE-2025-38660","role":"CISA Coordinator","options":[{"Exploitation":"none"},{"Automatable":"yes"},{"Technical Impact":"total"}],"version":"2.0.3","timestamp":"2026-10-15T21:52:41.406590Z"}}}],"providerMetadata":{"shortName":"CISA-ADP","orgId":"134c704f-9b21-4f2e-91b3-4a467353bcc0","dateUpdated":"2026-10-15T22:02:27.813Z"}}]}}}