Skip to contentSkip to conversation

usb: fix slab-use-after-free Read in hdm_disconnect

PATCH New Camila Alvarez 1 participant 1 message Jul 30, 2024 Most(r) technology driver

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 usb: fix slab-use-after-free Read in hdm_disconnect

All references on the device were lost when deregistering the interface. To make sure the device is not released before freeing all the memory we add get_device to increase the ref count by one.

---
 drivers/most/most_usb.c | 1 +
 1 file changed, 1 insertion(+)
drivers/most/most_usb.c +1 -0
index 485d5ca39951..e178a5a0d3aa 100644
@@ -1120,6 +1120,7 @@ static void hdm_disconnect(struct usb_interface *interface)
 
 	if (mdev->dci)
 		device_unregister(&mdev->dci->dev);
+	get_device(&mdev->dev);
 	most_deregister_interface(&mdev->iface);
 
 	kfree(mdev->busy_urbs);
Signature · 1 line
2.34.1