usb: gadget: configfs: Prevent OOB read/write in usb_string_copy()
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ 88af8bbe4ef781031ad3370847553f3b42ba0076 · < d1205033e912f9332c1dbefa812e6ceb0575ce0a| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
usb: gadget: configfs: Prevent OOB read/write in usb_string_copy()
Userspace provided string 's' could trivially have the length zero. Left unchecked this will firstly result in an OOB read in the form `if (str[0 - 1] == '\n') followed closely by an OOB write in the form `str[0 - 1] = '\0'`.
There is already a validating check to catch strings that are too long. Let's supply an additional check for invalid strings that are too short.
From the CVE record · Linux
The Linux kernel’s USB gadget configfs code does not reject a zero-length userspace string in usb_string_copy(). A local user able to provide that string can trigger an out-of-bounds read and write; the input does not specify authentication requirements or any additional user interaction.
Engineers running Linux kernels with USB gadget configfs should check their deployments; affected versions are not specified.