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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Tue, 30 Oct 2007 15:09:54 +0200
From:	Vitaliy Ivanov <vitalivanov@...il.com>
To:	Pete Zaitcev <zaitcev@...hat.com>, vitalivanov@...il.com
Cc:	Oliver Neukum <oliver@...kum.org>,
	linux-usb-devel@...ts.sourceforge.net, greg@...ah.com,
	linux-kernel@...r.kernel.org, netwiz@....id.au
Subject: Re: USB: FIx locks and urb->status in adutux

On Tue, 2007-10-30 at 06:24, Pete Zaitcev wrote:

> However, this looks wrong:
> 
> > +			 dev->interrupt_in_endpoint->bInterval);
> > +	dev->read_urb_finished = 0;
> > +	retval = usb_submit_urb(dev->interrupt_in_urb, GFP_KERNEL);
> > +	/* we ignore failure */
> > +	/* end of fixup for first read */
> > +
> > +	/* initialize out direction */
> > +	dev->out_urb_finished = 1;
> 
> The finished flag is only set when URB is not in use anymore. Did you
> observe an anomaly with my code? Any hangs? If so, I assure you this
> is not the fix. As it's written, even if we ignore the failure (e.g.
> do not pass it to userland), we sill have to maintain the correct
> flag state.

As about read_urb_finished probably it's OK. But we shouldn't decrease open_count in the case of error as then we return normal exit value.
Here is what we had before:

				 dev->interrupt_in_endpoint->bInterval);
		dev->read_urb_finished = 0;
		retval = usb_submit_urb(dev->interrupt_in_urb, GFP_KERNEL);
		if (retval) {
			dev->read_urb_finished = 1;
			--dev->open_count;
		}

So I can left it but w/o this line:
--dev->open_count;

What is more critical is that I added:

	/* initialize out direction */
	dev->out_urb_finished = 1;

Without this we'll always have write timeouts.

		Vitaliy

-
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