PT-2026-162704

CVE-2026-138844

·

Published

2026-11-30

·

Updated

2026-11-30

Description by

Score
N/A
Not available

No severity ratings or metrics are available. When they are, we'll update the corresponding info on the page.

In the Linux kernel, the following vulnerability has been resolved:
usb: core: don't set drvdata to NULL in usb unbind interface()
usb unbind interface() serves as the remove() callback of struct usb driver and calls usb set intfdata(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 device unbind cleanup() after devres release all(), which makes the call redundant.
In addition, it can create unexpected NULL pointer dereference scenarios when drivers use managed APIs.
int probe(struct usb interface *intf,
	 const struct usb device id *id)
{
	struct data *data;
	int ret;

	data = devm kzalloc(&intf->dev, sizeof(*data), GFP KERNEL);
	if (!data)
		return -ENOMEM;

	ret = devm device add group(&intf->dev, &foo attr group);
	if (ret)
		return ret;

	...
}

ssize t foo value show(struct device *dev, struct device attribute *attr,
		    char *buf)
{
	struct usb interface *intf = to usb interface(dev);
	struct data *data = usb get intfdata(intf);

	/* Potential NULL pointer dereference */
	return sysfs emit(buf, "%u
", data->value); }
Nothing prevents usb unbind interface() to race with foo value show() and set usb set intfdata(intf, NULL).
The same applies to the unwind path of usb probe interface(), which also calls usb set intfdata(intf, NULL).
Besides that, the Rust driver core code manages a driver's bus device private data and destroys it in device unbind cleanup().
If usb unbind interface() 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 usb set intfdata(intf, NULL) from usb probe interface() and usb unbind interface(), and move it to usb driver release interface(), which manually calls the remove() callback of struct usb driver and hence can't rely on the driver core.
Vendors
Affected products
Related identifiers
Found an issue in the description? Have something to add? Feel free to write us 👾