From: Sasha Levin <sashal@kernel.org>
To: gregkh@linuxfoundation.org
Cc: jack@suse.cz, axboe@kernel.dk, bvanassche@acm.org,
chaitanya.kulkarni@wdc.com, ming.lei@redhat.com,
tristmd@gmail.com, stable@vger.kernel.org
Subject: Re: FAILED: patch "[PATCH] blktrace: Protect q->blk_trace with RCU" failed to apply to 5.4-stable tree
Date: Tue, 3 Mar 2020 14:05:50 -0500 [thread overview]
Message-ID: <20200303190550.GM21491@sasha-vm> (raw)
In-Reply-To: <158317397191104@kroah.com>
On Mon, Mar 02, 2020 at 07:32:51PM +0100, gregkh@linuxfoundation.org wrote:
>
>The patch below does not apply to the 5.4-stable tree.
>If someone wants it applied there, or to any other stable or longterm
>tree, then please email the backport, including the original git commit
>id to <stable@vger.kernel.org>.
>
>thanks,
>
>greg k-h
>
>------------------ original commit in Linus's tree ------------------
>
>From c780e86dd48ef6467a1146cf7d0fe1e05a635039 Mon Sep 17 00:00:00 2001
>From: Jan Kara <jack@suse.cz>
>Date: Thu, 6 Feb 2020 15:28:12 +0100
>Subject: [PATCH] blktrace: Protect q->blk_trace with RCU
>
>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.
>
>Link: https://bugzilla.kernel.org/show_bug.cgi?id=205711
>CC: stable@vger.kernel.org
>Reviewed-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
>Reviewed-by: Ming Lei <ming.lei@redhat.com>
>Tested-by: Ming Lei <ming.lei@redhat.com>
>Reviewed-by: Bart Van Assche <bvanassche@acm.org>
>Reported-by: Tristan Madani <tristmd@gmail.com>
>Signed-off-by: Jan Kara <jack@suse.cz>
>Signed-off-by: Jens Axboe <axboe@kernel.dk>
The conflict was because we don't have 67c0496e87d1 ("kernfs: convert
kernfs_node->id from union kernfs_node_id to u64") on 5.4. Fixed and
queued up.
--
Thanks,
Sasha
prev parent reply other threads:[~2020-03-03 19:05 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-02 18:32 FAILED: patch "[PATCH] blktrace: Protect q->blk_trace with RCU" failed to apply to 5.4-stable tree gregkh
2020-03-03 19:05 ` Sasha Levin [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=20200303190550.GM21491@sasha-vm \
--to=sashal@kernel.org \
--cc=axboe@kernel.dk \
--cc=bvanassche@acm.org \
--cc=chaitanya.kulkarni@wdc.com \
--cc=gregkh@linuxfoundation.org \
--cc=jack@suse.cz \
--cc=ming.lei@redhat.com \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox