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.0907311135030.3152-100000@iolanthe.rowland.org>
Date:	Fri, 31 Jul 2009 11:41:38 -0400 (EDT)
From:	Alan Stern <stern@...land.harvard.edu>
To:	Jason Wessel <jason.wessel@...driver.com>
cc:	gregkh@...e.de, <linux-usb@...r.kernel.org>,
	<linux-kernel@...r.kernel.org>, <dbrownell@...rs.sourceforge.net>,
	Ingo Molnar <mingo@...e.hu>,
	Andrew Morton <akpm@...ux-foundation.org>,
	Yinghai Lu <yinghai@...nel.org>,
	"Eric W. Biederman" <ebiederm@...ssion.com>
Subject: Re: [PATCH 07/10] ehci-dbgp,ehci: Allow early or late use of the
 dbgp device

On Fri, 31 Jul 2009, Jason Wessel wrote:

> If the EHCI debug port is initialized and in use, the EHCI host
> controller driver must follow two rules.
> 
> 1) If the EHCI host driver issues a controller reset, the debug
>    controller driver re-initialization must get called after the reset
>    is completed.
> 
> 2) The EHCI host driver should ignore any requests to the physical
>    EHCI debug port when the EHCI debug port is in use.
> 
> The code to check for the debug port was moved from ehci_pci_reinit()
> to ehci_pci_setup because it must get called prior to ehci_reset()
> which will clear the debug port registers.

> --- a/drivers/usb/host/ehci-hub.c
> +++ b/drivers/usb/host/ehci-hub.c
> @@ -816,6 +816,15 @@ static int ehci_hub_control (
>  	case SetPortFeature:
>  		selector = wIndex >> 8;
>  		wIndex &= 0xff;
> +		if (unlikely(ehci->debug)) {

Don't you need a similar test for ClearPortFeature?  Or does that not
matter?

> +			/* If the debug port is active any port
> +			 * feature requests should get denied */
> +			if ((readl(&ehci->debug->control) & DBGP_ENABLED) &&
> +			    wIndex == HCS_DEBUG_PORT(ehci->hcs_params)) {

The order of the two tests here should be reversed, to avoid an 
unnecessary I/O access in the common case.

> +				retval = -ENODEV;
> +				goto error_exit;

This is the wrong return value.  You should return -EPIPE, i.e., goto
error instead of error_exit.

> +			}
> +		}
>  		if (!wIndex || wIndex > ports)
>  			goto error;
>  		wIndex--;
> @@ -894,6 +903,7 @@ error:
>  		/* "stall" on error */
>  		retval = -EPIPE;
>  	}
> +error_exit:

And then this new label isn't needed.

>  	spin_unlock_irqrestore (&ehci->lock, flags);
>  	return retval;
>  }

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