linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Josh Poimboeuf <jpoimboe@redhat.com>
To: Miroslav Benes <mbenes@suse.cz>
Cc: Jessica Yu <jeyu@redhat.com>,
	Rusty Russell <rusty@rustcorp.com.au>,
	Seth Jennings <sjenning@redhat.com>,
	Jiri Kosina <jikos@kernel.org>, Vojtech Pavlik <vojtech@suse.com>,
	linux-api@vger.kernel.org, live-patching@vger.kernel.org,
	x86@kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [RFC PATCH 0/5] Arch-independent livepatch
Date: Wed, 11 Nov 2015 10:28:10 -0600	[thread overview]
Message-ID: <20151111162809.GD5331@treble.redhat.com> (raw)
In-Reply-To: <alpine.LNX.2.00.1511111456510.12467@pobox.suse.cz>

On Wed, Nov 11, 2015 at 03:00:44PM +0100, Miroslav Benes wrote:
> > Background: Why does livepatch need to write its own relocations?
> > ==
> > A typical livepatch module contains patched versions of functions that can
> > reference non-exported global symbols and non-included local symbols.
> > Relocations referencing these types of symbols cannot be left in as-is
> > since the kernel module loader cannot resolve them and will therefore
> > reject the livepatch module. Furthermore, we cannot apply relocations that
> > affect modules not loaded yet at run time (e.g. a patch to a driver). The
> > current kpatch build system therefore solves this problem by embedding
> > special "dynrela" (dynamic reloc) sections in the resulting patch module
> > elf output. Using these dynrela sections, livepatch can correctly resolve
> > symbols while taking into account its scope and what module the symbol
> > belongs to, and then manually apply the dynamic relocations.
> 
> I'll only add that we solve the problem with kallsyms calls in kGraft. It 
> can get really cumbersome from time to time, so this work would simplify 
> our effort as well.

I haven't yet reviewed the code in-depth, but overall I think this patch
set is a good idea.  It simplifies livepatch itself as well as the patch
creation process (for both kGraft and kpatch-build), so it's a win-win.

-- 
Josh

      reply	other threads:[~2015-11-11 16:28 UTC|newest]

Thread overview: 60+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-10  4:45 [RFC PATCH 0/5] Arch-independent livepatch Jessica Yu
2015-11-10  4:45 ` [RFC PATCH 1/5] elf: add livepatch-specific elf constants Jessica Yu
2015-11-11 13:58   ` Petr Mladek
2015-11-12 15:33   ` Josh Poimboeuf
2015-11-12 15:45   ` Josh Poimboeuf
2015-11-13  6:49     ` Jessica Yu
2015-11-10  4:45 ` [RFC PATCH 2/5] module: save load_info for livepatch modules Jessica Yu
2015-11-11  8:08   ` Minfei Huang
2015-11-11 14:17   ` Miroslav Benes
2015-11-12  5:33     ` Jessica Yu
2015-11-12 10:24       ` Petr Mladek
2015-11-12 13:22         ` Miroslav Benes
2015-11-12 15:03           ` Petr Mladek
2015-11-12 17:05             ` Josh Poimboeuf
2015-11-12 22:17               ` Jessica Yu
2015-11-13 12:24                 ` Miroslav Benes
2015-11-13 12:46                   ` Miroslav Benes
2015-11-14  0:36                     ` Jessica Yu
2015-11-16 12:12                       ` Miroslav Benes
2015-11-13 12:56                   ` Miroslav Benes
2015-11-14  2:09                     ` Jessica Yu
2015-11-16 12:21                       ` Miroslav Benes
2015-11-13  0:25           ` Jessica Yu
2015-11-11 14:31   ` [RFC PATCH 2/5] " Petr Mladek
2015-11-12  4:44     ` Jessica Yu
2015-11-12 10:05       ` Petr Mladek
2015-11-12 14:19         ` Miroslav Benes
2015-11-13  6:35           ` Jessica Yu
2015-11-13 13:07             ` Miroslav Benes
2015-11-13  8:20         ` Jessica Yu
2015-11-12 17:14   ` [RFC PATCH 2/5] " Josh Poimboeuf
2015-11-12 17:21   ` Josh Poimboeuf
2015-11-10  4:45 ` [RFC PATCH 3/5] livepatch: reuse module loader code to write relocations Jessica Yu
2015-11-10  8:13   ` Jiri Slaby
2015-11-11 14:30   ` Miroslav Benes
2015-11-11 20:07     ` Jessica Yu
2015-11-12 15:27       ` Miroslav Benes
2015-11-12 17:40         ` Josh Poimboeuf
2015-11-12 20:22           ` Jessica Yu
2015-11-12 20:32             ` Josh Poimboeuf
2015-11-13  7:15               ` Jessica Yu
2015-11-13 13:51               ` Miroslav Benes
2015-11-12 19:14         ` Jessica Yu
2015-11-12 20:35           ` Jessica Yu
2015-11-11 15:22   ` [RFC PATCH 3/5] " Petr Mladek
2015-11-11 18:27     ` Jessica Yu
2015-11-12  9:16       ` Petr Mladek
2015-11-12 17:59   ` [RFC PATCH 3/5] " Josh Poimboeuf
2015-11-10  4:45 ` [RFC PATCH 4/5] samples: livepatch: init reloc list and mark as klp module Jessica Yu
2015-11-10  8:15   ` Jiri Slaby
2015-11-10 13:50     ` Josh Poimboeuf
2015-11-10 18:37       ` Jessica Yu
2015-11-11 15:42   ` [RFC PATCH 4/5] " Petr Mladek
2015-11-12  6:02     ` Jessica Yu
2015-11-12 10:44       ` Miroslav Benes
2015-11-10  4:45 ` [RFC PATCH 5/5] livepatch: x86: remove unused relocation code Jessica Yu
2015-11-11 15:48   ` Petr Mladek
2015-11-12 18:01     ` Josh Poimboeuf
2015-11-11 14:00 ` [RFC PATCH 0/5] Arch-independent livepatch Miroslav Benes
2015-11-11 16:28   ` Josh Poimboeuf [this message]

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=20151111162809.GD5331@treble.redhat.com \
    --to=jpoimboe@redhat.com \
    --cc=jeyu@redhat.com \
    --cc=jikos@kernel.org \
    --cc=linux-api@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=live-patching@vger.kernel.org \
    --cc=mbenes@suse.cz \
    --cc=rusty@rustcorp.com.au \
    --cc=sjenning@redhat.com \
    --cc=vojtech@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).