HID: cp2112: prevent a buffer overflow in cp2112_xfer()
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ 542134c0375b5ca2b1d18490c02b8a20bfdd8d74 · < 26e427ac85c2b8d0d108cc80b6de34d33e2780c4| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
HID: cp2112: prevent a buffer overflow in cp2112_xfer()
Smatch warnings: drivers/hid/hid-cp2112.c:793 cp2112_xfer() error: __memcpy() 'data->block[1]' too small (33 vs 255) drivers/hid/hid-cp2112.c:793 cp2112_xfer() error: __memcpy() 'buf' too small (64 vs 255)
The 'read_length' variable is provided by 'data->block[0]' which comes from user and it(read_length) can take a value between 0-255. Add an upper bound to 'read_length' variable to prevent a buffer overflow in memcpy().
From the CVE record · Linux
The Linux kernel HID cp2112 driver does not bound a user-provided read length in cp2112_xfer(). A local user can supply an oversized value that causes a buffer overflow during memcpy(); authentication requirements are not specified.
Engineers running Linux kernels with the HID cp2112 driver should check their kernel version; affected versions are not specified.