From: Jens Axboe <axboe@kernel.dk>
To: "Ming Lei" <ming.lei@redhat.com>, "Michal Koutný" <mkoutny@suse.com>
Cc: 李龙兴 <coregee2000@gmail.com>,
syzkaller@googlegroups.com, tj@kernel.org, josef@toxicpanda.com,
cgroups@vger.kernel.org, linux-block@vger.kernel.org,
linux-kernel@vger.kernel.org, yukuai@fnnas.com
Subject: Re: [Kernel Bug] KASAN: slab-use-after-free Read in __blkcg_rstat_flush
Date: Tue, 3 Feb 2026 07:46:20 -0700 [thread overview]
Message-ID: <00babfab-5bd7-4b66-a765-f7c6689543c7@kernel.dk> (raw)
In-Reply-To: <aYII17gzXXPCTS3p@fedora>
On 2/3/26 7:40 AM, Ming Lei wrote:
> On Tue, Feb 03, 2026 at 03:16:43PM +0100, Michal Koutný wrote:
>> On Tue, Feb 03, 2026 at 10:08:07PM +0800, Ming Lei <ming.lei@redhat.com> wrote:
>>> I can't parse your question, here blkg_release() simply needs to flush
>>> all stats. Why do you talk about preventing new flush? why is it related
>>> with this UAF?
>>
>> What prevents this fix:
>>
>> --- a/block/blk-cgroup.c
>> +++ b/block/blk-cgroup.c
>> @@ -169,14 +169,6 @@ static void __blkg_release(struct rcu_head *rcu)
>> #ifdef CONFIG_BLK_CGROUP_PUNT_BIO
>> WARN_ON(!bio_list_empty(&blkg->async_bios));
>> #endif
>> - /*
>> - * Flush all the non-empty percpu lockless lists before releasing
>> - * us, given these stat belongs to us.
>> - *
>> - * blkg_stat_lock is for serializing blkg stat update
>> - */
>> - for_each_possible_cpu(cpu)
>> - __blkcg_rstat_flush(blkcg, cpu);
>>
>> /* release the blkcg and parent blkg refs this blkg has been holding */
>> css_put(&blkg->blkcg->css);
>> @@ -195,6 +187,15 @@ static void blkg_release(struct percpu_ref *ref)
>> {
>> struct blkcg_gq *blkg = container_of(ref, struct blkcg_gq, refcnt);
>>
>> + /*
>> + * Flush all the non-empty percpu lockless lists before releasing
>> + * us, given these stat belongs to us.
>> + *
>> + * blkg_stat_lock is for serializing blkg stat update
>> + */
>> + for_each_possible_cpu(cpu)
>> + __blkcg_rstat_flush(blkcg, cpu);
>> +
>> call_rcu(&blkg->rcu_head, __blkg_release);
>> }
>
> This one looks more clever, can you send one formal patch?
I'll drop the previous one for now - I didn't really mind it,
but if we can fix it without, then yeah agree that's better.
--
Jens Axboe
prev parent reply other threads:[~2026-02-03 14:46 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-02 6:19 李龙兴
2026-02-03 3:03 ` Ming Lei
2026-02-03 10:54 ` Michal Koutný
2026-02-03 11:11 ` Ming Lei
2026-02-03 12:53 ` Michal Koutný
2026-02-03 14:08 ` Ming Lei
2026-02-03 14:16 ` Michal Koutný
2026-02-03 14:40 ` Ming Lei
2026-02-03 14:46 ` Jens Axboe [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=00babfab-5bd7-4b66-a765-f7c6689543c7@kernel.dk \
--to=axboe@kernel.dk \
--cc=cgroups@vger.kernel.org \
--cc=coregee2000@gmail.com \
--cc=josef@toxicpanda.com \
--cc=linux-block@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=ming.lei@redhat.com \
--cc=mkoutny@suse.com \
--cc=syzkaller@googlegroups.com \
--cc=tj@kernel.org \
--cc=yukuai@fnnas.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®