{
    "dataType": "CVE_RECORD",
    "dataVersion": "5.2",
    "cveMetadata": {
        "cveId": "CVE-2025-37984",
        "assignerOrgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
        "state": "PUBLISHED",
        "assignerShortName": "Linux",
        "dateReserved": "2025-04-16T04:51:23.976Z",
        "datePublished": "2025-05-20T17:09:18.321Z",
        "dateUpdated": "2026-08-05T11:58:45.966Z"
    },
    "containers": {
        "cna": {
            "providerMetadata": {
                "orgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
                "shortName": "Linux",
                "dateUpdated": "2026-08-05T11:58:45.966Z"
            },
            "descriptions": [
                {
                    "lang": "en",
                    "value": "In the Linux kernel, the following vulnerability has been resolved:\n\ncrypto: ecdsa - Harden against integer overflows in DIV_ROUND_UP()\n\nHerbert notes that DIV_ROUND_UP() may overflow unnecessarily if an ecdsa\nimplementation's ->key_size() callback returns an unusually large value.\nHerbert instead suggests (for a division by 8):\n\n  X / 8 + !!(X & 7)\n\nBased on this formula, introduce a generic DIV_ROUND_UP_POW2() macro and\nuse it in lieu of DIV_ROUND_UP() for ->key_size() return values.\n\nAdditionally, use the macro in ecc_digits_from_bytes(), whose \"nbytes\"\nparameter is a ->key_size() return value in some instances, or a\nuser-specified ASN.1 length in the case of ecdsa_get_signature_rs()."
                }
            ],
            "metrics": [
                {
                    "cvssV3_1": {
                        "version": "3.1",
                        "vectorString": "CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H",
                        "baseScore": 7,
                        "baseSeverity": "HIGH"
                    },
                    "scenarios": [
                        {
                            "lang": "en",
                            "value": "AV:L - The affected code is the in-kernel ECDSA signature-verification path, entered from userspace via `add_key(\"asymmetric\", ...)`/`keyctl(KEYCTL_PKEY_VERIFY)` or local X.509/PKCS#7 verification. No in-kernel network consumer (ksmbd, nfsd, TLS, Bluetooth) performs ECDSA certificate verification, so the flaw is only reachable through local syscalls.\nAC:H - The `DIV_ROUND_UP()` wrap requires a value above `UINT_MAX - 7`, but every in-tree caller bounds its input — `ecdsa_get_signature_rs()` rejects `vlen > ndigits*8 + 1`, the ASN.1 decoder caps `vlen` at the buffer length, and `ecdsa_key_size()` is fixed at ≤66 bytes by the curve's `nbits`. Triggering it depends on an ECDSA implementation whose `->key_size()` callback reports an ~4 GB key, a precondition entirely outside the attacker's control and absent from any standard configuration.\nPR:L - The verification path is reachable by any unprivileged local user, who may add a crafted self-signed X.509 certificate to their own session keyring and then submit arbitrary signature blobs via `KEYCTL_PKEY_VERIFY`; no capability or namespace privilege is required.\nUI:N - The attacker drives the entire sequence through its own `add_key`/`keyctl` syscalls with attacker-supplied key and signature data; no victim action or cooperating process is needed.\nS:U - The resulting corruption is confined to kernel memory within the same kernel that runs the flawed code; no VM, hypervisor, IOMMU, or sandbox boundary is crossed.\nC:H - An underflowed `ndigits` sends `ecc_swap_digits()` iterating up to `0xFFFFFFFF` digits, reading and writing far outside the `ecdsa_raw_sig`/`pub_key` buffers, and the converted digits feed back into signature verification — an unbounded out-of-bounds access that could expose adjacent kernel memory.\nI:H - `out[--ndigits]` with `ndigits` wrapping to `0xFFFFFFFF` is a wild store roughly 32 GB past the destination buffer, followed by a multi-billion-iteration out-of-bounds write loop — an out-of-bounds write primitive that scores High.\nA:H - The runaway `ecc_swap_digits()` loop writes over arbitrary kernel memory and will immediately fault or panic the machine, and the corrupted crypto state renders the affected path unusable."
                        }
                    ]
                }
            ],
            "affected": [
                {
                    "product": "Linux",
                    "vendor": "Linux",
                    "defaultStatus": "unaffected",
                    "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
                    "programFiles": [
                        "crypto/ecc.c",
                        "crypto/ecdsa-p1363.c",
                        "crypto/ecdsa-x962.c",
                        "include/linux/math.h"
                    ],
                    "versions": [
                        {
                            "version": "55779f26eab9af12474a447001bd17070f055712",
                            "lessThan": "f02f0218be412cff1c844addf58e002071be298b",
                            "status": "affected",
                            "versionType": "git"
                        },
                        {
                            "version": "c6ab5c915da460c0397960af3c308386c3f3247b",
                            "lessThan": "f2133b849ff273abddb6da622daddd8f6f6fa448",
                            "status": "affected",
                            "versionType": "git"
                        },
                        {
                            "version": "c6ab5c915da460c0397960af3c308386c3f3247b",
                            "lessThan": "921b8167f10708e38080f84e195cdc68a7a561f1",
                            "status": "affected",
                            "versionType": "git"
                        },
                        {
                            "version": "c6ab5c915da460c0397960af3c308386c3f3247b",
                            "lessThan": "b16510a530d1e6ab9683f04f8fb34f2e0f538275",
                            "status": "affected",
                            "versionType": "git"
                        },
                        {
                            "version": "6.6.70",
                            "lessThan": "6.6.99",
                            "status": "affected",
                            "versionType": "semver"
                        }
                    ]
                },
                {
                    "product": "Linux",
                    "vendor": "Linux",
                    "defaultStatus": "affected",
                    "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
                    "programFiles": [
                        "crypto/ecc.c",
                        "crypto/ecdsa-p1363.c",
                        "crypto/ecdsa-x962.c",
                        "include/linux/math.h"
                    ],
                    "versions": [
                        {
                            "version": "6.10",
                            "status": "affected"
                        },
                        {
                            "version": "0",
                            "lessThan": "6.10",
                            "status": "unaffected",
                            "versionType": "semver"
                        },
                        {
                            "version": "6.6.99",
                            "lessThanOrEqual": "6.6.*",
                            "status": "unaffected",
                            "versionType": "semver"
                        },
                        {
                            "version": "6.12.39",
                            "lessThanOrEqual": "6.12.*",
                            "status": "unaffected",
                            "versionType": "semver"
                        },
                        {
                            "version": "6.14.5",
                            "lessThanOrEqual": "6.14.*",
                            "status": "unaffected",
                            "versionType": "semver"
                        },
                        {
                            "version": "6.15",
                            "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.70",
                                    "versionEndExcluding": "6.6.99"
                                },
                                {
                                    "vulnerable": true,
                                    "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                                    "versionStartIncluding": "6.10",
                                    "versionEndExcluding": "6.12.39"
                                },
                                {
                                    "vulnerable": true,
                                    "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                                    "versionStartIncluding": "6.10",
                                    "versionEndExcluding": "6.14.5"
                                },
                                {
                                    "vulnerable": true,
                                    "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                                    "versionStartIncluding": "6.10",
                                    "versionEndExcluding": "6.15"
                                }
                            ]
                        }
                    ]
                }
            ],
            "references": [
                {
                    "url": "https://git.kernel.org/stable/c/f02f0218be412cff1c844addf58e002071be298b"
                },
                {
                    "url": "https://git.kernel.org/stable/c/f2133b849ff273abddb6da622daddd8f6f6fa448"
                },
                {
                    "url": "https://git.kernel.org/stable/c/921b8167f10708e38080f84e195cdc68a7a561f1"
                },
                {
                    "url": "https://git.kernel.org/stable/c/b16510a530d1e6ab9683f04f8fb34f2e0f538275"
                }
            ],
            "title": "crypto: ecdsa - Harden against integer overflows in DIV_ROUND_UP()",
            "x_generator": {
                "engine": "bippy-1.2.0"
            }
        }
    }
}