]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
eventfs: Use SRCU for freeing eventfs_inodes
authorMathias Krause <minipli@grsecurity.net>
Tue, 23 Jul 2024 21:07:53 +0000 (23:07 +0200)
committerSteven Rostedt (Google) <rostedt@goodmis.org>
Wed, 7 Aug 2024 23:28:48 +0000 (19:28 -0400)
To mirror the SRCU lock held in eventfs_iterate() when iterating over
eventfs inodes, use call_srcu() to free them too.

This was accidentally(?) degraded to RCU in commit 43aa6f97c2d0
("eventfs: Get rid of dentry pointers without refcounts").

Cc: Ajay Kaher <ajay.kaher@broadcom.com>
Cc: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/20240723210755.8970-1-minipli@grsecurity.net
Fixes: 43aa6f97c2d0 ("eventfs: Get rid of dentry pointers without refcounts")
Signed-off-by: Mathias Krause <minipli@grsecurity.net>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
fs/tracefs/event_inode.c

index a9c28a1d5dc82402814efdb05913b2c773040430..01e99e98457ddbf35f04f9702ab0f8d15f81f35f 100644 (file)
@@ -112,7 +112,7 @@ static void release_ei(struct kref *ref)
                        entry->release(entry->name, ei->data);
        }
 
-       call_rcu(&ei->rcu, free_ei_rcu);
+       call_srcu(&eventfs_srcu, &ei->rcu, free_ei_rcu);
 }
 
 static inline void put_ei(struct eventfs_inode *ei)