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: <063D6719AE5E284EB5DD2968C1650D6D0F6B8C70@AcuExch.aculab.com>
Date:	Wed, 5 Feb 2014 11:58:12 +0000
From:	David Laight <David.Laight@...LAB.COM>
To:	'Sarah Sharp' <sarah.a.sharp@...ux.intel.com>,
	Mark Lord <mlord@...ox.com>, netdev <netdev@...r.kernel.org>
CC:	"linux-usb@...r.kernel.org" <linux-usb@...r.kernel.org>,
	Bjørn Mork <bjorn@...k.no>,
	Freddy Xin <freddy@...x.com.tw>,
	Ming Lei <ming.lei@...onical.com>
Subject: RE: [RFT 1/2] xhci 1.0: Limit arbitrarily-aligned scatter gather.

From: Sarah Sharp 
> xHCI 1.0 hosts have a set of requirements on how to align transfer
> buffers on the endpoint rings called "TD fragment" rules.  When the
> ax88179_178a driver added support for scatter gather in 3.12, with
> commit 804fad45411b48233b48003e33a78f290d227c8 "USBNET: ax88179_178a:
> enable tso if usb host supports sg dma", it broke the device under xHCI
> 1.0 hosts.  Under certain network loads, the device would see an
> unexpected short packet from the host, which would cause the device to
> stop sending ethernet packets, even through USB packets would still be
> sent.
> 
> Commit 35773dac5f86 "usb: xhci: Link TRB must not occur within a USB
> payload burst" attempted to fix this.  It was a quick hack to partially
> implement the TD fragment rules.  However, it caused regressions in the
> usb-storage layer and userspace USB drivers using libusb.  The patches
> to attempt to fix this are too far reaching into the USB core, and we
> really need to implement the TD fragment rules correctly in the xHCI
> driver, instead of continuing to wallpaper over the issues.
> 
> Disable arbitrarily-aligned scatter-gather in the xHCI driver for 1.0
> hosts.  Only the ax88179_178a driver checks the no_sg_constraint flag,
> so don't set it for 1.0 hosts.  This should not impact usb-storage or
> usbfs behavior, since they pass down max packet sized aligned sg-list
> entries (512 for USB 2.0 and 1024 for USB 3.0).

I believe that this will cause the ax88179 driver to discard some
receive packets on (at least) my panther point 1.00 controller.

I certainly saw bursts of lost packets in some testing I did before the
scatter-gather transfers were enabled, and before any of my patches.

The problem is that the ax88179_178a driver submits receive URBs that
cross 64k boundaries, and are not aligned (they start at an 0x40 boundary).
Receive USB frames can contain multiple ethernet frames, by default they
are 20kB (and sit in 24kB of memory).

I'm not entirely convinced that this is acceptable long term behaviour.

	David



--
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