Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

eventfs: Use list_add_tail_rcu() for SRCU-protected children list

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 <devnexen@gmail.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>

authored by

David Carlier and committed by
Steven Rostedt
f67950b2 43cec30c

+1 -1
+1 -1
fs/tracefs/event_inode.c
··· 706 706 707 707 scoped_guard(mutex, &eventfs_mutex) { 708 708 if (!parent->is_freed) 709 - list_add_tail(&ei->list, &parent->children); 709 + list_add_tail_rcu(&ei->list, &parent->children); 710 710 } 711 711 /* Was the parent freed? */ 712 712 if (list_empty(&ei->list)) {