[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <11723c83107129047d3b9e5d5a026b14dce6d391.1587131959.git.jpoimboe@redhat.com>
Date: Fri, 17 Apr 2020 09:04:33 -0500
From: Josh Poimboeuf <jpoimboe@...hat.com>
To: live-patching@...r.kernel.org
Cc: linux-kernel@...r.kernel.org,
Peter Zijlstra <peterz@...radead.org>,
Jessica Yu <jeyu@...nel.org>
Subject: [PATCH v2 8/9] livepatch: Remove module_disable_ro() usage
With arch_klp_init_object_loaded() gone, and apply_relocate_add() now
using text_poke(), livepatch no longer needs to use module_disable_ro().
The text_mutex usage can also be removed -- its purpose was to protect
against module permission change races.
Acked-by: Peter Zijlstra (Intel) <peterz@...radead.org>
Signed-off-by: Josh Poimboeuf <jpoimboe@...hat.com>
---
kernel/livepatch/core.c | 8 --------
1 file changed, 8 deletions(-)
diff --git a/kernel/livepatch/core.c b/kernel/livepatch/core.c
index a090185e8689..3ff886b911ae 100644
--- a/kernel/livepatch/core.c
+++ b/kernel/livepatch/core.c
@@ -767,10 +767,6 @@ static int klp_init_object_loaded(struct klp_patch *patch,
struct klp_modinfo *info = patch->mod->klp_info;
if (klp_is_module(obj)) {
-
- mutex_lock(&text_mutex);
- module_disable_ro(patch->mod);
-
/*
* Only write module-specific relocations here
* (.klp.rela.{module}.*). vmlinux-specific relocations were
@@ -782,10 +778,6 @@ static int klp_init_object_loaded(struct klp_patch *patch,
patch->mod->core_kallsyms.strtab,
info->symndx, patch->mod,
obj->name);
-
- module_enable_ro(patch->mod, true);
- mutex_unlock(&text_mutex);
-
if (ret)
return ret;
}
--
2.21.1
Powered by blists - more mailing lists