From: Zhihao Cheng <chengzhihao1@huawei.com>
To: Christoph Hellwig <hch@infradead.org>
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: Thu, 23 Sep 2021 21:39:27 +0800 [thread overview]
Message-ID: <94c819d1-4c3d-fb8d-c32c-c09c84a6108f@huawei.com> (raw)
In-Reply-To: <YUq9X2dHG+LkMvQ6@infradead.org>
在 2021/9/22 13:21, Christoph Hellwig 写道:
Hi Christoph,
> 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?
Agree. How about removing blk_trace from running_list and stopping it
before calling blk_trace_free()?
>
> Also Having the check in blk_trace_remove_queue would seem a little
> cleaner.
Oh right, will move the check in v2.
prev parent reply other threads:[~2021-09-23 13:39 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-09-10 9:21 Zhihao Cheng
2021-09-22 1:15 ` Zhihao Cheng
2021-09-22 5:21 ` Christoph Hellwig
2021-09-23 13:39 ` Zhihao Cheng [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=94c819d1-4c3d-fb8d-c32c-c09c84a6108f@huawei.com \
--to=chengzhihao1@huawei.com \
--cc=acme@redhat.com \
--cc=axboe@kernel.dk \
--cc=hch@infradead.org \
--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
all inboxes | Powered by JetHome®