From: Jason Baron <jbaron@akamai.com>
To: linux-kernel@vger.kernel.org, live-patching@vger.kernel.org
Cc: jpoimboe@redhat.com, jeyu@kernel.org, jikos@kernel.org,
mbenes@suse.cz, pmladek@suse.com
Subject: [PATCH v2 0/3] livepatch: introduce atomic replace
Date: Wed, 30 Aug 2017 17:38:42 -0400 [thread overview]
Message-ID: <cover.1504128316.git.jbaron@akamai.com> (raw)
Hi,
In testing livepatch, I found that when doing cumulative patches, if a patched
function is completed reverted by a subsequent patch (back to its original state)
livepatch does not revert the funtion to its original state. Specifically, if
patch A introduces a change to function 1, and patch B reverts the change to
function 1 and introduces changes to say function 2 and 3 as well, the change
that patch A introducd to function 1 is still present. This could be addressed
by first completely removing patch A (disable and then rmmod) and then inserting
patch B (insmod and enable), but this leaves an unpatched window. In discussing
this issue with Josh on the kpatch mailing list, he mentioned that we could get
'atomic replace working properly', and that is the direction of this patchset:
https://www.redhat.com/archives/kpatch/2017-June/msg00005.html
Patches:
1) livepatch: Add klp_object and klp_func dynamic iterators
A prep patch for the 'atomic replace' feature such that dynamic objects
and functions can be allocated.
2) livepatch: add atomic replace
Core feature.
3) livepatch: Add a sysctl livepatch_mode for atomic replace
Introduces a knob for enabling atomic replace. This patch is really only
meant for testing purposes, and should not be considered for application.
The intention is for the livepatch module generator to set the 'replace'
field in the klp_patch structure such that the kernel knows to do the atomic
replace.
Thanks,
-Jason
v1-v2:
-removed the func_iter and obj_iter (Petr Mladek)
-initialiing kobject structure for no_op functions using:
klp_init_object() and klp_init_func()
-added a 'replace' field to klp_patch, similar to the immediate field
-a 'replace' patch now disables all previous patches
-tried to shorten klp_init_patch_no_ops()...
-Simplified logic klp_complete_transition (Petr Mladek)
Jason Baron (3):
livepatch: Add dynamic klp_object and klp_func iterators
livepatch: add atomic replace
livepatch: Add a sysctl livepatch_mode for atomic replace
include/linux/livepatch.h | 108 ++++++++++++++++++++++++-
kernel/livepatch/core.c | 182 +++++++++++++++++++++++++++++++++++++++---
kernel/livepatch/core.h | 5 ++
kernel/livepatch/patch.c | 19 +++--
kernel/livepatch/patch.h | 4 +-
kernel/livepatch/transition.c | 47 ++++++++++-
kernel/sysctl.c | 12 +++
7 files changed, 352 insertions(+), 25 deletions(-)
--
2.6.1
next reply other threads:[~2017-08-30 21:39 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-30 21:38 Jason Baron [this message]
2017-08-30 21:38 ` [PATCH v2 1/3] livepatch: Add dynamic klp_object and klp_func iterators Jason Baron
2017-09-07 12:34 ` Petr Mladek
2017-09-07 16:53 ` Joe Perches
2017-08-30 21:38 ` [PATCH v2 2/3] livepatch: add atomic replace Jason Baron
2017-09-11 13:53 ` Petr Mladek
2017-09-12 3:46 ` Jason Baron
2017-09-12 8:35 ` Petr Mladek
2017-09-13 6:47 ` Jason Baron
2017-09-14 13:32 ` Petr Mladek
2017-09-14 15:31 ` Jason Baron
2017-09-15 15:46 ` Petr Mladek
2017-09-16 0:10 ` Greg KH
2017-08-30 21:38 ` [PATCH v2 3/3] livepatch: Add a sysctl livepatch_mode for " Jason Baron
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=cover.1504128316.git.jbaron@akamai.com \
--to=jbaron@akamai.com \
--cc=jeyu@kernel.org \
--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