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 485173FF1D8 for ; Fri, 15 May 2026 15:55:43 +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=1778860543; cv=none; b=shSBoPOxnjjkRjtR82sg/WdUPGzEX+H7KiTKvoPjknG8p09dHiHOJGvpESN5fBKLkywfavYI6PUwxm5aezjWXDmBxLHxG5YayW/gnz55WEwxtvkfm3LXtP/ociNCyvY9ueVI0TrmaJpNbxlP58iXOW83d++o2/BRCFJCORMg/jQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778860543; c=relaxed/simple; bh=rTcoDDk84QPE+2EFN0buvH8efefAu5SDcl8NblmwY2g=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=V1MXVY/sS4QRZ40LrCsegwm5DsTRSo/p7QonjJz4zFGD1o4zLFOX7W2bjqWkL45Px9cGGYYXufj3Jf0KIUL6y+IkrP3Hghvcatrgl5ZyfMTMNVhXnQhupGmPiyTmgbBCCMdT6t71IstDP9E6VzPX5kipakeE2ILaIDmAi9HNEpk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=gtIatV/+; 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="gtIatV/+" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8B4C9C2BCB0; Fri, 15 May 2026 15:55:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1778860543; bh=rTcoDDk84QPE+2EFN0buvH8efefAu5SDcl8NblmwY2g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=gtIatV/+Yo7qoD2T/kA9DRUARdbRMBP9SvYma+BAiUzGHHLOgd6kqv/3ycLhUyfCO hpmLlj5ryTGYaBK9hPOmd7WpjqSOfIcicUAC84qbom5XXI0VijJf0FjdxWtmZD/pnn KZ/YbrizOjhSJ9H610joYwVF2F8yl8Wo3ajQy3GgmyjzFK+kKHU+NmjFmPFM6Hceig 6TcIwOFwnhjvH/r9jqC9+pcoB9DPmEMiPnUK8rWKMEAgs/JPe1jwzsu40hCKTytTNL D9nqzu326z1x6FU5YfZiIeSV4qXhNP5pbD96ylpbmmD5MvJZ7SZHYgjJBaOZ21hVE9 fflIbyeq+B49g== From: Sasha Levin To: stable@vger.kernel.org Cc: David Carlier , Steven Rostedt , Sasha Levin Subject: [PATCH 6.12.y] eventfs: Use list_add_tail_rcu() for SRCU-protected children list Date: Fri, 15 May 2026 11:55:40 -0400 Message-ID: <20260515155540.3359697-1-sashal@kernel.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <2026051233-jiffy-shore-14d3@gregkh> References: <2026051233-jiffy-shore-14d3@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