USB: ldusb: fix use-after-free on disconnect race
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ ce0d7d3f575fc1ba6a89c3c651e710355590daff · < 2107a4fc8ff1cf1d52f416c1e5cc8e97413a5915| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
USB: ldusb: fix use-after-free on disconnect race
mutex_unlock() may access the mutex structure after releasing the lock and therefore cannot be used to manage lifetime of objects directly (unlike spinlocks and refcounts). [1][2]
Use a kref to release the driver data to avoid use-after-free in mutex_unlock() when release() races with disconnect().
[1] a51749ab34d9 ("locking/mutex: Document that mutex_unlock() is non-atomic") [2] 2b9d9e0a9ba0 ("locking/mutex: Clarify that mutex_unlock(), and most other sleeping locks, can still use the lock object after it's unlocked")
From the CVE record · Linux
The Linux kernel's USB ldusb driver has a use-after-free when release() races with disconnect() and mutex_unlock() accesses freed driver data. This race can trigger a use-after-free; the input does not specify attacker access requirements or user interaction.
Anyone running a Linux kernel with the USB ldusb driver should check whether their version is affected; affected versions are not listed.