linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Bart Van Assche <bvanassche@acm.org>
To: Tejun Heo <tj@kernel.org>
Cc: Mike Christie <michaelc@cs.wisc.edu>,
	linux-scsi <linux-scsi@vger.kernel.org>,
	James Bottomley <jbottomley@parallels.com>,
	Jens Axboe <axboe@kernel.dk>, Chanho Min <chanho.min@lge.com>
Subject: Re: [PATCH] Fix a use-after-free triggered by device removal
Date: Fri, 07 Sep 2012 08:57:10 +0200	[thread overview]
Message-ID: <50499AC6.1050008@acm.org> (raw)
In-Reply-To: <20120906232031.GU29092@google.com>

On 09/07/12 01:20, Tejun Heo wrote:
> I think Mike is wondering whether your patch in isolation is enough or
> we also need to have DEAD check there too.  The proposed patch can't
> handle the case where q->request_fn() is invoked after drain is
> complete.  I'm not really sure whether that can happen tho.

Hello Tejun,

I'm not sure it would be a good idea to add a blk_queue_dead() check in
any of the __blk_run_queue() variants since blk_drain_queue() can invoke
__blk_run_queue() to drain the queue.

Also, as far as I can see the functions that can insert a request into
the queue (blk_insert_cloned_request(), queue_unplugged(),
blk_execute_rq_nowait()) all check whether the queue is dead before
inserting a request. That should be sufficient to prevent that new
requests are queued after QUEUE_FLAG_DEAD has been set.

Bart.


  reply	other threads:[~2012-09-07  6:57 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-03 14:12 [PATCH] Fix a use-after-free triggered by device removal Bart Van Assche
2012-09-06 16:27 ` Michael Christie
2012-09-06 17:58   ` Bart Van Assche
2012-09-06 18:14     ` Mike Christie
2012-09-06 18:52       ` Bart Van Assche
2012-09-06 23:20         ` Tejun Heo
2012-09-07  6:57           ` Bart Van Assche [this message]
2012-09-10 23:38             ` Tejun Heo
2012-09-11  6:42               ` Bart Van Assche
2012-09-12 20:53                 ` Tejun Heo
2012-09-13  7:26                   ` Bart Van Assche
2012-09-13 16:53                     ` Tejun Heo
2012-09-13 18:27                       ` Bart Van Assche
2012-09-13 19:25                         ` Tejun Heo

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=50499AC6.1050008@acm.org \
    --to=bvanassche@acm.org \
    --cc=axboe@kernel.dk \
    --cc=chanho.min@lge.com \
    --cc=jbottomley@parallels.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=michaelc@cs.wisc.edu \
    --cc=tj@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).