From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from stravinsky.debian.org (stravinsky.debian.org [82.195.75.108]) (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 9F1AA448B83 for ; Wed, 29 Jul 2026 10:06:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=82.195.75.108 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785319578; cv=none; b=KpuAitxmFRDEbPi+WMeGjZXilnH2VclCIt5tQBXq8kRykhgIfIUh5HL1dIQuBBntO406f7lPr9iQ2Tb4e6oSd5OD54P0p05LMuDq66RhSYsu47TKYEwchDwZC+LDUBzqG5A6XTyW94us0QuP/7a4MNavmvIsdIqhfBrfMIZst74= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785319578; c=relaxed/simple; bh=b1niEh+XkTrlsLSzTVE8qOiizr6vy5rt2guyaBjPKaE=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=JgXwetOecW2ACLhtXncMWLSK3iQ3/Vu13jy6U/xr6oSOZXAGQ2krY53onDybkimcoQaKFDQNW7NvJ6mKIgWvFCDpqCF9tpAsYBph5z4C6ws3AvL8a+EtXtVbEH/a0mclzp0wNyWkNsY+Zs0EoP9Huv82Fp36zLVHDvKvH33s97U= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=debian.org; spf=pass smtp.mailfrom=debian.org; dkim=pass (2048-bit key) header.d=debian.org header.i=@debian.org header.b=GdsqWJti; arc=none smtp.client-ip=82.195.75.108 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=debian.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=debian.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=debian.org header.i=@debian.org header.b="GdsqWJti" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debian.org; s=smtpauto.stravinsky; h=X-Debian-User:In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=9iL+SllrZlzTBrQ9sGIyew1RUyaFnxriPQEilTP+A9o=; b=GdsqWJtisHlETYtNBXcbmNSB2S rUuVCJoZ4k3In9kqHu4F1Nmpa+tfQXrywf6HctXEq4XTNDTPVXb6+M3W0mp8s0uaOFwsJyGZhbj/m 1alAcgznEggevXE7aHpVdX2SKPAhRfyHethiaqYk9+Ip9jcDzDL9De3tU52/A0ctO2PihvxKg9gL7 7ouquFpa5xHE2tDNDZxbklyYu8wy8RMMR/gC7/BwfAHRBFbDqJVOOZ1tOtx5Mg7kcxXbpi8qL3Euk 1VB0HIoZKVJsPHXnyoFkKz33JL8MX1iOg+2fUgWThZKLlCILNM8aol2fdYvfHHzMw2J+Q59Uo+Lfg 9H2lmT7Q==; Received: from authenticated-user by stravinsky.debian.org with esmtpsa (TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.96) (envelope-from ) id 1wp1Az-008NIv-1q; Wed, 29 Jul 2026 10:06:13 +0000 Date: Wed, 29 Jul 2026 03:06:09 -0700 From: Breno Leitao To: Joshua Crofts Cc: Andreas Hindborg , linux-kernel@vger.kernel.org, syzbot+35790eb7861f8fc57382@syzkaller.appspotmail.com Subject: Re: [PATCH] configfs: fix refcount warning in configfs_get_config_item() Message-ID: References: <20260729085505.1316-1-joshua.crofts1@gmail.com> 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=us-ascii Content-Disposition: inline In-Reply-To: <20260729085505.1316-1-joshua.crofts1@gmail.com> X-Debian-User: leitao On Wed, Jul 29, 2026 at 08:55:05AM +0000, Joshua Crofts wrote: > syzbot reported a "refcount_t: addition on 0; use-after-free" warning > in configfs_get_config_item(). > > This occurs when configfs_get_config_item() races with a concurrent > teardown (e.g. rmdir). When the target config_item's refcount drops to > 0, configfs_get_config_item() calls config_item_get(), which > unconditionally increments the refcount via kref_get(), triggering the > refcount warning. Shouldn't be this the fix we are interested in fixing? > Fix this by using config_item_get_unless_zero(), which safely returns > NULL if the refcount is already 0. This looks like more a workaround than a proper fix, no? I got the impression that we have a UAF behind this refcount issue, and this is not being solved by this patch.