summaryrefslogtreecommitdiffstats
path: root/kernel/trace
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2021-02-02 13:13:25 +0100
committerJessica Yu <jeyu@kernel.org>2021-02-08 12:21:40 +0100
commita006050575745ca2be25118b90f1c37f454ac542 (patch)
tree443ebee9efd98b83825c939c1a8879613ac32561 /kernel/trace
parent089049f6c9956c5cf1fc89fe10229c76e99f4bef (diff)
downloadlinux-stable-a006050575745ca2be25118b90f1c37f454ac542.tar.gz
linux-stable-a006050575745ca2be25118b90f1c37f454ac542.tar.bz2
linux-stable-a006050575745ca2be25118b90f1c37f454ac542.zip
module: use RCU to synchronize find_module
Allow for a RCU-sched critical section around find_module, following the lower level find_module_all helper, and switch the two callers outside of module.c to use such a RCU-sched critical section instead of module_mutex. Reviewed-by: Petr Mladek <pmladek@suse.com> Acked-by: Miroslav Benes <mbenes@suse.cz> Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Jessica Yu <jeyu@kernel.org>
Diffstat (limited to 'kernel/trace')
-rw-r--r--kernel/trace/trace_kprobe.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/kernel/trace/trace_kprobe.c b/kernel/trace/trace_kprobe.c
index e6fba1798771..3137992baa5e 100644
--- a/kernel/trace/trace_kprobe.c
+++ b/kernel/trace/trace_kprobe.c
@@ -124,9 +124,9 @@ static nokprobe_inline bool trace_kprobe_module_exist(struct trace_kprobe *tk)
if (!p)
return true;
*p = '\0';
- mutex_lock(&module_mutex);
+ rcu_read_lock_sched();
ret = !!find_module(tk->symbol);
- mutex_unlock(&module_mutex);
+ rcu_read_unlock_sched();
*p = ':';
return ret;