lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Sat, 13 Nov 2010 23:15:16 +0100
From:	Németh Márton <nm127@...email.hu>
To:	Greg Kroah-Hartman <gregkh@...e.de>,
	Pete Zaitcev <zaitcev@...hat.com>
CC:	linux-usb@...r.kernel.org, LKML <linux-kernel@...r.kernel.org>
Subject: [PATCH, RFC] usbmon: correct computing of the ISO packets with mmap

From: Márton Németh <nm127@...email.hu>

The length of the isochronous packets were not computed correctly in case of memory
mapped operation because the gaps between the isodesc data were not taken into
account. The last data byte can be found at offset+actual_length of the
last ISO description.

This patch fixes the problem described at https://bugzilla.kernel.org/show_bug.cgi?id=22182 .

Signed-off-by: Márton Németh <nm127@...email.hu>
---
--- linux-2.6.37-rc1/drivers/usb/mon/mon_bin.c.orig	2010-10-20 22:30:22.000000000 +0200
+++ linux-2.6.37-rc1/drivers/usb/mon/mon_bin.c	2010-11-13 22:29:09.000000000 +0100
@@ -515,6 +515,26 @@ static void mon_bin_event(struct mon_rea
 	}

 	if (rp->mmap_active) {
+		if (usb_endpoint_xfer_isoc(epd) &&
+		    ((usb_urb_dir_in(urb) && ev_type == 'C') ||
+		     (usb_urb_dir_out(urb) && ev_type == 'S'))) {
+			int i;
+
+			/* Search for the last ISO descritor with OK status
+			 * and non-zero length
+			 */
+			length = 0;
+			i = urb->number_of_packets - 1;
+			while (0 <= i &&
+			       (urb->iso_frame_desc[i].status != 0 ||
+			        urb->iso_frame_desc[i].actual_length == 0)) {
+				i--;
+			}
+			if (0 <= i) {
+				length = urb->iso_frame_desc[i].offset +
+					 urb->iso_frame_desc[i].actual_length;
+			}
+		}
 		offset = mon_buff_area_alloc_contiguous(rp,
 						 length + PKT_SIZE + lendesc);
 	} else {

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ