linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Chris J Arges <chris.j.arges@canonical.com>
To: live-patching@vger.kernel.org
Cc: Chris J Arges <chris.j.arges@canonical.com>,
	Josh Poimboeuf <jpoimboe@redhat.com>,
	Jessica Yu <jeyu@redhat.com>, Jiri Kosina <jikos@kernel.org>,
	Miroslav Benes <mbenes@suse.cz>, Petr Mladek <pmladek@suse.com>,
	linux-kernel@vger.kernel.org
Subject: [RFC][PATCH] Load/Unload Hooks for Livepatch
Date: Fri, 26 Aug 2016 13:50:26 -0500	[thread overview]
Message-ID: <1472237448-22270-1-git-send-email-chris.j.arges@canonical.com> (raw)

Load/unload hooks will be useful to have when applying livepatches. Today
one can create hooks by writing code in the livepatch init/exit functions
and properly setting up module notifier callbacks to handle various cases.
This can be error prone and unwieldy as we have the proper mechanisms
already in the livepatch proper code.

I've tested this code with some sample livepatch code that exercised the
following:
  - works with single/multiple hooks for both load/unload
  - works if load_hooks/unload_hooks are NULL
  - works if individual hooks are NULL
  - handles bad return values from hooks
  - handles properly when inserting/removing dependent modules
  - can handle load_hook for vmlinux as well

The idea of these hooks are based off of the kpatch project.

Chris J Arges (1):
  livepatch: add load/unload hooks to objects

 include/linux/livepatch.h | 33 +++++++++++++++++++++++++++------
 kernel/livepatch/core.c   | 29 +++++++++++++++++++++++++++++
 2 files changed, 56 insertions(+), 6 deletions(-)

-- 
2.7.4

             reply	other threads:[~2016-08-26 18:51 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-26 18:50 Chris J Arges [this message]
2016-08-26 18:50 ` [PATCH] livepatch: add load/unload hooks to objects Chris J Arges
2016-08-29 15:23   ` Petr Mladek
2016-08-29 16:16     ` Christopher Arges
2016-08-30  9:41       ` Jiri Kosina
2016-08-30 12:52         ` Christopher Arges
2016-08-30 14:43       ` Petr Mladek
2016-08-30 15:15         ` Christopher Arges

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=1472237448-22270-1-git-send-email-chris.j.arges@canonical.com \
    --to=chris.j.arges@canonical.com \
    --cc=jeyu@redhat.com \
    --cc=jikos@kernel.org \
    --cc=jpoimboe@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=live-patching@vger.kernel.org \
    --cc=mbenes@suse.cz \
    --cc=pmladek@suse.com \
    /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).