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 69AA43A63EB for ; Tue, 3 Feb 2026 14:08:27 +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=1770127709; cv=none; b=Q3pQAE9o1iq8X7/tklPqon+qUqwLkBYv4I9lgn9F+ij4F8hg38dPHRjgZKthAsHy3F5zlVJ7Vw4WQi+4GRIquOKRukbBWivjxfXgw1xjOWQc+LurRM8jp+sfm3qUo1OhzVcm0aybxMmdqbVoeqHUm1hZh3/xsU8XxsUEUT9ufdg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770127709; c=relaxed/simple; bh=eFlFuS35sO+2MxnOmBZjU/WCcv1Q3blX+r1MsIMzRCk=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=IHXG9csYd6gEPWRa4y0Dg1C1UVDWjf3gVfjuDEv5Pvv0osb2VXVhlm0tUKH37SIyHtqg1UYNNffyGSltChBeCSLmTdhX7KjcPGO7A0/0xMU8GlibT0H/GqVVgh7MrrZl/Kk1r4fQooE1GiZJ/LxY92iXgGAsgXexNBU/8eNZhxg= 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=VJbCqeA5; 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="VJbCqeA5" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1770127706; 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=FbTsR4y5gPUMx2z7X8415ZTujJFmeurjHL+sbGjeZX0=; b=VJbCqeA5qLl4vzgWILidY59ezGFHWmp7p7SBeFfgq4OOy0EmTzq/WEchHeUcS9puSlOcnK P2VCserDPOTqBv9hnP/5OwegZQVkFxWFw6tT9gAfMEra25FKtrV4KahDC6JF/vgMXRngn0 Zl7q365SCwosQSGbB3xA7h0gUMAcmWM= Received: from mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-659-3EKy4Sm3MyCrGXA0dtIWHw-1; Tue, 03 Feb 2026 09:08:23 -0500 X-MC-Unique: 3EKy4Sm3MyCrGXA0dtIWHw-1 X-Mimecast-MFC-AGG-ID: 3EKy4Sm3MyCrGXA0dtIWHw_1770127701 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (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-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id E424D1954B0B; Tue, 3 Feb 2026 14:08:20 +0000 (UTC) Received: from fedora (unknown [10.72.116.35]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 7504C1956053; Tue, 3 Feb 2026 14:08:12 +0000 (UTC) Date: Tue, 3 Feb 2026 22:08:07 +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: 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: X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 On Tue, Feb 03, 2026 at 01:53:40PM +0100, Michal Koutný wrote: > On Tue, Feb 03, 2026 at 07:11:11PM +0800, Ming Lei wrote: > > RCU supports this way, here is just 2-stage RCU chain, and everything > > is deterministic. > > The time when RCU callback runs is noisy, moreover when chained after > each other. > (I don't mean it doesn't work but it's debugging/testing nuisance. And > it also looks awkward.) IMO it is one correct & simple fix for this complicated race. > > > I thought about this way, but ->lqueued is lockless, and in theory the `blkg_iostat_set` > > can be added again after WRITE_ONCE(bisc->lqueued, false) happens, so this way looks > > fragile. > > Right, I brushed up on the cycles from the commit 20cb1c2fb7568 > ("blk-cgroup: Flush stats before releasing blkcg_gq") and it'd be a step > back. > > Does anything prevent doing the each-cpu flush in blkg_release() (before > __blkg_release())? 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? Thanks, Ming