From: Mike Anderson <andmike@us.ibm.com>
To: Alan Stern <stern@rowland.harvard.edu>
Cc: SCSI development list <linux-scsi@vger.kernel.org>,
Frank Pieczynski <pieczy@web.de>
Subject: Re: BUG in sd.c
Date: Wed, 4 Feb 2004 09:14:01 -0800 [thread overview]
Message-ID: <20040204171401.GA1687@beaverton.ibm.com> (raw)
In-Reply-To: <Pine.LNX.4.44L0.0402041108310.6676-100000@ida.rowland.org>
Alan Stern [stern@rowland.harvard.edu] wrote:
> The following Bugzilla entry:
>
> http://bugme.osdl.org/show_bug.cgi?id=1986
>
> reports a problem with a USB card reader. The cause and resolution of
> that problem are irrelevant to this list, but the manifestation of the
> problem may have been that the device replied with Check Condition (and no
> sense data) to every command.
>
> At any rate, this caused an oops as a result of sd.c calling
> scsi_disk_get() after the device's reference count had gone to 0. Can
> someone look at this and see if sd.c needs to be fixed?
>
> Alan Stern
Just a quick look. We are racing scsi_disk_release with sd_open. The
return code check in scsi_disk_get from the call to kobject_get is
worthless. The kobject_get will take do a inc even if we may already be
in release. This will cause a oops as we will fail the scsi_device_get
call in scsi_disk_get which will cause a call to kobject_put on a struct
that will most likely be free'd.
Maybe I am still reading the block layer locking wrong, but I do not see a
method to close the race with blkdev_open. I will look at this some more
and see if I can get a clue what I am missing.
-andmike
--
Michael Anderson
andmike@us.ibm.com
next prev parent reply other threads:[~2004-02-04 17:09 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-02-04 16:13 BUG in sd.c Alan Stern
2004-02-04 17:14 ` Mike Anderson [this message]
2004-02-19 15:00 ` Alan Stern
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=20040204171401.GA1687@beaverton.ibm.com \
--to=andmike@us.ibm.com \
--cc=linux-scsi@vger.kernel.org \
--cc=pieczy@web.de \
--cc=stern@rowland.harvard.edu \
/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