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 5F7283F44E7 for ; Fri, 15 May 2026 16:16:38 +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=1778861798; cv=none; b=rtSK8JDDWdHbHt4BQBghHc1IJ0dpqmqFEoGjsDyfJg5VCtUq5ozPyv8GAouUnxXVlpw+CihDM64KDiAR3B6Wdctnjs0Nu8cbq7kS6b4pORmTuziji2JXC6TUCQApNViw1pT8cIGmkN/v0GS1c56VtuCUbFPwxHyhrpGCnBP24JI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778861798; c=relaxed/simple; bh=nNvA4ZCM/eDqM2HkogeljSs5/51ufgIIELsLbIId+UE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=cN1cASDP/X1SCRcDDb6bcDyB9wTxyUEueijSaEEX3PwutcVVpaKthCckhmfC8urotj8bLniiVs0YG59y+rIintp0ZYOLYz8WEcE5wUb3b2Xd7JuNGYPcs9m/5xvjAkrdYzb7KgiSucfsobDt+OZ73kERXyExThD3+X+jp3ft1X0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=oGDybfMa; 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="oGDybfMa" Received: by smtp.kernel.org (Postfix) with ESMTPSA id BF5FAC2BCB0; Fri, 15 May 2026 16:16:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1778861798; bh=nNvA4ZCM/eDqM2HkogeljSs5/51ufgIIELsLbIId+UE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=oGDybfMand8xYUyOxi3bQH5Delnjo6xbMj/A/nWR0+JNXvHVlHDhANhIOTGaajRl/ 1ZdYHL0ZE2S7UceukTnVhW/AevAH/P3cuJld0XxlGPppo/JicgSmTiDsIKZACi75XL Y5afbpaMS5trHqviQEFaE5okwXy44SOUxwm1EwbJ5y6jLmxAwI0jsfnJbcrNzqSV68 FV+9dStJVablz1zrEAdZnif0fktNS0jF0sihgHXgjrgrjLy7GJNQ43iLZiFBQIx93V Bk6SA4KqQL9uzLE+cR2y3pqqOdxFGpOZHDBdH7OzyvCtY9E52oGYeDo7BBRebe6EpA 832jZAE4pMeZQ== From: Sasha Levin To: stable@vger.kernel.org Cc: David Carlier , Steven Rostedt , Sasha Levin Subject: [PATCH 6.6.y] eventfs: Use list_add_tail_rcu() for SRCU-protected children list Date: Fri, 15 May 2026 12:16:33 -0400 Message-ID: <20260515161633.3376096-1-sashal@kernel.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <2026051233-swerve-muskiness-378f@gregkh> References: <2026051233-swerve-muskiness-378f@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 4190e61550449..9dc59edfc5ec8 100644 --- a/fs/tracefs/event_inode.c +++ b/fs/tracefs/event_inode.c @@ -800,7 +800,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