diff options
| author | Hyunjung Ko <hj351016@gmail.com> | 2026-11-17 19:41:10 +0900 |
|---|---|---|
| committer | Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com> | 2026-11-19 11:33:36 +0100 |
| commit | f94f85f82e042c89a1e64ed3ff1d591a2bccfa7b (patch) | |
| tree | 25b32af4a27777f68b90c3bf19e1a3827f261fff /kernel/debug/debug_core.h | |
| parent | e6e2181c6920ff59ded349a100f80cf85d074601 (diff) | |
gpio: mpsse: reject bulk-in endpoints smaller than 3 bytes
mpsse_read() reads min(len + 2, wMaxPacketSize) bytes and then copies
len_actual - 2 bytes to the caller. A device that declares a bulk-in
endpoint with wMaxPacketSize 1 completes the read with len_actual 1, so
the copy length becomes -1 and memcpy() runs far past the one byte
buffer on the caller's stack and past bulk_in_buf:
memcpy: detected buffer overflow: 18446744073709551615 byte write of buffer size 1
WARNING: lib/string_helpers.c:1036 at __fortify_report+0x6e/0xc0
Call Trace:
__fortify_panic+0xd/0x10
gpio_mpsse_get_multiple+0x767/0x780
gpio_mpsse_gpio_get+0xa2/0xf0
gpiod_get_raw_value_commit+0xf8/0x1f0
gpiod_get_value_cansleep+0x1e/0xa0
value_show+0x42/0x90
Reproduced with dummy_hcd and raw-gadget. A read needs room for the two
status bytes plus at least one data byte, so refuse to bind otherwise.
Fixes: c46a74ff05c0 ("gpio: add support for FTDI's MPSSE as GPIO")
Cc: stable@vger.kernel.org
Signed-off-by: Hyunjung Ko <hj351016@gmail.com>
Link: https://patch.msgid.link/20261117104110.240112-1-hj351016@gmail.com
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
Diffstat (limited to 'kernel/debug/debug_core.h')
0 files changed, 0 insertions, 0 deletions
