From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out-179.mta0.migadu.com (out-179.mta0.migadu.com [91.218.175.179]) (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 CA0803590A2 for ; Sun, 22 Feb 2026 23:37:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.179 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771803426; cv=none; b=XzoJUinlINWFsQ6uCz7sNKkw6OUtUBLM20H2CeEvYxyiWdqsvCDFBpEXlv0UX088nPLYffrdCt6/6e9UsksLZDXGsK/Vi75T2S4Vof/UCJok9IfMrrwJdLcIsDleI9K1DKbAOx8L0IVPzkJgOPyW54DQrWp6Z36ZbGHf55VRHCQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771803426; c=relaxed/simple; bh=c5Kg3KMnsJS3sTik9bjBjDGurmNUp8RGzyPPFfEFmWg=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=lw5SF/JoqbI4c1dTaBYZHVB/UKX4TqWXMoapWyLFX/6j9eChwBeDearu2QqNfshYzo8Q+w7J2ehYxxYiRu2LWQ8oMFvfOU/saHazNAq9qemJWrQwbcYkxfQ7ySalu+rUt5ieiqmVdHXTa7Vk5qaJB2ZS7J4nXX9FZ+6xk/uhLag= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=jmzNs2So; arc=none smtp.client-ip=91.218.175.179 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="jmzNs2So" Date: Sun, 22 Feb 2026 15:36:46 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1771803412; 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: in-reply-to:in-reply-to:references:references; bh=ybdV4563dtS4ZOEJOasBlah8k8g9tI2C0k/Ph+ecmnQ=; b=jmzNs2SoD9+RFFddxf4oFJZOTAgJDRPiWKMADSlzPRz1xaIQL6NpjmJr516CT11xADF0Lk 8AEwwQXmBGTiFzH4ztm4iliD7eR1HfJc1g2gRrN+/cHmTeEDQp28M0hMQcCtLw2vrNgx+D PwW6nbXK22WWy2SyFObMjPIkJAF6vIA= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Shakeel Butt To: Harry Yoo Cc: Venkat Rao Bagalkote , Vlastimil Babka , Carlos Maiolino , Johannes Weiner , Michal Hocko , Roman Gushchin , linux-xfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, LKML , Madhavan Srinivasan , Ritesh Harjani , ojaswin@linux.ibm.com, Muchun Song , Cgroups , "linux-mm@kvack.org" , Hao Li Subject: Re: [next-20260216]NULL pointer dereference in drain_obj_stock() (RCU free path) Message-ID: References: Precedence: bulk X-Mailing-List: linux-fsdevel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Migadu-Flow: FLOW_OUT On Sun, Feb 22, 2026 at 08:47:03PM +0900, Harry Yoo wrote: [...] > > It seems it crashed while dereferencing objcg->ref->data->count. > I think that implies that obj_cgroup_release()->percpu_ref_exit() > is already called due to the refcount reaching zero and set > ref->data = NULL. > > Wait, was the stock->objcg ever a valid objcg? > I think it should be valid when refilling the obj stock, otherwise > it should have crashed in refill_obj_stock() -> obj_cgroup_get() path > in the first place, rather than crashing when draining. > > And that sounds like we're somehow calling obj_cgroup_put() more times > than obj_cgroup_get(). > > Anyway, this is my theory that it may be due to mis-refcounting of objcgs. > I have not looked deeper into recent slub changes (sheafs or obj_exts savings) but one thing looks weird to me: allocate_slab() // for cache with SLAB_OBJ_EXT_IN_OBJ -> alloc_slab_obj_exts_early() -> slab_set_stride(slab, s->size) -> account_slab() -> alloc_slab_obj_exts() -> slab_set_stride(slab, sizeof(struct slabobj_ext)); Unconditional overwrite of stride. Not sure if it is issue or even related to this crash but looks odd.