diff options
author | Frode Isaksen <frode@meta.com> | 2025-04-03 09:28:03 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2025-04-11 16:26:20 +0200 |
commit | 63ccd26cd1f6600421795f6ca3e625076be06c9f (patch) | |
tree | 1f27125241227460625afcf56628358daf59716d /rust/helpers/helpers.c | |
parent | 9ab75eee1a056f896b87d139044dd103adc532b9 (diff) | |
download | linux-63ccd26cd1f6600421795f6ca3e625076be06c9f.tar.gz linux-63ccd26cd1f6600421795f6ca3e625076be06c9f.tar.bz2 linux-63ccd26cd1f6600421795f6ca3e625076be06c9f.zip |
usb: dwc3: gadget: check that event count does not exceed event buffer length
The event count is read from register DWC3_GEVNTCOUNT.
There is a check for the count being zero, but not for exceeding the
event buffer length.
Check that event count does not exceed event buffer length,
avoiding an out-of-bounds access when memcpy'ing the event.
Crash log:
Unable to handle kernel paging request at virtual address ffffffc0129be000
pc : __memcpy+0x114/0x180
lr : dwc3_check_event_buf+0xec/0x348
x3 : 0000000000000030 x2 : 000000000000dfc4
x1 : ffffffc0129be000 x0 : ffffff87aad60080
Call trace:
__memcpy+0x114/0x180
dwc3_interrupt+0x24/0x34
Signed-off-by: Frode Isaksen <frode@meta.com>
Fixes: 72246da40f37 ("usb: Introduce DesignWare USB3 DRD Driver")
Cc: stable <stable@kernel.org>
Acked-by: Thinh Nguyen <Thinh.Nguyen@synopsys.com>
Link: https://lore.kernel.org/r/20250403072907.448524-1-fisaksen@baylibre.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'rust/helpers/helpers.c')
0 files changed, 0 insertions, 0 deletions