diff options
| author | Jason Gunthorpe <jgg@mellanox.com> | 2019-07-02 14:34:43 -0300 |
|---|---|---|
| committer | Jason Gunthorpe <jgg@mellanox.com> | 2019-07-02 14:34:43 -0300 |
| commit | 9ec3f4cb35bc8278f0582fed9f9229c9315c2ffb (patch) | |
| tree | 3ff6a17a33913268a2ed06e7d9a1a95e29eeee97 /kernel/livepatch | |
| parent | c5d6c45e90c49150670346967971e14576afd7f1 (diff) | |
| parent | 6fbc7275c7a9ba97877050335f290341a1fd8dbf (diff) | |
| download | cachepc-linux-9ec3f4cb35bc8278f0582fed9f9229c9315c2ffb.tar.gz cachepc-linux-9ec3f4cb35bc8278f0582fed9f9229c9315c2ffb.zip | |
Merge tag 'v5.2-rc7' into rdma.git hmm
Required for dependencies in the next patches.
Diffstat (limited to 'kernel/livepatch')
| -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 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, |
