usb: storage: realtek_cr: fix use-after-free on disconnect
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ e931830bb877e2aad9a1be83506f9bdb26c91e4e · < cae9dbba6adae21a04a3bd045e07b489847ff2c6| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
usb: storage: realtek_cr: fix use-after-free on disconnect
realtek_cr_destructor() calls timer_delete() before the chip containing the timer is freed. The timer callback may still be running and can rearm itself, resulting in a use-after-free.
Use timer_shutdown_sync() to wait for the callback and prevent further rearming. Do this unconditionally because ss_en may be changed after the timer is armed.
Move timer_setup() into init_realtek_cr() so the timer is initialized before any failure path can invoke the destructor.
Found by static analysis.
From the CVE record · Linux
The Linux kernel's Realtek USB storage driver has a use-after-free condition when a timer callback continues running or rearms itself during device disconnect. The input does not establish whether an attacker can trigger it, or whether authentication or user interaction is required.
Engineers running the Linux kernel should check whether their kernel includes the affected Realtek USB storage driver; affected versions were not specified.