{
  "affected": [
    {
      "ranges": [
        {
          "events": [
            {
              "introduced": "a995fe1a3aa78b7d06cc1cc7b6b8436c5e93b07f"
            },
            {
              "fixed": "c460161d08103ee44c670e94da8c3c70ae82f4be"
            },
            {
              "fixed": "8f0d16174102863936d583c90258ea02bf06205c"
            }
          ],
          "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
          "type": "GIT"
        }
      ]
    },
    {
      "package": {
        "ecosystem": "Linux",
        "name": "Kernel"
      },
      "ranges": [
        {
          "events": [
            {
              "introduced": "6.19.0"
            },
            {
              "fixed": "7.3.4"
            }
          ],
          "type": "ECOSYSTEM"
        }
      ]
    }
  ],
  "database_specific": {
    "cna_assigner": "Linux",
    "osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/138xxx/CVE-2026-138844.json"
  },
  "details": "In the Linux kernel, the following vulnerability has been resolved:\n\nusb: core: don't set drvdata to NULL in usb_unbind_interface()\n\nusb_unbind_interface() serves as the remove() callback of struct\nusb_driver and calls usb_set_intfdata(intf, NULL) to clear the bus\ndevice private data pointer.\n\nHowever, the driver core code already sets the bus device private data\npointer to NULL in device_unbind_cleanup() *after* devres_release_all(),\nwhich makes the call redundant.\n\nIn addition, it can create unexpected NULL pointer dereference scenarios\nwhen drivers use managed APIs.\n\n\tint probe(struct usb_interface *intf,\n\t\t  const struct usb_device_id *id)\n\t{\n\t\tstruct data *data;\n\t\tint ret;\n\n\t\tdata = devm_kzalloc(\u0026intf-\u003edev, sizeof(*data), GFP_KERNEL);\n\t\tif (!data)\n\t\t\treturn -ENOMEM;\n\n\t\tret = devm_device_add_group(\u0026intf-\u003edev, \u0026foo_attr_group);\n\t\tif (ret)\n\t\t\treturn ret;\n\n\t\t...\n\t}\n\n\tssize_t foo_value_show(struct device *dev, struct device_attribute *attr,\n\t\t\t       char *buf)\n\t{\n\t\tstruct usb_interface *intf = to_usb_interface(dev);\n\t\tstruct data *data = usb_get_intfdata(intf);\n\n\t\t/* Potential NULL pointer dereference */\n\t\treturn sysfs_emit(buf, \"%u\\n\", data-\u003evalue);\n\t}\n\nNothing prevents usb_unbind_interface() to race with foo_value_show()\nand set usb_set_intfdata(intf, NULL).\n\nThe same applies to the unwind path of usb_probe_interface(), which also\ncalls usb_set_intfdata(intf, NULL).\n\nBesides that, the Rust driver core code manages a driver's bus device\nprivate data and destroys it in device_unbind_cleanup().\n\nIf usb_unbind_interface() sets the pointer to NULL prematurely, the Rust\ndriver core code sees NULL, and hence skips the destructor of the bus\ndevice private data, which leaks all its resources.\n\nThus, drop usb_set_intfdata(intf, NULL) from usb_probe_interface() and\nusb_unbind_interface(), and move it to usb_driver_release_interface(),\nwhich manually calls the remove() callback of struct usb_driver and\nhence can't rely on the driver core.",
  "id": "CVE-2026-138844",
  "modified": "2026-12-01T20:45:19.542117974Z",
  "published": "2026-11-30T13:25:30.613Z",
  "references": [
    {
      "type": "WEB",
      "url": "https://git.kernel.org/stable/c/8f0d16174102863936d583c90258ea02bf06205c"
    },
    {
      "type": "WEB",
      "url": "https://git.kernel.org/stable/c/c460161d08103ee44c670e94da8c3c70ae82f4be"
    },
    {
      "type": "ADVISORY",
      "url": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/138xxx/CVE-2026-138844.json"
    },
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-138844"
    },
    {
      "type": "PACKAGE",
      "url": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git"
    }
  ],
  "schema_version": "1.9.2",
  "summary": "usb: core: don't set drvdata to NULL in usb_unbind_interface()"
}