diff options
| author | Chen Yufeng <[email protected]> | 2025-04-15 06:58:57 +0000 |
|---|---|---|
| committer | Greg Kroah-Hartman <[email protected]> | 2025-04-15 12:29:33 +0000 |
| commit | 153874010354d050f62f8ae25cbb960c17633dc5 (patch) | |
| tree | e817ee9b18268cbb399dcf69867393efa8a6abc9 /drivers/fpga/tests/fpga-bridge-test.c | |
| parent | usb: dwc3: qcom: Transition to flattened model (diff) | |
| download | kernel-153874010354d050f62f8ae25cbb960c17633dc5.tar.gz kernel-153874010354d050f62f8ae25cbb960c17633dc5.zip | |
usb: potential integer overflow in usbg_make_tpg()
The variable tpgt in usbg_make_tpg() is defined as unsigned long and is
assigned to tpgt->tport_tpgt, which is defined as u16. This may cause an
integer overflow when tpgt is greater than USHRT_MAX (65535). I
haven't tried to trigger it myself, but it is possible to trigger it
by calling usbg_make_tpg() with a large value for tpgt.
I modified the type of tpgt to match tpgt->tport_tpgt and adjusted the
relevant code accordingly.
This patch is similar to commit 59c816c1f24d ("vhost/scsi: potential
memory corruption").
Signed-off-by: Chen Yufeng <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Diffstat (limited to 'drivers/fpga/tests/fpga-bridge-test.c')
0 files changed, 0 insertions, 0 deletions
