linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@infradead.org>
To: Bart Van Assche <bvanassche@acm.org>
Cc: Paolo Bonzini <pbonzini@redhat.com>,
	linux-scsi <linux-scsi@vger.kernel.org>,
	Ulrich Obergfell <uobergfe@redhat.com>
Subject: Re: dangling pointers and/or reentrancy in scmd_eh_abort_handler?
Date: Mon, 19 May 2014 08:25:30 -0700	[thread overview]
Message-ID: <20140519152530.GA15433@infradead.org> (raw)
In-Reply-To: <537A1E88.9080803@acm.org>

On Mon, May 19, 2014 at 05:08:56PM +0200, Bart Van Assche wrote:
> On 05/19/14 16:08, Paolo Bonzini wrote:
> > 2) reentrancy: the softirq handler and scmd_eh_abort_handler can run
> > concurrently, and call scsi_finish_command without any lock protecting
> > the calls.  You can then get memory corruption.
> 
> I'm not sure what the recommended approach is to address this race. But
> it is possible to address this in the LLD. See e.g. the srp_claim_req()
> function in the SRP LLD and how it is invoked from the reply handler,
> the abort handler and the reset handlers in that LLD.

blk-mq triest to solve this a test_and_set_bit for a completion flag
at the block layer for completions vs timeouts.  I think doing this in
the SCSI layer as well would be very useful as we can't expect Joe
Random Driver Developer to get it right in every driver.

  reply	other threads:[~2014-05-19 15:25 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-19 14:08 dangling pointers and/or reentrancy in scmd_eh_abort_handler? Paolo Bonzini
2014-05-19 15:08 ` Bart Van Assche
2014-05-19 15:25   ` Christoph Hellwig [this message]
2014-05-19 16:09   ` Paolo Bonzini
2014-05-19 16:43     ` Bart Van Assche
2014-05-20  7:32       ` Bart Van Assche
2014-05-20  8:10         ` Bart Van Assche
2014-05-20  8:40           ` Paolo Bonzini
2014-05-21 14:16       ` Mark Wu
2014-05-21 20:34         ` Paolo Bonzini
2014-05-23  1:28           ` Elliott, Robert (Server Storage)
2014-05-23  9:22             ` Paolo Bonzini
2014-05-20  8:46 ` Bart Van Assche

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=20140519152530.GA15433@infradead.org \
    --to=hch@infradead.org \
    --cc=bvanassche@acm.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=pbonzini@redhat.com \
    --cc=uobergfe@redhat.com \
    /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).