linux/drivers/staging
Johan Hovold 33d7a47073 comedi: vmk80xx: fix transfer-buffer overflows
commit a23461c474 upstream.

The driver uses endpoint-sized USB transfer buffers but up until
recently had no sanity checks on the sizes.

Commit e1f13c879a ("staging: comedi: check validity of wMaxPacketSize
of usb endpoints found") inadvertently fixed NULL-pointer dereferences
when accessing the transfer buffers in case a malicious device has a
zero wMaxPacketSize.

Make sure to allocate buffers large enough to handle also the other
accesses that are done without a size check (e.g. byte 18 in
vmk80xx_cnt_insn_read() for the VMK8061_MODEL) to avoid writing beyond
the buffers, for example, when doing descriptor fuzzing.

The original driver was for a low-speed device with 8-byte buffers.
Support was later added for a device that uses bulk transfers and is
presumably a full-speed device with a maximum 64-byte wMaxPacketSize.

Fixes: 985cafccbf ("Staging: Comedi: vmk80xx: Add k8061 support")
Cc: stable@vger.kernel.org      # 2.6.31
Signed-off-by: Johan Hovold <johan@kernel.org>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Link: https://lore.kernel.org/r/20211025114532.4599-4-johan@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-11-12 14:58:34 +01:00
..
android
axis-fifo
board staging: board: Fix uninitialized spinlock when attaching genpd 2021-09-18 13:40:20 +02:00
clocking-wizard clk: staging: correct reference to config IOMEM to config HAS_IOMEM 2021-09-15 09:50:41 +02:00
comedi comedi: vmk80xx: fix transfer-buffer overflows 2021-11-12 14:58:34 +01:00
emxx_udc staging: emxx_udc: fix loop in _nbu2ss_nuke() 2021-06-03 09:00:49 +02:00
fbtft staging: fbtft: Don't spam logs when probe is deferred 2021-07-14 16:56:32 +02:00
fieldbus
fsl-dpaa2
fwserial staging: fwserial: fix TIOCGSERIAL implementation 2021-05-14 09:50:15 +02:00
gasket
gdm724x staging: gdm724x: check for overflow in gdm_lte_netif_rx() 2021-07-14 16:56:45 +02:00
goldfish
greybus staging: greybus: uart: fix tty use after free 2021-09-30 10:10:59 +02:00
gs_fpgaboot
hikey9xx
iio staging: iio: cdc: ad7746: avoid overwrite of num_channels 2021-06-03 09:00:32 +02:00
kpc2000
ks7010 staging: ks7010: Fix the initialization of the 'sleep_status' structure 2021-09-18 13:40:23 +02:00
media media: atomisp: pci: fix error return code in atomisp_pci_probe() 2021-09-18 13:40:20 +02:00
most staging: most: sound: add sanity check for function argument 2021-03-07 12:34:10 +01:00
mt7621-dma
mt7621-dts staging: mt7621-dts: fix pci address for PCI memory range 2021-07-14 16:56:46 +02:00
mt7621-pci
mt7621-pci-phy
mt7621-pinctrl pinctrl: ralink: rt2880: avoid to error in calls is pin is already enabled 2021-06-23 14:42:49 +02:00
netlogic
nvec
octeon
octeon-usb
olpc_dcon
pi433
qlge
ralink-gdma
rtl8188eu staging: rtl8188eu: fix potential memory corruption in rtw_check_beacon_data() 2021-03-17 17:06:31 +01:00
rtl8192e staging: rtl8192e: Change state information from u16 to u8 2021-04-07 15:00:13 +02:00
rtl8192u staging: rtl8192u: Fix bitwise vs logical operator in TranslateRxSignalStuff819xUsb() 2021-09-26 14:08:56 +02:00
rtl8712 staging: rtl8712: fix use-after-free in rtl8712_dl_fw 2021-11-12 14:58:33 +01:00
rtl8723bs staging: rtl8723bs: Fix a resource leak in sd_int_dpc 2021-08-12 13:22:13 +02:00
rts5208 staging: rts5208: Fix get_ms_information() heap buffer size 2021-09-18 13:40:30 +02:00
sm750fb
unisys
vc04_services staging: mmal-vchiq: Fix incorrect static vchiq_instance. 2021-07-14 16:56:39 +02:00
vme
vt6655
vt6656
wfx
wlan-ng
Kconfig
Makefile