All of lore.kernel.org
 help / color / mirror / Atom feed
From: Miroslav Benes <mbenes@suse.cz>
To: Jessica Yu <jeyu@redhat.com>
Cc: Josh Poimboeuf <jpoimboe@redhat.com>,
	Petr Mladek <pmladek@suse.com>, Jiri Kosina <jikos@kernel.org>,
	Chris J Arges <chris.j.arges@canonical.com>,
	Eugene Shatokhin <eugene.shatokhin@rosalab.ru>,
	live-patching@vger.kernel.org, x86@kernel.org,
	linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3 0/3] Fix issue with alternatives/paravirt patches
Date: Thu, 18 Aug 2016 14:48:21 +0200 (CEST)	[thread overview]
Message-ID: <alpine.LNX.2.00.1608181447270.20901@pobox.suse.cz> (raw)
In-Reply-To: <1471481911-5003-1-git-send-email-jeyu@redhat.com>

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

  parent reply	other threads:[~2016-08-18 12:48 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-18  0:58 [PATCH v3 0/3] Fix issue with alternatives/paravirt patches Jessica Yu
2016-08-18  0:58 ` [PATCH v3 1/3] livepatch: use arch_klp_init_object_loaded() to finish arch-specific tasks Jessica Yu
2016-08-18  9:53   ` Petr Mladek
2016-08-18  0:58 ` [PATCH v3 2/3] livepatch/x86: apply alternatives and paravirt patches after relocations Jessica Yu
2016-08-18  9:51   ` Petr Mladek
2016-08-18 18:03     ` Jessica Yu
2016-08-19  8:32       ` Petr Mladek
2016-08-18  0:58 ` [PATCH v3 3/3] Documentation: livepatch: add section about arch-specific code Jessica Yu
2016-08-18  9:57   ` Petr Mladek
2016-08-18 18:06     ` Jessica Yu
2016-08-18 12:48 ` Miroslav Benes [this message]
2016-08-18 21:46 ` [PATCH v3 0/3] Fix issue with alternatives/paravirt patches Jiri Kosina

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.LNX.2.00.1608181447270.20901@pobox.suse.cz \
    --to=mbenes@suse.cz \
    --cc=chris.j.arges@canonical.com \
    --cc=eugene.shatokhin@rosalab.ru \
    --cc=jeyu@redhat.com \
    --cc=jikos@kernel.org \
    --cc=jpoimboe@redhat.com \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=live-patching@vger.kernel.org \
    --cc=pmladek@suse.com \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.