From: Jens Axboe <axboe@kernel.dk>
To: Ming Lei <ming.lei@redhat.com>
Cc: linux-block@vger.kernel.org,
Zhang Wensheng <zhangwensheng@huaweicloud.com>,
Zhong Jinghua <zhongjinghua@huawei.com>,
Hillf Danton <hdanton@sina.com>, Yu Kuai <yukuai3@huawei.com>,
Dennis Zhou <dennis@kernel.org>
Subject: Re: [PATCH] block: fix use-after-free of q->q_usage_counter
Date: Thu, 15 Dec 2022 05:25:11 -0700 [thread overview]
Message-ID: <167110711134.47123.15435164400352739613.b4-ty@kernel.dk> (raw)
In-Reply-To: <20221215021629.74870-1-ming.lei@redhat.com>
On Thu, 15 Dec 2022 10:16:29 +0800, Ming Lei wrote:
> For blk-mq, queue release handler is usually called into after
> blk_mq_freeze_queue_wait() returns. However, q_usage_counter->release()
> handler may not be started yet at that time, so cause user-after-free.
>
> Fix the issue by moving percpu_ref_exit() into blk_free_queue_rcu()
> since ->release() is called with rcu read lock held, since it is
> concluded that the race should be covered in caller per discussion
> from the two links.
>
> [...]
Applied, thanks!
[1/1] block: fix use-after-free of q->q_usage_counter
commit: d36a9ea5e7766961e753ee38d4c331bbe6ef659b
Best regards,
--
Jens Axboe
next prev parent reply other threads:[~2022-12-15 12:25 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-12-15 2:16 [PATCH] block: fix use-after-free of q->q_usage_counter Ming Lei
2022-12-15 12:25 ` Jens Axboe [this message]
-- strict thread matches above, loose matches on Subject: below --
2023-09-21 18:20 Saranya Muruganandam
2023-09-22 1:09 ` Ming Lei
2023-09-22 9:26 ` Greg KH
2023-09-22 18:21 ` Saranya Muruganandam
2023-10-07 10:22 ` Greg KH
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=167110711134.47123.15435164400352739613.b4-ty@kernel.dk \
--to=axboe@kernel.dk \
--cc=dennis@kernel.org \
--cc=hdanton@sina.com \
--cc=linux-block@vger.kernel.org \
--cc=ming.lei@redhat.com \
--cc=yukuai3@huawei.com \
--cc=zhangwensheng@huaweicloud.com \
--cc=zhongjinghua@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