[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aYII17gzXXPCTS3p@fedora>
Date: Tue, 3 Feb 2026 22:40:23 +0800
From: Ming Lei <ming.lei@...hat.com>
To: Michal Koutný <mkoutny@...e.com>
Cc: 李龙兴 <coregee2000@...il.com>,
syzkaller@...glegroups.com, tj@...nel.org, josef@...icpanda.com,
axboe@...nel.dk, cgroups@...r.kernel.org,
linux-block@...r.kernel.org, linux-kernel@...r.kernel.org,
yukuai@...as.com
Subject: Re: [Kernel Bug] KASAN: slab-use-after-free Read in
__blkcg_rstat_flush
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@...hat.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?
Thanks,
Ming
Powered by blists - more mailing lists