From: James Smart <James.Smart@Emulex.Com>
To: James Bottomley <James.Bottomley@SteelEye.com>
Cc: linux-scsi@vger.kernel.org
Subject: Re: [PATCH] scsi midlayer: fix sdev reuse after free
Date: Tue, 27 Jun 2006 12:42:08 -0400 [thread overview]
Message-ID: <44A15FE0.7000508@emulex.com> (raw)
In-Reply-To: <1151424211.3340.35.camel@mulgrave.il.steeleye.com>
Yes - same issue as with the starget - and with the same call for
actions....
What is says is all of this is very broken right now for dynamic
teardown and re-add. Perhaps you want to reconsider the patch that
made it configurable as to whether to tear down the starget tree ?
Granted, you still have to do so on module unload or LLDD detach,
but the common use models usually doesn't make this an issue.
-- james s
James Bottomley wrote:
> On Mon, 2006-06-26 at 14:53 -0400, James Smart wrote:
>> void __scsi_remove_device(struct scsi_device *sdev)
>> {
>> struct device *dev = &sdev->sdev_gendev;
>> + unsigned long flags;
>>
>> if (scsi_device_set_state(sdev, SDEV_CANCEL) != 0)
>> return;
>>
>> + spin_lock_irqsave(sdev->host->host_lock, flags);
>> + list_del(&sdev->siblings);
>> + list_del(&sdev->same_target_siblings);
>> + spin_unlock_irqrestore(sdev->host->host_lock, flags);
>> class_device_unregister(&sdev->sdev_classdev);
>> transport_remove_device(dev);
>> device_del(dev);
>
> Not quite ... we cannot physically remove the device from the list until
> after device_del has been called otherwise we could get namespace reuse
> before it is really free (that's quite a small race window in this case,
> but it does exist).
>
> James
>
>
>
next prev parent reply other threads:[~2006-06-27 16:42 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-06-26 18:53 [PATCH] scsi midlayer: fix sdev reuse after free James Smart
2006-06-27 16:03 ` James Bottomley
2006-06-27 16:42 ` James Smart [this message]
2006-07-19 14:04 ` Frederic TEMPORELLI
2006-07-19 14:11 ` James Smart
2006-07-19 14:12 ` James Smart
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=44A15FE0.7000508@emulex.com \
--to=james.smart@emulex.com \
--cc=James.Bottomley@SteelEye.com \
--cc=linux-scsi@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.