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-next>] [day] [month] [year] [list]
Message-ID: <87y7i5evv4.fsf@p4.be.48ers.dk>
Date:	Wed, 27 Jun 2007 08:48:15 +0200
From:	Peter Korsgaard <jacmet@...site.dk>
To:	netdev@...r.kernel.org, jeff@...zik.org
Cc:	david-b@...bell.net
Subject: [PATCH] usbnet: Zero padding byte if there is tail room in skb

Usbnet adds a padding byte if a 0 byte USB packet would be sent. Zero
padding byte if there is tail room in skb.

Signed-of-by: Peter Korsgaard <jacmet@...site.dk>
Acked-by: David Brownell <dbrownell@...rs.sourceforge.net>

---
 drivers/net/usb/usbnet.c |    9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

Index: linux-2.6.22-rc6/drivers/net/usb/usbnet.c
===================================================================
--- linux-2.6.22-rc6.orig/drivers/net/usb/usbnet.c
+++ linux-2.6.22-rc6/drivers/net/usb/usbnet.c
@@ -953,11 +953,14 @@
 	/* don't assume the hardware handles USB_ZERO_PACKET
 	 * NOTE:  strictly conforming cdc-ether devices should expect
 	 * the ZLP here, but ignore the one-byte packet.
-	 *
-	 * FIXME zero that byte, if it doesn't require a new skb.
 	 */
-	if ((length % dev->maxpacket) == 0)
+	if ((length % dev->maxpacket) == 0) {
 		urb->transfer_buffer_length++;
+		if (skb_tailroom(skb)) {
+			skb->data[skb->len] = 0;
+			__skb_put(skb, 1);
+		}
+	}
 
 	spin_lock_irqsave (&dev->txq.lock, flags);

-- 
Bye, Peter Korsgaard

-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ