aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/livepatch/core.c
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-06-23 13:29:03 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-06-23 13:29:03 +0200
commit90b45399b4418a3542fe096b92840b3bf235e78e (patch)
treea75e3e37503be4fe4c7d718248bd5a844c8705e1 /kernel/livepatch/core.c
parentstaging: rtl8712: Replace function r8712_init_cmd_priv() (diff)
parentLinux 5.2-rc6 (diff)
downloadlinux-dev-90b45399b4418a3542fe096b92840b3bf235e78e.tar.xz
linux-dev-90b45399b4418a3542fe096b92840b3bf235e78e.zip
Merge 5.2-rc6 into staging-next
We want the fixes and this resolves a merge issue as well. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'kernel/livepatch/core.c')
-rw-r--r--kernel/livepatch/core.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/kernel/livepatch/core.c b/kernel/livepatch/core.c
index 2398832947c6..c4ce08f43bd6 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,