All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3 0/2] livepatch: introduce atomic replace
@ 2017-09-28  3:41 Jason Baron
  2017-09-28  3:41 ` [PATCH v3 1/2] livepatch: Add dynamic klp_object and klp_func iterators Jason Baron
                   ` (3 more replies)
  0 siblings, 4 replies; 28+ messages in thread
From: Jason Baron @ 2017-09-28  3:41 UTC (permalink / raw)
  To: linux-kernel, live-patching; +Cc: jpoimboe, jeyu, jikos, mbenes, pmladek

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 introduced 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. Note that __klp_enable_patch() calls klp_add_nops(), which
necessitated moving a bunch of existing functions before __klp_enable_patch().
So there is a bit of churn in moving functions that are not modified.

Thanks,

-Jason

v2-v3:
-refactor how the dynamic nops are calculated (Petr Mladek)
-move the creation of dynamic nops to enable/disable paths
-add klp_replaced_patches list to indicate patches that can be re-enabled
-dropped 'replaced' field
-renamed dynamic fields in klp_func, object and patch
-moved iterator implementation to kernel/livepatch/core.c
-'inherit' nop immediate flag
-update kobject_put free'ing logic (Petr Mladek)

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 (2):
  livepatch: Add dynamic klp_object and klp_func iterators
  livepatch: add atomic replace

 include/linux/livepatch.h     |  85 +++--
 kernel/livepatch/core.c       | 738 ++++++++++++++++++++++++++++++++----------
 kernel/livepatch/core.h       |   6 +
 kernel/livepatch/patch.c      |  22 +-
 kernel/livepatch/patch.h      |   4 +-
 kernel/livepatch/transition.c |  50 ++-
 6 files changed, 685 insertions(+), 220 deletions(-)

-- 
2.6.1

^ permalink raw reply	[flat|nested] 28+ messages in thread

end of thread, other threads:[~2017-10-20  9:03 UTC | newest]

Thread overview: 28+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-09-28  3:41 [PATCH v3 0/2] livepatch: introduce atomic replace Jason Baron
2017-09-28  3:41 ` [PATCH v3 1/2] livepatch: Add dynamic klp_object and klp_func iterators Jason Baron
2017-10-06 21:22   ` Josh Poimboeuf
2017-10-10 15:15     ` Jason Baron
2017-10-11  2:51       ` Josh Poimboeuf
2017-10-16 14:47         ` Miroslav Benes
2017-09-28  3:41 ` [PATCH v3 2/2] livepatch: add atomic replace Jason Baron
2017-10-06 22:32   ` Josh Poimboeuf
2017-10-10 17:27     ` Jason Baron
2017-10-17  9:02       ` Miroslav Benes
2017-10-17 13:50         ` Miroslav Benes
2017-10-18  3:33           ` Jason Baron
2017-10-18  9:10             ` Miroslav Benes
2017-10-18 11:05               ` Josh Poimboeuf
2017-10-18 11:29                 ` Miroslav Benes
2017-10-18 11:25               ` Petr Mladek
2017-10-19 21:44                 ` Jason Baron
2017-10-20  7:44                   ` Petr Mladek
2017-10-20  8:59                 ` Miroslav Benes
2017-10-18 13:36               ` Jiri Kosina
2017-10-18 16:14                 ` Josh Poimboeuf
2017-10-19  8:30                   ` Miroslav Benes
2017-10-19 10:57                     ` Josh Poimboeuf
2017-10-19 21:52               ` Jason Baron
2017-10-20  9:03                 ` Miroslav Benes
2017-10-17 14:27         ` Petr Mladek
2017-10-10 17:19 ` [PATCH v3.1 2/3] livepatch: shuffle core.c function order Jason Baron
2017-10-10 17:19 ` [PATCH v3.1 3/3] livepatch: add atomic replace Jason Baron

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.