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:	Wed, 12 Nov 2014 14:52:02 -0500 (EST)
From:	Alan Stern <stern@...land.harvard.edu>
To:	"Sean O. Stalley" <sean.stalley@...el.com>
cc:	Oliver Neukum <oneukum@...e.de>,
	Stephanie Wallick <stephanie.s.wallick@...el.com>,
	<linux-kernel@...r.kernel.org>, <gregkh@...uxfoundation.org>,
	<linux-usb@...r.kernel.org>, <devel@...verdev.osuosl.org>
Subject: Re: [V2 PATCH 02/10] added media agnostic (MA) USB HCD roothubs

On Wed, 12 Nov 2014, Sean O. Stalley wrote:

> > > --- /dev/null
> > > +++ b/drivers/staging/mausb/drivers/mausb_hub.c
> > 
> > > +/**
> > > + * Returns true if the given is the superspeed HCD. Note: The primary HCD is
> > > + * High Speed and the shared HCD is SuperSpeed.
> > > + */
> > 
> > Why in that order?
> > 
> 
> We should probably switch this & make the superspeed hub primary.
> That way we match the xhci driver.

xhci-hcd makes the high-speed hcd the primary one.  This is because it 
registers the high-speed hcd before the SuperSpeed hcd.  There was a 
good reason for doing it this way, but I can't remember what it was 
(it's buried somewhere in the email archives).

That's why when you look at the output from lsusb or something similar,
a SuperSpeed root hub has a bus number that is one higher than its peer
high-speed root hub.

> > > +int mausb_hub_status_data(struct usb_hcd *hcd, char *buf)
> > > +{
> > > +	int                      i;
> > > +	u16                      port_change = 0;
> > > +	u32                      status = 0;
> > > +	int                      ret = 1;
> > > +	struct mausb_hcd	 *mhcd = usb_hcd_to_mausb_hcd(hcd);
> > > +	struct mausb_root_hub	 *roothub = usb_hcd_to_roothub(hcd);
> > > +
> > > +	/*
> > > +	 * Buf should never be more that 2 bytes. USB 3.0 hubs cannot have
> > > +	 * more than 15 downstream ports.
> > > +	 */
> > > +	buf[0] = 0;
> > > +	if (MAUSB_ROOTHUB_NUM_PORTS > 7) {
> > > +		buf[1] = 0;
> > > +		ret++;
> > > +	}
> > 
> > Endianness bug.
> > 
> 
> Could you elaborate?
> It was my understanding that this buffer was host-endian.
> Is this an unacceptable way to clear the buffer?

I don't understand Oliver's objection here.  The buffer is 
little-endian, just as it is for real hubs.  The code seems correct.

Alan Stern

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