aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/module.c
diff options
context:
space:
mode:
authorDivya Indi <divya.indi@oracle.com>2019-08-14 10:55:24 -0700
committerSteven Rostedt (VMware) <rostedt@goodmis.org>2019-11-13 09:37:29 -0500
commite585e6469d6f476b82aa148dc44aaf7ae269a4e2 (patch)
treea165cec89202db3d956b465a055fadfa92c792b7 /kernel/module.c
parenttracing: Declare newly exported APIs in include/linux/trace.h (diff)
downloadlinux-dev-e585e6469d6f476b82aa148dc44aaf7ae269a4e2.tar.xz
linux-dev-e585e6469d6f476b82aa148dc44aaf7ae269a4e2.zip
tracing: Verify if trace array exists before destroying it.
A trace array can be destroyed from userspace or kernel. Verify if the trace array exists before proceeding to destroy/remove it. Link: http://lkml.kernel.org/r/1565805327-579-3-git-send-email-divya.indi@oracle.com Reviewed-by: Aruna Ramakrishna <aruna.ramakrishna@oracle.com> Signed-off-by: Divya Indi <divya.indi@oracle.com> [ Removed unneeded braces ] Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Diffstat (limited to '')
-rw-r--r--kernel/module.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/kernel/module.c b/kernel/module.c
index ff2d7359a418..6e2fd40a6ed9 100644
--- a/kernel/module.c
+++ b/kernel/module.c
@@ -3728,7 +3728,6 @@ static int complete_formation(struct module *mod, struct load_info *info)
module_enable_ro(mod, false);
module_enable_nx(mod);
- module_enable_x(mod);
/* Mark state as coming so strong_try_module_get() ignores us,
* but kallsyms etc. can see us. */
@@ -3751,6 +3750,11 @@ static int prepare_coming_module(struct module *mod)
if (err)
return err;
+ /* Make module executable after ftrace is enabled */
+ mutex_lock(&module_mutex);
+ module_enable_x(mod);
+ mutex_unlock(&module_mutex);
+
blocking_notifier_call_chain(&module_notify_list,
MODULE_STATE_COMING, mod);
return 0;