From: Christoph Hellwig <hch@infradead.org>
To: Zhihao Cheng <chengzhihao1@huawei.com>
Cc: axboe@kernel.dk, rostedt@goodmis.org, mingo@redhat.com,
acme@redhat.com, linux-block@vger.kernel.org,
linux-kernel@vger.kernel.org, yukuai3@huawei.com
Subject: Re: [PATCH] blktrace: Fix uaf in blk_trace access after removing by sysfs
Date: Wed, 22 Sep 2021 06:21:35 +0100 [thread overview]
Message-ID: <YUq9X2dHG+LkMvQ6@infradead.org> (raw)
In-Reply-To: <20210910092120.182270-1-chengzhihao1@huawei.com>
On Fri, Sep 10, 2021 at 05:21:20PM +0800, Zhihao Cheng wrote:
> + else {
> + /*
> + * Don't remove blk_trace under running state, in
> + * case triggering use-after-free in function
> + * __blk_add_trace().
> + */
> + if (bt->trace_state != Blktrace_running)
> + ret = blk_trace_remove_queue(q);
> + else
> + ret = -EBUSY;
> + }
> goto out_unlock_bdev;
So who is going to eventually call blk_trace_free in this case?
Also Having the check in blk_trace_remove_queue would seem a little
cleaner.
next prev parent reply other threads:[~2021-09-22 5:22 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-09-10 9:21 [PATCH] blktrace: Fix uaf in blk_trace access after removing by sysfs Zhihao Cheng
2021-09-22 1:15 ` Zhihao Cheng
2021-09-22 5:21 ` Christoph Hellwig [this message]
2021-09-23 13:39 ` Zhihao Cheng
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=YUq9X2dHG+LkMvQ6@infradead.org \
--to=hch@infradead.org \
--cc=acme@redhat.com \
--cc=axboe@kernel.dk \
--cc=chengzhihao1@huawei.com \
--cc=linux-block@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=rostedt@goodmis.org \
--cc=yukuai3@huawei.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).