From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 857F72D5C86 for ; Tue, 3 Feb 2026 14:40:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770129644; cv=none; b=cR/10C9v/tp6T0HC9OIZideFA/vjVjWXXkQj8kNplriYk1DMbJ0e5h8Sw9fr/x/eNqDSmLzbT4EJnR8Gwyd63SKDn8Eotj9lDuIA1DF6i/mCBChbJzb80jyDAVS9hDRPmq1kpH1s5B8M4AC/at2GajaaOV83dQo//A31EmUcIfc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770129644; c=relaxed/simple; bh=gzADKnZnshWmlCett9WUmEgFJ73tJpuHtH0nAg1R+T0=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=X8QA42DEFU9NVRADRolgMc3SE/GFt9FIa8XH9UYz4oZqyXJMTtP49X5pPLZf33BWvASRubQWN6zqXQl420Yf87Tkh48xHHG2JGDqo5ZJqOpgFIThoZ9WnVmV2cF9iiow8l2EAw9e29RZWydDaC8jZAteWKBE7IP8dSfzDogi5G4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=VnBGtc5P; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="VnBGtc5P" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1770129642; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=H/nnbujEPK1lQRC/VY41UZ05KgAH7I2xmKiWW/7cFeI=; b=VnBGtc5Pqx4JJmY909sr9AO0XVd2bpdgVX4GoXt2K5IE/gSuzqlx5tUTbZryH6qu7R75xB QqJKtHiBvHIvS4jmsD29qJHOHLjTKwulVmOHN2jGCuRifTXHZ1Eb4nn1QmBWu7WQBtRbnn CDJ6IDuQZWdH1NCuk82IHfYUkQulYWE= Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-85-puqqbEFcPZuegfmJDwGq1g-1; Tue, 03 Feb 2026 09:40:37 -0500 X-MC-Unique: puqqbEFcPZuegfmJDwGq1g-1 X-Mimecast-MFC-AGG-ID: puqqbEFcPZuegfmJDwGq1g_1770129635 Received: from mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.111]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 590581800372; Tue, 3 Feb 2026 14:40:35 +0000 (UTC) Received: from fedora (unknown [10.72.116.35]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 435A01800577; Tue, 3 Feb 2026 14:40:28 +0000 (UTC) Date: Tue, 3 Feb 2026 22:40:23 +0800 From: Ming Lei To: Michal =?iso-8859-1?Q?Koutn=FD?= Cc: =?utf-8?B?5p2O6b6Z5YW0?= , 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 Message-ID: References: <74zggmy53vzdb2q7sidvasnnlih5d5b4rp6jb6ibpka5zg7z7x@enl7iqw4prji> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <74zggmy53vzdb2q7sidvasnnlih5d5b4rp6jb6ibpka5zg7z7x@enl7iqw4prji> X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.111 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 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