{
  "schema_version": "1.6.1",
  "id": "RPI-CVE-2024-35986",
  "modified": "2026-10-09T11:39:44Z",
  "upstream": [
    "CVE-2024-35986"
  ],
  "published": "2024-05-20T09:48:48Z",
  "summary": "phy: ti: tusb1210: Resolve charger-det crash if charger psy is unregistered",
  "details": "In the Linux kernel, the following vulnerability has been resolved:\n\nphy: ti: tusb1210: Resolve charger-det crash if charger psy is unregistered\n\nThe power_supply frame-work is not really designed for there to be\nlong living in kernel references to power_supply devices.\n\nSpecifically unregistering a power_supply while some other code has\na reference to it triggers a WARN in power_supply_unregister():\n\n\tWARN_ON(atomic_dec_return(&psy->use_cnt));\n\nFolllowed by the power_supply still getting removed and the\nbacking data freed anyway, leaving the tusb1210 charger-detect code\nwith a dangling reference, resulting in a crash the next time\ntusb1210_get_online() is called.\n\nFix this by only holding the reference in tusb1210_get_online()\nfreeing it at the end of the function. Note this still leaves\na theoretical race window, but it avoids the issue when manually\nrmmod-ing the charger chip driver during development.",
  "severity": [
    {
      "type": "CVSS_V3",
      "score": "CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H"
    }
  ],
  "affected": [
    {
      "package": {
        "ecosystem": "Raspberry Pi OS:12",
        "name": "linux"
      },
      "versions": [
        "1:6.1.47-1+rpt4"
      ],
      "ecosystem_specific": {
        "binaries": [
          {
            "binary_name": "linux-image-6.1.0-rpi3-rpi-2712",
            "binary_version": "1:6.1.47-1+rpt4"
          },
          {
            "binary_name": "linux-image-6.1.0-rpi3-rpi-v6",
            "binary_version": "1:6.1.47-1+rpt4"
          },
          {
            "binary_name": "linux-image-6.1.0-rpi3-rpi-v7",
            "binary_version": "1:6.1.47-1+rpt4"
          },
          {
            "binary_name": "linux-image-6.1.0-rpi3-rpi-v7l",
            "binary_version": "1:6.1.47-1+rpt4"
          },
          {
            "binary_name": "linux-image-6.1.0-rpi3-rpi-v8",
            "binary_version": "1:6.1.47-1+rpt4"
          }
        ]
      },
      "database_specific": {
        "per_version": {
          "1:6.1.47-1+rpt4": {
            "linux_commit": "655fc658a15ae7a6f37103754adb39ba52a9a14e",
            "upstream_version": "6.1.47",
            "assessment": "commit ancestry (strak rule)",
            "upstream_fixed": "6.1.90",
            "compiled_filter": false
          }
        }
      }
    }
  ],
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://www.cve.org/CVERecord?id=CVE-2024-35986"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/25b3498485ac281e5851700e33b97f12c9533fd8"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/73224a5d2180066c7fe05b4656647601ba08d588"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/9827caa5105fb16d1fae2e75c8d0e4662014b3ca"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/bf6e4ee5c43690e4c5a8a057bbcd4ff986bed052"
    }
  ],
  "database_specific": {
    "source": "https://git.kernel.org/pub/scm/linux/security/vulns.git",
    "upstream_modified": "2026-08-05T11:52:36Z",
    "severity": {
      "source": "kernel CNA",
      "cvss_v3_score": 7.0,
      "cvss_v3_severity": "High",
      "scenario": "AV:L - The dangling `power_supply` is dereferenced through a local sysfs read of the world-readable `/sys/class/power_supply/tusb1211-charger-detect/online` attribute, or by the driver's own workqueue; there is no network or remote-peer input involved.\nAC:H - The stale reference only becomes dangerous after the bq24190 charger psy is unregistered, which requires a driver unbind (0200 sysfs) or module removal (CAP_SYS_MODULE, unreachable via user namespaces) \u2014 a system state the unprivileged attacker cannot induce and must wait for.\nPR:L - Once the charger driver has been detached, any unprivileged local user can trigger the use-after-free by reading the 0444 `online` sysfs attribute exported by the tusb1211-charger-detect power supply.\nUI:N - No victim action is needed for the trigger itself \u2014 the attacker's own sysfs read reaches the freed object, and `tusb1210_chg_det_work` hits it autonomously on the next USB charger event.\nS:U - The dangling dereference and its consequences stay within the kernel's own security authority; no VM, IOMMU, or sandbox boundary is crossed.\nC:H - Use-after-free of the `bq24190_dev_info` object (and of the module-resident `power_supply_desc` after rmmod) lets an attacker who reclaims the freed slab/module memory steer reads through attacker-controlled pointers, with a value derived from freed memory returned to userspace via the `online` property.\nI:H - The freed object supplies the `desc->get_property` function pointer and the `bdi->dev`/`bdi->regmap` pointers used for subsequent writes, so heap spraying over the freed allocation yields control-flow hijack and write primitives.\nA:H - The unfixed path reliably oopses \u2014 the commit describes a crash on the next `tusb1210_get_online()` call, preceded by a `WARN_ON` in `power_supply_unregister()`."
    }
  }
}
