All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bart Van Assche <bvanassche@acm.org>
To: Jan Kara <jack@suse.cz>, Jens Axboe <axboe@kernel.dk>
Cc: linux-block@vger.kernel.org, tristmd@gmail.com, stable@vger.kernel.org
Subject: Re: [PATCH] blktrace: Protect q->blk_trace with RCU
Date: Sun, 9 Feb 2020 19:54:18 -0800	[thread overview]
Message-ID: <6a49e67f-e621-939e-11d5-b614fa8da7d8@acm.org> (raw)
In-Reply-To: <20200206142812.25989-1-jack@suse.cz>

On 2020-02-06 06:28, Jan Kara wrote:
> KASAN is reporting that __blk_add_trace() has a use-after-free issue
> when accessing q->blk_trace. Indeed the switching of block tracing (and
> thus eventual freeing of q->blk_trace) is completely unsynchronized with
> the currently running tracing and thus it can happen that the blk_trace
> structure is being freed just while __blk_add_trace() works on it.
> Protect accesses to q->blk_trace by RCU during tracing and make sure we
> wait for the end of RCU grace period when shutting down tracing. Luckily
> that is rare enough event that we can afford that. Note that postponing
> the freeing of blk_trace to an RCU callback should better be avoided as
> it could have unexpected user visible side-effects as debugfs files
> would be still existing for a short while block tracing has been shut
> down.

Reviewed-by: Bart Van Assche <bvanassche@acm.org>

  parent reply	other threads:[~2020-02-10  3:54 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-06 14:28 [PATCH] blktrace: Protect q->blk_trace with RCU Jan Kara
2020-02-06 18:46 ` Chaitanya Kulkarni
2020-02-06 18:49   ` Jens Axboe
2020-02-06 19:37     ` Chaitanya Kulkarni
2020-02-10  0:38 ` Chaitanya Kulkarni
2020-02-10  2:19 ` Ming Lei
2020-02-10  3:54 ` Bart Van Assche [this message]
2020-02-19 12:59 ` Jan Kara
2020-02-25 10:20   ` Ming Lei
2020-02-25 15:40     ` Jens Axboe
2020-03-02 20:40 ` Bjorn Helgaas
2020-03-02 21:19   ` Chaitanya Kulkarni
2020-03-02 21:59     ` Bjorn Helgaas
2020-03-02 22:06     ` Keith Busch
2020-03-03 11:07       ` Cengiz Can
2020-03-03 12:17         ` Greg KH
2020-03-05  1:51         ` Ming Lei
2020-03-05  4:27           ` Cengiz Can

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=6a49e67f-e621-939e-11d5-b614fa8da7d8@acm.org \
    --to=bvanassche@acm.org \
    --cc=axboe@kernel.dk \
    --cc=jack@suse.cz \
    --cc=linux-block@vger.kernel.org \
    --cc=stable@vger.kernel.org \
    --cc=tristmd@gmail.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 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.