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: <200805211533.00221.oliver@neukum.org>
Date:	Wed, 21 May 2008 15:32:59 +0200
From:	Oliver Neukum <oliver@...kum.org>
To:	Jiri Kosina <jkosina@...e.cz>
Cc:	Greg KH <greg@...ah.com>, linux-usb@...r.kernel.org,
	Alan Stern <stern@...land.harvard.edu>, lchiquitto@...ell.com,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH] USB: fix deadlock in HCD code

Am Mittwoch 21 Mai 2008 15:27:50 schrieb Jiri Kosina:
> On Wed, 21 May 2008, Oliver Neukum wrote:
> 
> > > hcd_urb_list_lock is used for synchronization between IRQ and non-IRQ 
> > > contexts, so the non-IRQ context has to disable IRQs in order to prevent 
> > > deadlocking with IRQ context.
> > Which non-irq context is that?
> 
> One example -- assume usb_submit_urb() called from non-IRQ context. Then
> 
> usb_hcd_submit_urb() -> rh_urb_enqueue() -> rh_queue_status() -> 
> usb_hcd_link_urb_to_ep().
> 

This turns out not to be the case. Interrupts are disabled.

static int rh_queue_status (struct usb_hcd *hcd, struct urb *urb)
{
	int		retval;
	unsigned long	flags;
	int		len = 1 + (urb->dev->maxchild / 8);

	spin_lock_irqsave (&hcd_root_hub_lock, flags);
	if (hcd->status_urb || urb->transfer_buffer_length < len) {
		dev_dbg (hcd->self.controller, "not queuing rh status urb\n");
		retval = -EINVAL;
		goto done;
	}

	retval = usb_hcd_link_urb_to_ep(hcd, urb);

I'll investigate.

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