CVE-2025-37989 (GCVE-0-2025-37989)
Vulnerability from cvelistv5
Published
2025-05-20 17:09
Modified
2025-05-26 05:25
Severity ?
Summary
In the Linux kernel, the following vulnerability has been resolved: net: phy: leds: fix memory leak A network restart test on a router led to an out-of-memory condition, which was traced to a memory leak in the PHY LED trigger code. The root cause is misuse of the devm API. The registration function (phy_led_triggers_register) is called from phy_attach_direct, not phy_probe, and the unregister function (phy_led_triggers_unregister) is called from phy_detach, not phy_remove. This means the register and unregister functions can be called multiple times for the same PHY device, but devm-allocated memory is not freed until the driver is unbound. This also prevents kmemleak from detecting the leak, as the devm API internally stores the allocated pointer. Fix this by replacing devm_kzalloc/devm_kcalloc with standard kzalloc/kcalloc, and add the corresponding kfree calls in the unregister path.
Impacted products
Vendor Product Version
Linux Linux Version: 2e0bc452f4721520502575362a9cd3c1248d2337
Version: 2e0bc452f4721520502575362a9cd3c1248d2337
Version: 2e0bc452f4721520502575362a9cd3c1248d2337
Version: 2e0bc452f4721520502575362a9cd3c1248d2337
Version: 2e0bc452f4721520502575362a9cd3c1248d2337
Version: 2e0bc452f4721520502575362a9cd3c1248d2337
Version: 2e0bc452f4721520502575362a9cd3c1248d2337
Version: 2e0bc452f4721520502575362a9cd3c1248d2337
Create a notification for this product.
Show details on NVD website


{
  "containers": {
    "cna": {
      "affected": [
        {
          "defaultStatus": "unaffected",
          "product": "Linux",
          "programFiles": [
            "drivers/net/phy/phy_led_triggers.c"
          ],
          "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
          "vendor": "Linux",
          "versions": [
            {
              "lessThan": "966d6494e2ed9be9052fcd9815afba830896aaf8",
              "status": "affected",
              "version": "2e0bc452f4721520502575362a9cd3c1248d2337",
              "versionType": "git"
            },
            {
              "lessThan": "95bed65cc0eb2a610550abf849a8b94374da80a7",
              "status": "affected",
              "version": "2e0bc452f4721520502575362a9cd3c1248d2337",
              "versionType": "git"
            },
            {
              "lessThan": "663c3da86e807c6c07ed48f911c7526fad6fe1ff",
              "status": "affected",
              "version": "2e0bc452f4721520502575362a9cd3c1248d2337",
              "versionType": "git"
            },
            {
              "lessThan": "f41f097f68a33d392579885426d0734a81219501",
              "status": "affected",
              "version": "2e0bc452f4721520502575362a9cd3c1248d2337",
              "versionType": "git"
            },
            {
              "lessThan": "618541a6cc1511064dfa58c89b3445e21844092f",
              "status": "affected",
              "version": "2e0bc452f4721520502575362a9cd3c1248d2337",
              "versionType": "git"
            },
            {
              "lessThan": "41143e71052a00d654c15dc924fda50c1e7357d0",
              "status": "affected",
              "version": "2e0bc452f4721520502575362a9cd3c1248d2337",
              "versionType": "git"
            },
            {
              "lessThan": "7f3d5880800f962c347777c4f8358f29f5fc403c",
              "status": "affected",
              "version": "2e0bc452f4721520502575362a9cd3c1248d2337",
              "versionType": "git"
            },
            {
              "lessThan": "b7f0ee992adf601aa00c252418266177eb7ac2bc",
              "status": "affected",
              "version": "2e0bc452f4721520502575362a9cd3c1248d2337",
              "versionType": "git"
            }
          ]
        },
        {
          "defaultStatus": "affected",
          "product": "Linux",
          "programFiles": [
            "drivers/net/phy/phy_led_triggers.c"
          ],
          "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
          "vendor": "Linux",
          "versions": [
            {
              "status": "affected",
              "version": "4.10"
            },
            {
              "lessThan": "4.10",
              "status": "unaffected",
              "version": "0",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "5.4.*",
              "status": "unaffected",
              "version": "5.4.293",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "5.10.*",
              "status": "unaffected",
              "version": "5.10.237",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "5.15.*",
              "status": "unaffected",
              "version": "5.15.181",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "6.1.*",
              "status": "unaffected",
              "version": "6.1.136",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "6.6.*",
              "status": "unaffected",
              "version": "6.6.89",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "6.12.*",
              "status": "unaffected",
              "version": "6.12.26",
              "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": "5.4.293",
                  "versionStartIncluding": "4.10",
                  "vulnerable": true
                },
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "5.10.237",
                  "versionStartIncluding": "4.10",
                  "vulnerable": true
                },
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "5.15.181",
                  "versionStartIncluding": "4.10",
                  "vulnerable": true
                },
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "6.1.136",
                  "versionStartIncluding": "4.10",
                  "vulnerable": true
                },
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "6.6.89",
                  "versionStartIncluding": "4.10",
                  "vulnerable": true
                },
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "6.12.26",
                  "versionStartIncluding": "4.10",
                  "vulnerable": true
                },
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "6.14.5",
                  "versionStartIncluding": "4.10",
                  "vulnerable": true
                },
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "6.15",
                  "versionStartIncluding": "4.10",
                  "vulnerable": true
                }
              ],
              "negate": false,
              "operator": "OR"
            }
          ]
        }
      ],
      "descriptions": [
        {
          "lang": "en",
          "value": "In the Linux kernel, the following vulnerability has been resolved:\n\nnet: phy: leds: fix memory leak\n\nA network restart test on a router led to an out-of-memory condition,\nwhich was traced to a memory leak in the PHY LED trigger code.\n\nThe root cause is misuse of the devm API. The registration function\n(phy_led_triggers_register) is called from phy_attach_direct, not\nphy_probe, and the unregister function (phy_led_triggers_unregister)\nis called from phy_detach, not phy_remove. This means the register and\nunregister functions can be called multiple times for the same PHY\ndevice, but devm-allocated memory is not freed until the driver is\nunbound.\n\nThis also prevents kmemleak from detecting the leak, as the devm API\ninternally stores the allocated pointer.\n\nFix this by replacing devm_kzalloc/devm_kcalloc with standard\nkzalloc/kcalloc, and add the corresponding kfree calls in the unregister\npath."
        }
      ],
      "providerMetadata": {
        "dateUpdated": "2025-05-26T05:25:12.977Z",
        "orgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
        "shortName": "Linux"
      },
      "references": [
        {
          "url": "https://git.kernel.org/stable/c/966d6494e2ed9be9052fcd9815afba830896aaf8"
        },
        {
          "url": "https://git.kernel.org/stable/c/95bed65cc0eb2a610550abf849a8b94374da80a7"
        },
        {
          "url": "https://git.kernel.org/stable/c/663c3da86e807c6c07ed48f911c7526fad6fe1ff"
        },
        {
          "url": "https://git.kernel.org/stable/c/f41f097f68a33d392579885426d0734a81219501"
        },
        {
          "url": "https://git.kernel.org/stable/c/618541a6cc1511064dfa58c89b3445e21844092f"
        },
        {
          "url": "https://git.kernel.org/stable/c/41143e71052a00d654c15dc924fda50c1e7357d0"
        },
        {
          "url": "https://git.kernel.org/stable/c/7f3d5880800f962c347777c4f8358f29f5fc403c"
        },
        {
          "url": "https://git.kernel.org/stable/c/b7f0ee992adf601aa00c252418266177eb7ac2bc"
        }
      ],
      "title": "net: phy: leds: fix memory leak",
      "x_generator": {
        "engine": "bippy-1.2.0"
      }
    }
  },
  "cveMetadata": {
    "assignerOrgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
    "assignerShortName": "Linux",
    "cveId": "CVE-2025-37989",
    "datePublished": "2025-05-20T17:09:21.419Z",
    "dateReserved": "2025-04-16T04:51:23.976Z",
    "dateUpdated": "2025-05-26T05:25:12.977Z",
    "state": "PUBLISHED"
  },
  "dataType": "CVE_RECORD",
  "dataVersion": "5.1",
  "vulnerability-lookup:meta": {
    "nvd": "{\"cve\":{\"id\":\"CVE-2025-37989\",\"sourceIdentifier\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\",\"published\":\"2025-05-20T18:15:45.773\",\"lastModified\":\"2025-05-21T20:24:58.133\",\"vulnStatus\":\"Awaiting Analysis\",\"cveTags\":[],\"descriptions\":[{\"lang\":\"en\",\"value\":\"In the Linux kernel, the following vulnerability has been resolved:\\n\\nnet: phy: leds: fix memory leak\\n\\nA network restart test on a router led to an out-of-memory condition,\\nwhich was traced to a memory leak in the PHY LED trigger code.\\n\\nThe root cause is misuse of the devm API. The registration function\\n(phy_led_triggers_register) is called from phy_attach_direct, not\\nphy_probe, and the unregister function (phy_led_triggers_unregister)\\nis called from phy_detach, not phy_remove. This means the register and\\nunregister functions can be called multiple times for the same PHY\\ndevice, but devm-allocated memory is not freed until the driver is\\nunbound.\\n\\nThis also prevents kmemleak from detecting the leak, as the devm API\\ninternally stores the allocated pointer.\\n\\nFix this by replacing devm_kzalloc/devm_kcalloc with standard\\nkzalloc/kcalloc, and add the corresponding kfree calls in the unregister\\npath.\"},{\"lang\":\"es\",\"value\":\"En el kernel de Linux, se ha resuelto la siguiente vulnerabilidad: net: phy: leds: fix memory leakage Una prueba de reinicio de red en un enrutador provoc\u00f3 una condici\u00f3n de falta de memoria, que se rastre\u00f3 hasta una fuga de memoria en el c\u00f3digo de activaci\u00f3n del LED PHY. La causa ra\u00edz es el uso indebido de la API devm. La funci\u00f3n de registro (phy_led_triggers_register) se llama desde phy_attach_direct, no desde phy_probe, y la funci\u00f3n de anulaci\u00f3n del registro (phy_led_triggers_unregister) se llama desde phy_detach, no desde phy_remove. Esto significa que las funciones de registro y anulaci\u00f3n del registro se pueden llamar varias veces para el mismo dispositivo PHY, pero la memoria asignada por devm no se libera hasta que se desvincula el controlador. Esto tambi\u00e9n evita que kmemleak detecte la fuga, ya que la API devm almacena internamente el puntero asignado. Solucione esto reemplazando devm_kzalloc/devm_kcalloc con kzalloc/kcalloc est\u00e1ndar y agregue las llamadas kfree correspondientes en la ruta de anulaci\u00f3n de registro.\"}],\"metrics\":{},\"references\":[{\"url\":\"https://git.kernel.org/stable/c/41143e71052a00d654c15dc924fda50c1e7357d0\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\"},{\"url\":\"https://git.kernel.org/stable/c/618541a6cc1511064dfa58c89b3445e21844092f\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\"},{\"url\":\"https://git.kernel.org/stable/c/663c3da86e807c6c07ed48f911c7526fad6fe1ff\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\"},{\"url\":\"https://git.kernel.org/stable/c/7f3d5880800f962c347777c4f8358f29f5fc403c\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\"},{\"url\":\"https://git.kernel.org/stable/c/95bed65cc0eb2a610550abf849a8b94374da80a7\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\"},{\"url\":\"https://git.kernel.org/stable/c/966d6494e2ed9be9052fcd9815afba830896aaf8\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\"},{\"url\":\"https://git.kernel.org/stable/c/b7f0ee992adf601aa00c252418266177eb7ac2bc\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\"},{\"url\":\"https://git.kernel.org/stable/c/f41f097f68a33d392579885426d0734a81219501\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\"}]}}"
  }
}


Log in or create an account to share your comment.




Tags
Taxonomy of the tags.


Loading…

Loading…

Loading…

Sightings

Author Source Type Date

Nomenclature

  • Seen: The vulnerability was mentioned, discussed, or seen somewhere by the user.
  • Confirmed: The vulnerability is confirmed from an analyst perspective.
  • Exploited: This vulnerability was exploited and seen by the user reporting the sighting.
  • Patched: This vulnerability was successfully patched by the user reporting the sighting.
  • Not exploited: This vulnerability was not exploited or seen by the user reporting the sighting.
  • Not confirmed: The user expresses doubt about the veracity of the vulnerability.
  • Not patched: This vulnerability was not successfully patched by the user reporting the sighting.


Loading…

Loading…