diff options
author | Ingo Molnar <mingo@kernel.org> | 2019-06-24 19:25:52 +0200 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2019-06-24 19:25:52 +0200 |
commit | b9271f0c65e12efd9b6319f57a378aac1be98b22 (patch) | |
tree | 923cd44cd4e1568d3abf2b8d69b4a4712e01f8ef /kernel/livepatch/core.c | |
parent | a3664a74a0aa0b11d8d4ade04984965b77d14d44 (diff) | |
parent | 4b972a01a7da614b4796475f933094751a295a2f (diff) |
Merge tag 'v5.2-rc6' into perf/core, to refresh branch
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'kernel/livepatch/core.c')
-rw-r--r-- | kernel/livepatch/core.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/kernel/livepatch/core.c b/kernel/livepatch/core.c index 2398832947c6a..c4ce08f43bd63 100644 --- a/kernel/livepatch/core.c +++ b/kernel/livepatch/core.c @@ -18,6 +18,7 @@ #include <linux/elf.h> #include <linux/moduleloader.h> #include <linux/completion.h> +#include <linux/memory.h> #include <asm/cacheflush.h> #include "core.h" #include "patch.h" @@ -718,16 +719,21 @@ static int klp_init_object_loaded(struct klp_patch *patch, struct klp_func *func; int ret; + mutex_lock(&text_mutex); + module_disable_ro(patch->mod); ret = klp_write_object_relocations(patch->mod, obj); if (ret) { module_enable_ro(patch->mod, true); + mutex_unlock(&text_mutex); return ret; } arch_klp_init_object_loaded(patch, obj); module_enable_ro(patch->mod, true); + mutex_unlock(&text_mutex); + klp_for_each_func(obj, func) { ret = klp_find_object_symbol(obj->name, func->old_name, func->old_sympos, |