{"api_version":"1","generated_at":"2026-12-02T02:26:48+00:00","cve":"CVE-2026-138844","urls":{"html":"https://cve.report/CVE-2026-138844","api":"https://cve.report/api/cve/CVE-2026-138844.json","docs":"https://cve.report/api","cve_org":"https://www.cve.org/CVERecord?id=CVE-2026-138844","nvd":"https://nvd.nist.gov/vuln/detail/CVE-2026-138844"},"summary":{"title":"usb: core: don't set drvdata to NULL in usb_unbind_interface()","description":"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(&intf->dev, sizeof(*data), GFP_KERNEL);\n\t\tif (!data)\n\t\t\treturn -ENOMEM;\n\n\t\tret = devm_device_add_group(&intf->dev, &foo_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->value);\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.","state":"PUBLISHED","assigner":"Linux","published_at":"2026-11-30 14:17:39","updated_at":"2026-11-30 14:17:39"},"problem_types":[],"metrics":[],"references":[{"url":"https://git.kernel.org/stable/c/c460161d08103ee44c670e94da8c3c70ae82f4be","name":"https://git.kernel.org/stable/c/c460161d08103ee44c670e94da8c3c70ae82f4be","refsource":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","tags":[],"title":"","mime":"","httpstatus":"","archivestatus":"0"},{"url":"https://git.kernel.org/stable/c/8f0d16174102863936d583c90258ea02bf06205c","name":"https://git.kernel.org/stable/c/8f0d16174102863936d583c90258ea02bf06205c","refsource":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","tags":[],"title":"","mime":"","httpstatus":"","archivestatus":"0"},{"url":"https://www.cve.org/CVERecord?id=CVE-2026-138844","name":"CVE Program record","refsource":"CVE.ORG","tags":["canonical"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-138844","name":"NVD vulnerability detail","refsource":"NVD","tags":["canonical","analysis"]}],"affected":[{"source":"CNA","vendor":"Linux","product":"Linux","version":"affected a995fe1a3aa78b7d06cc1cc7b6b8436c5e93b07f c460161d08103ee44c670e94da8c3c70ae82f4be git","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"affected a995fe1a3aa78b7d06cc1cc7b6b8436c5e93b07f 8f0d16174102863936d583c90258ea02bf06205c git","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"affected 6.19","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"unaffected 6.19 semver","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"unaffected 7.3.4 7.3.* semver","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"unaffected 7.4-rc1 * original_commit_for_fix","platforms":[]}],"timeline":[],"solutions":[],"workarounds":[],"exploits":[],"credits":[],"nvd_cpes":[],"vendor_comments":[],"enrichments":{"kev":null,"epss":null,"legacy_qids":[]},"source_records":{"cve_program":{"containers":{"cna":{"affected":[{"defaultStatus":"unaffected","product":"Linux","programFiles":["drivers/usb/core/driver.c"],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","vendor":"Linux","versions":[{"lessThan":"c460161d08103ee44c670e94da8c3c70ae82f4be","status":"affected","version":"a995fe1a3aa78b7d06cc1cc7b6b8436c5e93b07f","versionType":"git"},{"lessThan":"8f0d16174102863936d583c90258ea02bf06205c","status":"affected","version":"a995fe1a3aa78b7d06cc1cc7b6b8436c5e93b07f","versionType":"git"}]},{"defaultStatus":"affected","product":"Linux","programFiles":["drivers/usb/core/driver.c"],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","vendor":"Linux","versions":[{"status":"affected","version":"6.19"},{"lessThan":"6.19","status":"unaffected","version":"0","versionType":"semver"},{"lessThanOrEqual":"7.3.*","status":"unaffected","version":"7.3.4","versionType":"semver"},{"lessThanOrEqual":"*","status":"unaffected","version":"7.4-rc1","versionType":"original_commit_for_fix"}]}],"cpeApplicability":[{"nodes":[{"cpeMatch":[{"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionEndExcluding":"7.3.4","versionStartIncluding":"6.19","vulnerable":true},{"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionEndExcluding":"7.4-rc1","versionStartIncluding":"6.19","vulnerable":true}],"negate":false,"operator":"OR"}]}],"descriptions":[{"lang":"en","value":"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(&intf->dev, sizeof(*data), GFP_KERNEL);\n\t\tif (!data)\n\t\t\treturn -ENOMEM;\n\n\t\tret = devm_device_add_group(&intf->dev, &foo_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->value);\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."}],"providerMetadata":{"dateUpdated":"2026-11-30T13:25:30.613Z","orgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","shortName":"Linux"},"references":[{"url":"https://git.kernel.org/stable/c/c460161d08103ee44c670e94da8c3c70ae82f4be"},{"url":"https://git.kernel.org/stable/c/8f0d16174102863936d583c90258ea02bf06205c"}],"title":"usb: core: don't set drvdata to NULL in usb_unbind_interface()","x_generator":{"engine":"bippy-1.2.0"}}},"cveMetadata":{"assignerOrgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","assignerShortName":"Linux","cveId":"CVE-2026-138844","datePublished":"2026-11-30T13:25:30.613Z","dateReserved":"2026-11-30T13:22:15.898Z","dateUpdated":"2026-11-30T13:25:30.613Z","state":"PUBLISHED"},"dataType":"CVE_RECORD","dataVersion":"5.2"},"nvd":{"publishedDate":"2026-11-30 14:17:39","lastModifiedDate":"2026-11-30 14:17:39","problem_types":[],"metrics":[],"configurations":[]},"legacy_mitre":{"record":{"CveYear":"2026","CveId":"138844","Ordinal":"1","Title":"usb: core: don't set drvdata to NULL in usb_unbind_interface()","CVE":"CVE-2026-138844","Year":"2026"},"notes":[{"CveYear":"2026","CveId":"138844","Ordinal":"1","NoteData":"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(&intf->dev, sizeof(*data), GFP_KERNEL);\n\t\tif (!data)\n\t\t\treturn -ENOMEM;\n\n\t\tret = devm_device_add_group(&intf->dev, &foo_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->value);\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.","Type":"Description","Title":"usb: core: don't set drvdata to NULL in usb_unbind_interface()"}]}}}