usb: gadget: u_serial: Add null pointer check in gserial_resume
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
| No fix yet |
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
usb: gadget: u_serial: Add null pointer check in gserial_resume
Consider a case where gserial_disconnect has already cleared gser->ioport. And if a wakeup interrupt triggers afterwards, gserial_resume gets called, which will lead to accessing of gser->ioport and thus causing null pointer dereference.Add a null pointer check to prevent this.
Added a static spinlock to prevent gser->ioport from becoming null after the newly added check.
From the CVE record · Linux
The Linux kernel's USB gadget serial component can dereference a null pointer if a wakeup interrupt calls gserial_resume after gserial_disconnect has cleared gser->ioport. This can cause a kernel crash. The input does not specify whether an attacker needs local access, authentication, or user interaction to trigger it.
Engineers running Linux kernels with the USB gadget serial component should check their kernel versions; affected versions are not specified.