Lucene search

K
vulnrichmentLinuxVULNRICHMENT:CVE-2024-35986
HistoryMay 20, 2024 - 9:47 a.m.

CVE-2024-35986 phy: ti: tusb1210: Resolve charger-det crash if charger psy is unregistered

2024-05-2009:47:53
Linux
github.com
linux kernel
vulnerability
power_supply framework
kernel references
crash
charger-det
dangling reference
tusb1210
race window
rmmod-ing

6.9 Medium

AI Score

Confidence

Low

0.0004 Low

EPSS

Percentile

15.6%

In the Linux kernel, the following vulnerability has been resolved:

phy: ti: tusb1210: Resolve charger-det crash if charger psy is unregistered

The power_supply frame-work is not really designed for there to be
long living in kernel references to power_supply devices.

Specifically unregistering a power_supply while some other code has
a reference to it triggers a WARN in power_supply_unregister():

WARN_ON(atomic_dec_return(&psy->use_cnt));

Folllowed by the power_supply still getting removed and the
backing data freed anyway, leaving the tusb1210 charger-detect code
with a dangling reference, resulting in a crash the next time
tusb1210_get_online() is called.

Fix this by only holding the reference in tusb1210_get_online()
freeing it at the end of the function. Note this still leaves
a theoretical race window, but it avoids the issue when manually
rmmod-ing the charger chip driver during development.

CNA Affected

[
  {
    "product": "Linux",
    "vendor": "Linux",
    "defaultStatus": "unaffected",
    "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
    "programFiles": [
      "drivers/phy/ti/phy-tusb1210.c"
    ],
    "versions": [
      {
        "version": "48969a5623ed",
        "lessThan": "25b3498485ac",
        "status": "affected",
        "versionType": "git"
      },
      {
        "version": "48969a5623ed",
        "lessThan": "73224a5d2180",
        "status": "affected",
        "versionType": "git"
      },
      {
        "version": "48969a5623ed",
        "lessThan": "9827caa5105f",
        "status": "affected",
        "versionType": "git"
      },
      {
        "version": "48969a5623ed",
        "lessThan": "bf6e4ee5c436",
        "status": "affected",
        "versionType": "git"
      }
    ]
  },
  {
    "product": "Linux",
    "vendor": "Linux",
    "defaultStatus": "affected",
    "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
    "programFiles": [
      "drivers/phy/ti/phy-tusb1210.c"
    ],
    "versions": [
      {
        "version": "5.18",
        "status": "affected"
      },
      {
        "version": "0",
        "lessThan": "5.18",
        "status": "unaffected",
        "versionType": "custom"
      },
      {
        "version": "6.1.90",
        "lessThanOrEqual": "6.1.*",
        "status": "unaffected",
        "versionType": "custom"
      },
      {
        "version": "6.6.30",
        "lessThanOrEqual": "6.6.*",
        "status": "unaffected",
        "versionType": "custom"
      },
      {
        "version": "6.8.9",
        "lessThanOrEqual": "6.8.*",
        "status": "unaffected",
        "versionType": "custom"
      },
      {
        "version": "6.9",
        "lessThanOrEqual": "*",
        "status": "unaffected",
        "versionType": "original_commit_for_fix"
      }
    ]
  }
]

6.9 Medium

AI Score

Confidence

Low

0.0004 Low

EPSS

Percentile

15.6%

Related for VULNRICHMENT:CVE-2024-35986