lkml.org 
[lkml]   [2019]   [Oct]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v4 15/16] module: Move where we mark modules RO,X
On Thu, Oct 24, 2019 at 01:31:15PM -0500, Josh Poimboeuf wrote:

> How about something like this? Completely untested, but if you agree
> with this approach I could hack up kpatch-build to test it properly.
>
> diff --git a/kernel/livepatch/core.c b/kernel/livepatch/core.c
> index ab4a4606d19b..597bf32bc591 100644
> --- a/kernel/livepatch/core.c
> +++ b/kernel/livepatch/core.c
> @@ -239,6 +239,17 @@ static int klp_resolve_symbols(Elf_Shdr *relasec, struct module *pmod)
> if (ret)
> return ret;
>
> + /*
> + * Prevent module patches from using livepatch relas for
> + * vmlinux symbols. Presumably such symbols are exported and
> + * normal relas can instead be used at patch module loading
> + * time.
> + */
> + if (!vmlinux && core_kernel_text(addr)) {
> + pr_err("unsupported livepatch symbol\n");
> + return -EINVAL;
> + }
> +
> sym->st_value = addr;
> }

If that works, this is much simpler and therefore preferred.

\
 
 \ /
  Last update: 2019-10-24 22:34    [W:0.201 / U:1.148 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site