All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ming Lei <ming.lei@redhat.com>
To: "Michal Koutný" <mkoutny@suse.com>
Cc: 李龙兴 <coregee2000@gmail.com>,
	syzkaller@googlegroups.com, tj@kernel.org, josef@toxicpanda.com,
	axboe@kernel.dk, 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 22:40:23 +0800	[thread overview]
Message-ID: <aYII17gzXXPCTS3p@fedora> (raw)
In-Reply-To: <74zggmy53vzdb2q7sidvasnnlih5d5b4rp6jb6ibpka5zg7z7x@enl7iqw4prji>

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?


Thanks, 
Ming


  reply	other threads:[~2026-02-03 14:40 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-02  6:19 [Kernel Bug] KASAN: slab-use-after-free Read in __blkcg_rstat_flush 李龙兴
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 [this message]
2026-02-03 14:46               ` Jens Axboe

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=aYII17gzXXPCTS3p@fedora \
    --to=ming.lei@redhat.com \
    --cc=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=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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.