{
    "dataType": "CVE_RECORD",
    "dataVersion": "5.2",
    "cveMetadata": {
        "cveId": "CVE-2025-38660",
        "assignerOrgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
        "state": "PUBLISHED",
        "assignerShortName": "Linux",
        "dateReserved": "2025-04-16T04:51:24.031Z",
        "datePublished": "2025-08-22T16:01:03.686Z",
        "dateUpdated": "2026-08-05T12:03:47.196Z"
    },
    "containers": {
        "cna": {
            "providerMetadata": {
                "orgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
                "shortName": "Linux",
                "dateUpdated": "2026-08-05T12:03:47.196Z"
            },
            "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..."
                }
            ],
            "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."
                        }
                    ]
                }
            ],
            "affected": [
                {
                    "product": "Linux",
                    "vendor": "Linux",
                    "defaultStatus": "unaffected",
                    "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
                    "programFiles": [
                        "fs/ceph/crypto.c"
                    ],
                    "versions": [
                        {
                            "version": "dd66df0053ef84add5e684df517aa9b498342381",
                            "lessThan": "bb80f7618832d26f7e395f52f82b1dac76223e5f",
                            "status": "affected",
                            "versionType": "git"
                        },
                        {
                            "version": "dd66df0053ef84add5e684df517aa9b498342381",
                            "lessThan": "3145b2b11492d61c512bbc59660bb823bc757f48",
                            "status": "affected",
                            "versionType": "git"
                        },
                        {
                            "version": "dd66df0053ef84add5e684df517aa9b498342381",
                            "lessThan": "493479af8af3ab907f49e99323777d498a4fbd2b",
                            "status": "affected",
                            "versionType": "git"
                        },
                        {
                            "version": "dd66df0053ef84add5e684df517aa9b498342381",
                            "lessThan": "101841c38346f4ca41dc1802c867da990ffb32eb",
                            "status": "affected",
                            "versionType": "git"
                        }
                    ]
                },
                {
                    "product": "Linux",
                    "vendor": "Linux",
                    "defaultStatus": "affected",
                    "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
                    "programFiles": [
                        "fs/ceph/crypto.c"
                    ],
                    "versions": [
                        {
                            "version": "6.6",
                            "status": "affected"
                        },
                        {
                            "version": "0",
                            "lessThan": "6.6",
                            "status": "unaffected",
                            "versionType": "semver"
                        },
                        {
                            "version": "6.12.42",
                            "lessThanOrEqual": "6.12.*",
                            "status": "unaffected",
                            "versionType": "semver"
                        },
                        {
                            "version": "6.15.10",
                            "lessThanOrEqual": "6.15.*",
                            "status": "unaffected",
                            "versionType": "semver"
                        },
                        {
                            "version": "6.16.1",
                            "lessThanOrEqual": "6.16.*",
                            "status": "unaffected",
                            "versionType": "semver"
                        },
                        {
                            "version": "6.17",
                            "lessThanOrEqual": "*",
                            "status": "unaffected",
                            "versionType": "original_commit_for_fix"
                        }
                    ]
                }
            ],
            "cpeApplicability": [
                {
                    "nodes": [
                        {
                            "operator": "OR",
                            "negate": false,
                            "cpeMatch": [
                                {
                                    "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"
                                }
                            ]
                        }
                    ]
                }
            ],
            "references": [
                {
                    "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"
                }
            ],
            "title": "[ceph] parse_longname(): strrchr() expects NUL-terminated string",
            "x_generator": {
                "engine": "bippy-1.2.0"
            }
        }
    }
}