From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 9B5823FF1BB for ; Fri, 15 May 2026 15:36:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778859412; cv=none; b=aNZsgBhgbQLCAd/aW2fuLiJKnTF9HNnRdRjrGXe0wyx0Z4wMcYmjNVsX7HKHYR7uV/QAuljEqkgPnGgXd3Dsh6OyWEpAAs2lhV6eZlKiblSic7CSCu0TvkKZuy47Zrf+cxJopJolrYjDbTsVpoK+hrUmsE5MCT40CLo3tjM3Evg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778859412; c=relaxed/simple; bh=rTcoDDk84QPE+2EFN0buvH8efefAu5SDcl8NblmwY2g=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=gtCJ2pfVmyDFhqsBOenrjUJJFBhMJj4V60isQs3GIjwimLe1/HXEpfDqHfsyPGMraPW1w7w0+Sf/feZ868fIPwIk05LnnoCLIYkLqkqYfWWtur/1GUXoGqzchwnmiTJ4b3o4FtQel+ekJ7hfJLv8JQys8rozLNx80Wwohh752bM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Qarw71Wp; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Qarw71Wp" Received: by smtp.kernel.org (Postfix) with ESMTPSA id B482FC2BCC9; Fri, 15 May 2026 15:36:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1778859412; bh=rTcoDDk84QPE+2EFN0buvH8efefAu5SDcl8NblmwY2g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Qarw71WpYiTNsPf6R+op6v/1DiNy1NY6pBqKpj7wo9TokVX/W91tY+rXaYRWLhbNe 0jGJ34D/YKymOaNGXl8w6/1j8nhxehauQeWtCisyKM72eoJLcAHwzagAMEX0QiCEL4 di6tiZ3AZA14wHDBUtWius0UaYilk41oTyKBupKvf0Crr8zdoAFRMXDxM8VCAOGwXN J/t+ngheFaM3rQzh5u0X6nu19a3Nnx3mhKS9h3SbjTLNULCWpAnpmVtYH0jxh/p8W0 JTF34aoKZkdFpqRJAGdexzvTfF7kLRIXuVEeKYFcQh4Y98T7WXC0e7/lU9AtoB1Iq0 26VL11AeyuspA== From: Sasha Levin To: stable@vger.kernel.org Cc: David Carlier , Steven Rostedt , Sasha Levin Subject: [PATCH 6.18.y] eventfs: Use list_add_tail_rcu() for SRCU-protected children list Date: Fri, 15 May 2026 11:36:49 -0400 Message-ID: <20260515153649.3315091-1-sashal@kernel.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <2026051233-marauding-delete-836e@gregkh> References: <2026051233-marauding-delete-836e@gregkh> Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: David Carlier [ Upstream commit f67950b2887fa10df50c4317a1fe98a65bc6875b ] Commit d2603279c7d6 ("eventfs: Use list_del_rcu() for SRCU protected list variable") converted the removal side to pair with the list_for_each_entry_srcu() walker in eventfs_iterate(). The insertion in eventfs_create_dir() was left as a plain list_add_tail(), which on weakly-ordered architectures can expose a new entry to the SRCU reader before its list pointers and fields are observable. Use list_add_tail_rcu() so the publication pairs with the existing list_del_rcu() and list_for_each_entry_srcu(). Fixes: 43aa6f97c2d0 ("eventfs: Get rid of dentry pointers without refcounts") Cc: stable@vger.kernel.org Link: https://patch.msgid.link/20260418152251.199343-1-devnexen@gmail.com Signed-off-by: David Carlier Signed-off-by: Steven Rostedt [ adapted scoped_guard(mutex, &eventfs_mutex) block to explicit mutex_lock()/mutex_unlock() pair ] Signed-off-by: Sasha Levin --- fs/tracefs/event_inode.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/tracefs/event_inode.c b/fs/tracefs/event_inode.c index 0d2bc92b760f3..02d56ed6ad20e 100644 --- a/fs/tracefs/event_inode.c +++ b/fs/tracefs/event_inode.c @@ -732,7 +732,7 @@ struct eventfs_inode *eventfs_create_dir(const char *name, struct eventfs_inode mutex_lock(&eventfs_mutex); if (!parent->is_freed) - list_add_tail(&ei->list, &parent->children); + list_add_tail_rcu(&ei->list, &parent->children); mutex_unlock(&eventfs_mutex); /* Was the parent freed? */ -- 2.53.0