CVE-2025-37984 (GCVE-0-2025-37984)

Vulnerability from cvelistv5 – Published: 2025-05-20 17:09 – Updated: 2026-08-05 11:58
VLAI
Title
crypto: ecdsa - Harden against integer overflows in DIV_ROUND_UP()
Summary
In the Linux kernel, the following vulnerability has been resolved: crypto: ecdsa - Harden against integer overflows in DIV_ROUND_UP() Herbert notes that DIV_ROUND_UP() may overflow unnecessarily if an ecdsa implementation's ->key_size() callback returns an unusually large value. Herbert instead suggests (for a division by 8): X / 8 + !!(X & 7) Based on this formula, introduce a generic DIV_ROUND_UP_POW2() macro and use it in lieu of DIV_ROUND_UP() for ->key_size() return values. Additionally, use the macro in ecc_digits_from_bytes(), whose "nbytes" parameter is a ->key_size() return value in some instances, or a user-specified ASN.1 length in the case of ecdsa_get_signature_rs().
Impacted products
Vendor Product Version CPE status
Linux Linux Affected: 55779f26eab9af12474a447001bd17070f055712 , < f02f0218be412cff1c844addf58e002071be298b (git)
Affected: c6ab5c915da460c0397960af3c308386c3f3247b , < f2133b849ff273abddb6da622daddd8f6f6fa448 (git)
Affected: c6ab5c915da460c0397960af3c308386c3f3247b , < 921b8167f10708e38080f84e195cdc68a7a561f1 (git)
Affected: c6ab5c915da460c0397960af3c308386c3f3247b , < b16510a530d1e6ab9683f04f8fb34f2e0f538275 (git)
Affected: 6.6.70 , < 6.6.99 (semver)
guessed Create a notification for this product.
Linux Linux Affected: 6.10
Unaffected: 0 , < 6.10 (semver)
Unaffected: 6.6.99 , ≤ 6.6.* (semver)
Unaffected: 6.12.39 , ≤ 6.12.* (semver)
Unaffected: 6.14.5 , ≤ 6.14.* (semver)
Unaffected: 6.15 , ≤ * (original_commit_for_fix)
guessed Create a notification for this product.
Show details on NVD website

{
  "containers": {
    "cna": {
      "affected": [
        {
          "defaultStatus": "unaffected",
          "product": "Linux",
          "programFiles": [
            "crypto/ecc.c",
            "crypto/ecdsa-p1363.c",
            "crypto/ecdsa-x962.c",
            "include/linux/math.h"
          ],
          "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
          "vendor": "Linux",
          "versions": [
            {
              "lessThan": "f02f0218be412cff1c844addf58e002071be298b",
              "status": "affected",
              "version": "55779f26eab9af12474a447001bd17070f055712",
              "versionType": "git"
            },
            {
              "lessThan": "f2133b849ff273abddb6da622daddd8f6f6fa448",
              "status": "affected",
              "version": "c6ab5c915da460c0397960af3c308386c3f3247b",
              "versionType": "git"
            },
            {
              "lessThan": "921b8167f10708e38080f84e195cdc68a7a561f1",
              "status": "affected",
              "version": "c6ab5c915da460c0397960af3c308386c3f3247b",
              "versionType": "git"
            },
            {
              "lessThan": "b16510a530d1e6ab9683f04f8fb34f2e0f538275",
              "status": "affected",
              "version": "c6ab5c915da460c0397960af3c308386c3f3247b",
              "versionType": "git"
            },
            {
              "lessThan": "6.6.99",
              "status": "affected",
              "version": "6.6.70",
              "versionType": "semver"
            }
          ]
        },
        {
          "defaultStatus": "affected",
          "product": "Linux",
          "programFiles": [
            "crypto/ecc.c",
            "crypto/ecdsa-p1363.c",
            "crypto/ecdsa-x962.c",
            "include/linux/math.h"
          ],
          "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
          "vendor": "Linux",
          "versions": [
            {
              "status": "affected",
              "version": "6.10"
            },
            {
              "lessThan": "6.10",
              "status": "unaffected",
              "version": "0",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "6.6.*",
              "status": "unaffected",
              "version": "6.6.99",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "6.12.*",
              "status": "unaffected",
              "version": "6.12.39",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "6.14.*",
              "status": "unaffected",
              "version": "6.14.5",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "*",
              "status": "unaffected",
              "version": "6.15",
              "versionType": "original_commit_for_fix"
            }
          ]
        }
      ],
      "cpeApplicability": [
        {
          "nodes": [
            {
              "cpeMatch": [
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "6.6.99",
                  "versionStartIncluding": "6.6.70",
                  "vulnerable": true
                },
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "6.12.39",
                  "versionStartIncluding": "6.10",
                  "vulnerable": true
                },
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "6.14.5",
                  "versionStartIncluding": "6.10",
                  "vulnerable": true
                },
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "6.15",
                  "versionStartIncluding": "6.10",
                  "vulnerable": true
                }
              ],
              "negate": false,
              "operator": "OR"
            }
          ]
        }
      ],
      "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\u0027s -\u003ekey_size() callback returns an unusually large value.\nHerbert instead suggests (for a division by 8):\n\n  X / 8 + !!(X \u0026 7)\n\nBased on this formula, introduce a generic DIV_ROUND_UP_POW2() macro and\nuse it in lieu of DIV_ROUND_UP() for -\u003ekey_size() return values.\n\nAdditionally, use the macro in ecc_digits_from_bytes(), whose \"nbytes\"\nparameter is a -\u003ekey_size() return value in some instances, or a\nuser-specified ASN.1 length in the case of ecdsa_get_signature_rs()."
        }
      ],
      "metrics": [
        {
          "cvssV3_1": {
            "baseScore": 7,
            "baseSeverity": "HIGH",
            "vectorString": "CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H",
            "version": "3.1"
          },
          "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 \u2014 `ecdsa_get_signature_rs()` rejects `vlen \u003e ndigits*8 + 1`, the ASN.1 decoder caps `vlen` at the buffer length, and `ecdsa_key_size()` is fixed at \u226466 bytes by the curve\u0027s `nbits`. Triggering it depends on an ECDSA implementation whose `-\u003ekey_size()` callback reports an ~4 GB key, a precondition entirely outside the attacker\u0027s 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 \u2014 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 \u2014 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."
            }
          ]
        }
      ],
      "providerMetadata": {
        "dateUpdated": "2026-08-05T11:58:45.966Z",
        "orgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
        "shortName": "Linux"
      },
      "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"
      }
    }
  },
  "cveMetadata": {
    "assignerOrgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
    "assignerShortName": "Linux",
    "cveId": "CVE-2025-37984",
    "datePublished": "2025-05-20T17:09:18.321Z",
    "dateReserved": "2025-04-16T04:51:23.976Z",
    "dateUpdated": "2026-08-05T11:58:45.966Z",
    "state": "PUBLISHED"
  },
  "dataType": "CVE_RECORD",
  "dataVersion": "5.2",
  "vulnerability-lookup:meta": {
    "epss": {
      "cve": "CVE-2025-37984",
      "date": "2026-09-21",
      "epss": "0.00177",
      "percentile": "0.07441"
    },
    "microsoft_vex": {
      "current_release_date": "2026-02-18T01:34:20.000Z",
      "cve": "CVE-2025-37984",
      "id": "msrc_CVE-2025-37984",
      "initial_release_date": "2025-05-02T00:00:00.000Z",
      "product_status:known_not_affected": "1",
      "source": "Microsoft CSAF VEX",
      "status": "final",
      "title": "crypto: ecdsa - Harden against integer overflows in DIV_ROUND_UP()",
      "url": "https://msrc.microsoft.com/csaf/vex/2025/msrc_cve-2025-37984.json",
      "version": "2"
    },
    "nvd": {
      "cve": {
        "affected": [
          {
            "affectedData": [
              {
                "defaultStatus": "unaffected",
                "product": "Linux",
                "programFiles": [
                  "crypto/ecc.c",
                  "crypto/ecdsa-p1363.c",
                  "crypto/ecdsa-x962.c",
                  "include/linux/math.h"
                ],
                "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
                "vendor": "Linux",
                "versions": [
                  {
                    "lessThan": "f02f0218be412cff1c844addf58e002071be298b",
                    "status": "affected",
                    "version": "55779f26eab9af12474a447001bd17070f055712",
                    "versionType": "git"
                  },
                  {
                    "lessThan": "f2133b849ff273abddb6da622daddd8f6f6fa448",
                    "status": "affected",
                    "version": "c6ab5c915da460c0397960af3c308386c3f3247b",
                    "versionType": "git"
                  },
                  {
                    "lessThan": "921b8167f10708e38080f84e195cdc68a7a561f1",
                    "status": "affected",
                    "version": "c6ab5c915da460c0397960af3c308386c3f3247b",
                    "versionType": "git"
                  },
                  {
                    "lessThan": "b16510a530d1e6ab9683f04f8fb34f2e0f538275",
                    "status": "affected",
                    "version": "c6ab5c915da460c0397960af3c308386c3f3247b",
                    "versionType": "git"
                  },
                  {
                    "lessThan": "6.6.99",
                    "status": "affected",
                    "version": "6.6.70",
                    "versionType": "semver"
                  }
                ]
              },
              {
                "defaultStatus": "affected",
                "product": "Linux",
                "programFiles": [
                  "crypto/ecc.c",
                  "crypto/ecdsa-p1363.c",
                  "crypto/ecdsa-x962.c",
                  "include/linux/math.h"
                ],
                "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
                "vendor": "Linux",
                "versions": [
                  {
                    "status": "affected",
                    "version": "6.10"
                  },
                  {
                    "lessThan": "6.10",
                    "status": "unaffected",
                    "version": "0",
                    "versionType": "semver"
                  },
                  {
                    "lessThanOrEqual": "6.6.*",
                    "status": "unaffected",
                    "version": "6.6.99",
                    "versionType": "semver"
                  },
                  {
                    "lessThanOrEqual": "6.12.*",
                    "status": "unaffected",
                    "version": "6.12.39",
                    "versionType": "semver"
                  },
                  {
                    "lessThanOrEqual": "6.14.*",
                    "status": "unaffected",
                    "version": "6.14.5",
                    "versionType": "semver"
                  },
                  {
                    "lessThanOrEqual": "*",
                    "status": "unaffected",
                    "version": "6.15",
                    "versionType": "original_commit_for_fix"
                  }
                ]
              }
            ],
            "source": "416baaa9-dc9f-4396-8d5f-8c081fb06d67"
          }
        ],
        "configurations": [
          {
            "nodes": [
              {
                "cpeMatch": [
                  {
                    "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                    "matchCriteriaId": "7CCA2E29-450F-44AE-B634-FCC3BAF6D1F3",
                    "versionEndExcluding": "6.6.99",
                    "versionStartIncluding": "6.6.70",
                    "vulnerable": true
                  },
                  {
                    "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                    "matchCriteriaId": "5E0A7E52-CDBF-45E4-8338-F679910D5C1B",
                    "versionEndExcluding": "6.12.39",
                    "versionStartIncluding": "6.10",
                    "vulnerable": true
                  },
                  {
                    "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                    "matchCriteriaId": "6B25CA7E-4CD0-46DB-B4EF-13A3516071FB",
                    "versionEndExcluding": "6.14.5",
                    "versionStartIncluding": "6.13",
                    "vulnerable": true
                  }
                ],
                "negate": false,
                "operator": "OR"
              }
            ]
          }
        ],
        "cveTags": [],
        "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\u0027s -\u003ekey_size() callback returns an unusually large value.\nHerbert instead suggests (for a division by 8):\n\n  X / 8 + !!(X \u0026 7)\n\nBased on this formula, introduce a generic DIV_ROUND_UP_POW2() macro and\nuse it in lieu of DIV_ROUND_UP() for -\u003ekey_size() return values.\n\nAdditionally, use the macro in ecc_digits_from_bytes(), whose \"nbytes\"\nparameter is a -\u003ekey_size() return value in some instances, or a\nuser-specified ASN.1 length in the case of ecdsa_get_signature_rs()."
          },
          {
            "lang": "es",
            "value": "En el kernel de Linux, se ha resuelto la siguiente vulnerabilidad: crypto: ecdsa - Protecci\u00f3n contra desbordamientos de enteros en DIV_ROUND_UP(). Herbert se\u00f1ala que DIV_ROUND_UP() puede desbordarse innecesariamente si la funci\u00f3n de retorno -\u0026gt;key_size() de una implementaci\u00f3n de ecdsa devuelve un valor inusualmente grande. En su lugar, Herbert sugiere (para una divisi\u00f3n entre 8): X / 8 + !!(X y 7). Con base en esta f\u00f3rmula, introduzca una macro gen\u00e9rica DIV_ROUND_UP_POW2() y \u00fasela en lugar de DIV_ROUND_UP() para los valores de retorno de -\u0026gt;key_size(). Adem\u00e1s, utilice la macro en ecc_digits_from_bytes(), cuyo par\u00e1metro \"nbytes\" es un valor de retorno de -\u0026gt;key_size() en algunos casos, o una longitud ASN.1 especificada por el usuario en el caso de ecdsa_get_signature_rs()."
          }
        ],
        "id": "CVE-2025-37984",
        "lastModified": "2026-07-30T06:22:42.710",
        "metrics": {
          "cvssMetricV31": [
            {
              "cvssData": {
                "attackComplexity": "HIGH",
                "attackVector": "LOCAL",
                "availabilityImpact": "HIGH",
                "baseScore": 7.0,
                "baseSeverity": "HIGH",
                "confidentialityImpact": "HIGH",
                "integrityImpact": "HIGH",
                "privilegesRequired": "LOW",
                "scope": "UNCHANGED",
                "userInteraction": "NONE",
                "vectorString": "CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H",
                "version": "3.1"
              },
              "exploitabilityScore": 1.0,
              "impactScore": 5.9,
              "source": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
              "type": "Secondary"
            },
            {
              "cvssData": {
                "attackComplexity": "LOW",
                "attackVector": "LOCAL",
                "availabilityImpact": "HIGH",
                "baseScore": 5.5,
                "baseSeverity": "MEDIUM",
                "confidentialityImpact": "NONE",
                "integrityImpact": "NONE",
                "privilegesRequired": "LOW",
                "scope": "UNCHANGED",
                "userInteraction": "NONE",
                "vectorString": "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H",
                "version": "3.1"
              },
              "exploitabilityScore": 1.8,
              "impactScore": 3.6,
              "source": "nvd@nist.gov",
              "type": "Primary"
            }
          ]
        },
        "published": "2025-05-20T18:15:45.253",
        "references": [
          {
            "source": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
            "tags": [
              "Patch"
            ],
            "url": "https://git.kernel.org/stable/c/921b8167f10708e38080f84e195cdc68a7a561f1"
          },
          {
            "source": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
            "tags": [
              "Patch"
            ],
            "url": "https://git.kernel.org/stable/c/b16510a530d1e6ab9683f04f8fb34f2e0f538275"
          },
          {
            "source": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
            "tags": [
              "Patch"
            ],
            "url": "https://git.kernel.org/stable/c/f02f0218be412cff1c844addf58e002071be298b"
          },
          {
            "source": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
            "tags": [
              "Patch"
            ],
            "url": "https://git.kernel.org/stable/c/f2133b849ff273abddb6da622daddd8f6f6fa448"
          }
        ],
        "sourceIdentifier": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
        "vulnStatus": "Modified",
        "weaknesses": [
          {
            "description": [
              {
                "lang": "en",
                "value": "CWE-190"
              }
            ],
            "source": "nvd@nist.gov",
            "type": "Primary"
          }
        ]
      }
    },
    "redhat_vex": {
      "aggregate_severity": "Low",
      "current_release_date": "2026-07-30T10:11:50+00:00",
      "cve": "CVE-2025-37984",
      "id": "CVE-2025-37984",
      "initial_release_date": "2025-05-20T00:00:00+00:00",
      "product_status:known_affected": "232",
      "product_status:known_not_affected": "42",
      "source": "Red Hat CSAF VEX",
      "status": "final",
      "title": "kernel: crypto: ecdsa - Harden against integer overflows in DIV_ROUND_UP()",
      "url": "https://security.access.redhat.com/data/csaf/v2/vex/2025/cve-2025-37984.json",
      "version": "3"
    }
  }
}



Log in or create an account to share your comment.




Tags
Taxonomy of the tags.


Loading…

Loading…

Loading…

Forecast uses a logistic model when the trend is rising, or an exponential decay model when the trend is falling. Fitted via linearized least squares.

Sightings

Author Source Type Date Other

Nomenclature

  • Seen: The vulnerability was mentioned, discussed, or observed by the user.
  • Confirmed: The vulnerability has been validated from an analyst's perspective.
  • Published Proof of Concept: A public proof of concept is available for this vulnerability.
  • Exploited: The vulnerability was observed as exploited by the user who reported the sighting.
  • Patched: The vulnerability was observed as successfully patched by the user who reported the sighting.
  • Not exploited: The vulnerability was not observed as exploited by the user who reported the sighting.
  • Not confirmed: The user expressed doubt about the validity of the vulnerability.
  • Not patched: The vulnerability was not observed as successfully patched by the user who reported the sighting.

Loading…

Detection rules are retrieved from Rulezet.

Loading…

Loading…

Related by attack behaviour

Vulnerabilities whose description is nearest to this one in the vector space of the CIRCL/vulnerability-attack-technique-biencoder model. This is a similarity search over the bi-encoder space (plain cosine), not a classification, and it has no measured accuracy.


Loading…