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>] [day] [month] [year] [list]
Date:	Tue, 09 Oct 2007 17:39:44 +0200
From:	Thomas Sailer <sailer@....ee.ethz.ch>
To:	netdev@...r.kernel.org
Cc:	linux-usb-devel@...ts.sourceforge.net, greg@...ah.com,
	David Brownell <david-b@...bell.net>
Subject: Re: [RESEND]: RNDIS host: adjust MTU instead of refusing to talk
	to devices with MTU < 1.5k

On Tue, 2007-10-09 at 08:18 -0700, David Brownell wrote:

> > This patch makes the host RNDIS driver talk to RNDIS devices with an MTU
> > less than 1.5k, instead of refusing to talk to such a device.
> > Please apply.
> >
> > Signed-Off-by: Thomas Sailer <t.sailer@...mni.ethz.ch>
> 
> Acked-by: David Brownell <dbrownell@...rs.sourceforge.net>
> 
> ... but patches in drivers/net go to netdev, not linux-usb-devel.
> And it'd be nice if the patch comment mentioned some particular
> device that's been observed to act this way.

Ok, next try.

The device in question is a low power radio device that speaks the
bpqether protocol over ethernet. bpqether frames are never longer than
320 bytes, so there is no need to support 1.5kbyte MTU in the device
firmware.

Tom

Signed-Off-by: Thomas Sailer <t.sailer@...mni.ethz.ch>

--- 1/drivers/net/usb/rndis_host.c.orig	2007-09-04 17:51:11.000000000 +0200
+++ 2/drivers/net/usb/rndis_host.c	2007-09-04 17:54:26.000000000 +0200
@@ -512,11 +512,18 @@
 	}
 	tmp = le32_to_cpu(u.init_c->max_transfer_size);
 	if (tmp < dev->hard_mtu) {
-		dev_err(&intf->dev,
-			"dev can't take %u byte packets (max %u)\n",
-			dev->hard_mtu, tmp);
-		retval = -EINVAL;
-		goto fail_and_release;
+		if (tmp <= net->hard_header_len) {
+			dev_warn(&intf->dev,
+				 "dev can't take %u byte packets (max %u)\n",
+				 net->hard_header_len+1, tmp);
+			retval = -EINVAL;
+			goto fail_and_release;
+		}
+		dev->hard_mtu = tmp;
+		net->mtu = dev->hard_mtu - net->hard_header_len;
+		dev_warn(&intf->dev,
+			 "dev can't take %u byte packets (max %u), adjusting MTU to %u\n",
+			 dev->hard_mtu, tmp, net->mtu);
 	}
 
 	/* REVISIT:  peripheral "alignment" request is ignored ... */


-
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