linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Oliver Neukum <oneukum@suse.de>
To: Jiri Kosina <jkosina@suse.cz>
Cc: linux-input@vger.kernel.org, linux-usb@vger.kernel.org
Subject: Re: possible race between reset and error handling in usbhid
Date: Fri, 14 Oct 2011 08:37:29 +0200	[thread overview]
Message-ID: <201110140837.29660.oneukum@suse.de> (raw)
In-Reply-To: <alpine.LNX.2.00.1110131819500.14768@pobox.suse.cz>

Am Donnerstag, 13. Oktober 2011, 18:20:52 schrieb Jiri Kosina:
> On Wed, 12 Oct 2011, Oliver Neukum wrote:
> 
> > looking at the usbhid code it seems to me that there is no protection
> > between the error handling code and pre_reset() racing.
> > 
> > In particular there seems to be no protection from hid_retry_timeout() calling
> > hid_start_in() which would start IO after hid_pre_reset() has already called
> > hid_cease_io() because that uses del_timer(), not del_timer_sync()
> > 
> > What do you think about this patch?
> 
> Looks like you made a good catch, thanks. Out of curiosity -- did you 
> encounter this happening for real, or have you find out by code reading?

A bit of both. I was looking for causes of a mysterious bug report that
just mentions HID devices and resets and is known to be a race.
So I may have indirectly encountered it.

	Regards
		Oliver

      reply	other threads:[~2011-10-14  6:37 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-12 14:14 possible race between reset and error handling in usbhid Oliver Neukum
2011-10-13 16:20 ` Jiri Kosina
2011-10-14  6:37   ` Oliver Neukum [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=201110140837.29660.oneukum@suse.de \
    --to=oneukum@suse.de \
    --cc=jkosina@suse.cz \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).