Patch "comedi: vmk80xx: fix bulk-buffer overflow" has been added to the 4.4-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    comedi: vmk80xx: fix bulk-buffer overflow

to the 4.4-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     comedi-vmk80xx-fix-bulk-buffer-overflow.patch
and it can be found in the queue-4.4 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.


>From 78cdfd62bd54af615fba9e3ca1ba35de39d3871d Mon Sep 17 00:00:00 2001
From: Johan Hovold <johan@xxxxxxxxxx>
Date: Mon, 25 Oct 2021 13:45:31 +0200
Subject: comedi: vmk80xx: fix bulk-buffer overflow

From: Johan Hovold <johan@xxxxxxxxxx>

commit 78cdfd62bd54af615fba9e3ca1ba35de39d3871d upstream.

The driver is using endpoint-sized buffers but must not assume that the
tx and rx buffers are of equal size or a malicious device could overflow
the slab-allocated receive buffer when doing bulk transfers.

Fixes: 985cafccbf9b ("Staging: Comedi: vmk80xx: Add k8061 support")
Cc: stable@xxxxxxxxxxxxxxx      # 2.6.31
Signed-off-by: Johan Hovold <johan@xxxxxxxxxx>
Reviewed-by: Ian Abbott <abbotti@xxxxxxxxx>
Link: https://lore.kernel.org/r/20211025114532.4599-5-johan@xxxxxxxxxx
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
---
 drivers/staging/comedi/drivers/vmk80xx.c |   16 +++++++---------
 1 file changed, 7 insertions(+), 9 deletions(-)

--- a/drivers/staging/comedi/drivers/vmk80xx.c
+++ b/drivers/staging/comedi/drivers/vmk80xx.c
@@ -168,22 +168,20 @@ static void vmk80xx_do_bulk_msg(struct c
 	__u8 rx_addr;
 	unsigned int tx_pipe;
 	unsigned int rx_pipe;
-	size_t size;
+	size_t tx_size;
+	size_t rx_size;
 
 	tx_addr = devpriv->ep_tx->bEndpointAddress;
 	rx_addr = devpriv->ep_rx->bEndpointAddress;
 	tx_pipe = usb_sndbulkpipe(usb, tx_addr);
 	rx_pipe = usb_rcvbulkpipe(usb, rx_addr);
-
-	/*
-	 * The max packet size attributes of the K8061
-	 * input/output endpoints are identical
-	 */
-	size = usb_endpoint_maxp(devpriv->ep_tx);
+	tx_size = usb_endpoint_maxp(devpriv->ep_tx);
+	rx_size = usb_endpoint_maxp(devpriv->ep_rx);
 
 	usb_bulk_msg(usb, tx_pipe, devpriv->usb_tx_buf,
-		     size, NULL, devpriv->ep_tx->bInterval);
-	usb_bulk_msg(usb, rx_pipe, devpriv->usb_rx_buf, size, NULL, HZ * 10);
+		     tx_size, NULL, devpriv->ep_tx->bInterval);
+
+	usb_bulk_msg(usb, rx_pipe, devpriv->usb_rx_buf, rx_size, NULL, HZ * 10);
 }
 
 static int vmk80xx_read_packet(struct comedi_device *dev)


Patches currently in stable-queue which might be from johan@xxxxxxxxxx are

queue-4.4/comedi-ni_usb6501-fix-null-deref-in-command-paths.patch
queue-4.4/comedi-dt9812-fix-dma-buffers-on-stack.patch
queue-4.4/staging-r8712u-fix-control-message-timeout.patch
queue-4.4/comedi-vmk80xx-fix-bulk-buffer-overflow.patch
queue-4.4/comedi-vmk80xx-fix-transfer-buffer-overflows.patch
queue-4.4/comedi-vmk80xx-fix-bulk-and-interrupt-message-timeouts.patch
queue-4.4/rsi-fix-control-message-timeout.patch
queue-4.4/staging-rtl8192u-fix-control-message-timeouts.patch
queue-4.4/net-hso-register-netdev-later-to-avoid-a-race-condition.patch



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux