Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1465228

Re: [PATCH v3 0/3] Fix issue with alternatives/paravirt patches

From Miroslav Benes <mbenes@suse.cz>
Newsgroups linux.kernel
Subject Re: [PATCH v3 0/3] Fix issue with alternatives/paravirt patches
Date 2016-08-18 14:50 +0200
Message-ID <s7uVH-8hT-9@gated-at.bofh.it> (permalink)
References <s7jQB-wM-5@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Wed, 17 Aug 2016, Jessica Yu wrote:

> Hi,
> 
> A few months ago, Chris Arges reported a bug involving alternatives/paravirt
> patching that was discussed here [1] and here [2]. To briefly summarize the
> bug, patch modules that contained .altinstructions or .parainstructions
> sections would break because these alternative/paravirt patches would be
> applied first by the module loader (see x86 module_finalize()), then
> livepatch would later clobber these patches when applying per-object
> relocations. This lead to crashes and unpredictable behavior.
> 
> One conclusion we reached from our last discussion was that we will
> need to introduce some arch-specific code to address this problem.
> This patchset presents a possible fix for the bug by adding a new
> arch-specific arch_klp_init_object_loaded() function that by default
> does nothing but can be overridden by different arches.
> 
> To fix this issue for x86, since we can access a patch module's Elf
> sections through mod->klp_info, we can simply delay the calls to
> apply_paravirt() and apply_alternatives() to arch_klp_init_object_loaded(),
> which is called after relocations have been written for an object.
> In addition, for patch modules, .parainstructions and .altinstructions are
> prefixed by ".klp.arch.${objname}" so that the module loader ignores them
> and livepatch can apply them manually.
> 
> Currently for kpatch, we don't support including jump table sections in
> the patch module, and supporting .smp_locks is currently broken, so we
> don't consider those sections (for now).
> 
> I did some light testing with some patches to kvm and verified that the
> original issue reported in [2] was fixed.
> 
> Based on linux-next.

For the whole patch set

Acked-by: Miroslav Benes <mbenes@suse.cz>

Thanks
Miroslav

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v3 0/3] Fix issue with alternatives/paravirt patches Jessica Yu <jeyu@redhat.com> - 2016-08-18 03:00 +0200
  [PATCH v3 2/3] livepatch/x86: apply alternatives and paravirt patches after relocations Jessica Yu <jeyu@redhat.com> - 2016-08-18 03:00 +0200
    Re: [PATCH v3 2/3] livepatch/x86: apply alternatives and paravirt  patches after relocations Petr Mladek <pmladek@suse.com> - 2016-08-18 12:00 +0200
      Re: livepatch/x86: apply alternatives and paravirt patches after  relocations Jessica Yu <jeyu@redhat.com> - 2016-08-19 03:20 +0200
        Re: livepatch/x86: apply alternatives and paravirt patches after  relocations Petr Mladek <pmladek@suse.com> - 2016-08-19 10:40 +0200
  [PATCH v3 1/3] livepatch: use arch_klp_init_object_loaded() to finish arch-specific tasks Jessica Yu <jeyu@redhat.com> - 2016-08-18 03:00 +0200
    Re: [PATCH v3 1/3] livepatch: use arch_klp_init_object_loaded() to  finish arch-specific tasks Petr Mladek <pmladek@suse.com> - 2016-08-18 12:00 +0200
  Re: [PATCH v3 0/3] Fix issue with alternatives/paravirt patches Miroslav Benes <mbenes@suse.cz> - 2016-08-18 14:50 +0200
  Re: [PATCH v3 0/3] Fix issue with alternatives/paravirt patches Jiri Kosina <jikos@kernel.org> - 2016-08-19 03:30 +0200

csiph-web