stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jens Axboe <axboe@kernel.dk>
To: Christian Borntraeger <borntraeger@de.ibm.com>, tom.leiming@gmail.com
Cc: David Hildenbrand <dahi@linux.vnet.ibm.com>,
	kvm@vger.kernel.org, stable@vger.kernel.org,
	rusty@rustcorp.com.au, virtualization@lists.linux-foundation.org,
	mst@redhat.com, linux-kernel@vger.kernel.org,
	ppinatti@linux.vnet.ibm.com
Subject: Re: [PATCH] blk-mq: Avoid race condition with uninitialized requests
Date: Mon, 22 Sep 2014 08:17:25 -0600	[thread overview]
Message-ID: <54202F75.8080401@kernel.dk> (raw)
In-Reply-To: <54202EF8.4080909@de.ibm.com>

On 2014-09-22 08:15, Christian Borntraeger wrote:
> On 09/18/2014 11:04 AM, David Hildenbrand wrote:
>> This patch should fix the bug reported in https://lkml.org/lkml/2014/9/11/249.
>>
>> We have to initialize at least the atomic_flags and the cmd_flags when
>> allocating storage for the requests.
>>
>> Otherwise blk_mq_timeout_check() might dereference uninitialized pointers when
>> racing with the creation of a request.
>>
>> Also move the reset of cmd_flags for the initializing code to the point where a
>> request is freed. So we will never end up with pending flush request indicators
>> that might trigger dereferences of invalid pointers in blk_mq_timeout_check().
>>
>> Cc: stable@vger.kernel.org
>> Signed-off-by: David Hildenbrand <dahi@linux.vnet.ibm.com>
>
> Acked-by: Christian Borntraeger <borntraeger@de.ibm.com>
>
> Can you please add
> Reported-by: Paulo De Rezende Pinatti <ppinatti@linux.vnet.ibm.com>
> Tested-by: Paulo De Rezende Pinatti <ppinatti@linux.vnet.ibm.com>
>
> as Paulo did the testing work?
>
> We thing this patch is fine and should go upstream.

I might have to pick'n rebase the series, in which case I'll add it. But 
I already queued it up last week, so if I don't, then I can't easily add 
it. I wish the git notes wasn't such a horrible and unusable hack, so we 
had a chance to annotate commits without having to rewrite history...

-- 
Jens Axboe


      reply	other threads:[~2014-09-22 14:17 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-18  9:04 [PATCH] blk-mq: Avoid race condition with uninitialized requests David Hildenbrand
2014-09-18  9:04 ` David Hildenbrand
2014-09-19 12:41   ` Christian Borntraeger
2014-09-22 14:15   ` Christian Borntraeger
2014-09-22 14:17     ` Jens Axboe [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=54202F75.8080401@kernel.dk \
    --to=axboe@kernel.dk \
    --cc=borntraeger@de.ibm.com \
    --cc=dahi@linux.vnet.ibm.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mst@redhat.com \
    --cc=ppinatti@linux.vnet.ibm.com \
    --cc=rusty@rustcorp.com.au \
    --cc=stable@vger.kernel.org \
    --cc=tom.leiming@gmail.com \
    --cc=virtualization@lists.linux-foundation.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).