CVE-2026-138844: usb: core: don't set drvdata to NULL in usb_unbind_interface()

Published Nov 30, 2026
·
Updated

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

usb: core: don't set drvdata to NULL in usbunbindinterface()

usbunbindinterface() serves as the remove() callback of struct usbdriver and calls usbsetintfdata(intf, NULL) to clear the bus device private data pointer.

However, the driver core code already sets the bus device private data pointer to NULL in deviceunbindcleanup() after devresreleaseall(), which makes the call redundant.

In addition, it can create unexpected NULL pointer dereference scenarios when drivers use managed APIs.

int probe(struct usbinterface intf, const struct usbdeviceid id) { struct data data; int ret;

data = devmkzalloc(&intf->dev, sizeof(data), GFPKERNEL); if (!data) return -ENOMEM;

ret = devmdeviceaddgroup(&intf->dev, &fooattrgroup); if (ret) return ret;

... }

ssizet foovalueshow(struct device dev, struct deviceattribute attr, char buf) { struct usbinterface intf = tousbinterface(dev); struct data data = usbgetintfdata(intf);

/ Potential NULL pointer dereference / return sysfsemit(buf, "%u\n", data->value); }

Nothing prevents usbunbindinterface() to race with foovalueshow() and set usbsetintfdata(intf, NULL).

The same applies to the unwind path of usbprobeinterface(), which also calls usbsetintfdata(intf, NULL).

Besides that, the Rust driver core code manages a driver's bus device private data and destroys it in deviceunbindcleanup().

If usbunbindinterface() sets the pointer to NULL prematurely, the Rust driver core code sees NULL, and hence skips the destructor of the bus device private data, which leaks all its resources.

Thus, drop usbsetintfdata(intf, NULL) from usbprobeinterface() and usbunbindinterface(), and move it to usbdriverreleaseinterface(), which manually calls the remove() callback of struct usbdriver and hence can't rely on the driver core.

Affected Software

1 affected component
Linux Linux kernel

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Compensating control

    Do not clear the USB interface driver data in usb_unbind_interface(); move usb_set_intfdata(intf, NULL) to usb_driver_release_interface().

Event History

Nov 30, 2026
CVE Published
via MITRE·01:25 PM
Data Sourced
via MITRE·01:25 PM
Description

Frequently Asked Questions

1

Which drivers are exposed to the NULL dereference race?

The issue affects USB interface drivers that use managed APIs and have callbacks, such as sysfs attribute handlers, that retrieve driver state with usb_get_intfdata(). A callback can observe a NULL pointer if it runs while the interface is being unbound.

2

What must occur for the failure to happen?

usb_unbind_interface() must race with a handler that reads the interface private-data pointer. In the example, foo_value_show() reads usb_get_intfdata() after unbind has cleared it, then dereferences the resulting NULL data pointer.

3

How can I assess whether a driver is affected?

Review USB interface driver callbacks that call usb_get_intfdata(), especially sysfs handlers backed by managed resources. They are potentially affected if they can execute concurrently with interface removal or unbinding and dereference the returned pointer without handling NULL.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203