usb: gadget: f_printer: take kref only for successful open
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ e8d5f92b8d30bb4ade76494490c3c065e12411b1 · < 7f1f24c367938c5537e2308bf9a965f051d14774| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
usb: gadget: f_printer: take kref only for successful open
printer_open() returns -EBUSY when the character device is already open, but it increments dev->kref regardless of the return value. VFS does not call ->release() for a failed open, so every rejected second open permanently leaks one reference.
Move kref_get() into the successful-open branch.
From the CVE record · Linux
The Linux kernel USB gadget printer function leaks a reference when its character device is opened while already in use. A local user who can open the device can trigger the leak through repeated rejected opens; the input does not specify whether authentication is required.
Check Linux kernel installations that use the USB gadget printer function; affected versions are not specified.