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]
Message-ID: <Pine.LNX.4.44L0.1401301702590.31548-100000@netrider.rowland.org>
Date:	Thu, 30 Jan 2014 17:07:11 -0500 (EST)
From:	Alan Stern <stern@...land.harvard.edu>
To:	Sarah Sharp <sarah.a.sharp@...ux.intel.com>
cc:	David Laight <David.Laight@...LAB.COM>,
	"linux-usb@...r.kernel.org" <linux-usb@...r.kernel.org>,
	"netdev@...r.kernel.org" <netdev@...r.kernel.org>,
	Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	David Miller <davem@...emloft.net>,
	Dan Williams <dan.j.williams@...el.com>,
	"Nyman, Mathias" <mathias.nyman@...el.com>,
	Mark Lord <mlord@...ox.com>, Freddy Xin <freddy@...x.com.tw>
Subject: Re: [PATCH RFC 1/1] usb: Tell xhci when usb data might be misaligned

On Thu, 30 Jan 2014, Sarah Sharp wrote:

> > That's a good plan.  However _some_ restriction will turn out to be
> > necessary.
> > 
> > For example, what will you do if a driver submits an SG list containing
> > 300 elements, each 3 bytes long?  That's too many to fit in a single
> > ring segment, but it's smaller than a TD fragment -- it's even smaller
> > than maxpacket -- so there's no place to split it.  (Not that I think
> > drivers _will_ submit requests like this; this is just to demonstrate
> > the point.)
> > 
> > It ought to be acceptable to require, for example, that an SG URB 
> > contain no more than (say) 100 elements that are smaller than 512 
> > bytes.
> 
> At that point, the xHCI driver or USB core should probably use a bounce
> buffer.  It feels like we should attempt to push down scatter-gather
> lists as far down in the stack as possible, so the upper layers don't
> have to care what alignment, length, or random 64KB boundary splits we
> need.

Okay.  That should be doable, if awkward.

> > ehci-hcd gets along okay with the restriction that each SG element 
> > except the last has to be a multiple of the maxpacket size.  xhci-hcd 
> > can relax this quite a lot, but not all the way.
> 
> What does the EHCI driver do when it receives a SG list from the USB
> networking layer that violates this restriction?

It never receives such lists.  usb_submit_urb() returns -EINVAL before 
the request gets sent to ehci-hcd.

Alan Stern

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