Re: [PATCH v10 00/10] livepatch: Atomic replace feature

2018-03-12 Thread Joe Lawrence
this isn't the direction we want to go for proper kselftests, but perhaps it saves you some time/sanity for verifying this patchset. Hope this helps, -- Joe -- >8 -- >8 -- >8 -- >8 -- >From 0364430c53e12e21923bed20cb651374b4cf9ba9 Mon Sep 17 00:00:00 2001 From: Joe Lawrence Date: Tue, 6

[PATCH] Add livepatch kselftests

2018-03-28 Thread Joe Lawrence
/livepatch - Renamed livepatch.sh (filename suffix) - Reduced between-test delay time - Split off common functions.sh file - Split into separate livepatch, callbacks, and shadow-vars scrips - Gave the tests short descriptions instead of TEST1, TEST2, etc. Joe Lawrence (1): selftests/livepatch: i

[PATCH] selftests/livepatch: introduce tests

2018-03-28 Thread Joe Lawrence
Add a few livepatch modules and simple target modules that the included regression suite can run tests against. Signed-off-by: Joe Lawrence --- lib/Kconfig.debug | 12 + lib/Makefile | 2 + lib/livepatch/Makefile

Re: [PATCH v10 00/10] livepatch: Atomic replace feature

2018-03-08 Thread Joe Lawrence
On 03/08/2018 10:01 AM, Petr Mladek wrote: > On Wed 2018-03-07 16:55:53, Joe Lawrence wrote: >> Running against v10, callbacks seem to be good up until I disable an >> atomic replace patch. My understanding is that the original patch's >> unpatch callbacks should be skipp

[PATCH v4 0/1] Add livepatch kselftests

2018-04-25 Thread Joe Lawrence
fc: - SPDX-License-Identifiers - Moved livepatch test modules into lib/livepatch - Renamed livepatch.sh (filename suffix) - Reduced between-test delay time - Split off common functions.sh file - Split into separate livepatch, callbacks, and shadow-vars scrips - Gave the tests short descriptions inst

[PATCH v4 1/1] selftests/livepatch: introduce tests

2018-04-25 Thread Joe Lawrence
Add a few livepatch modules and simple target modules that the included regression suite can run tests against: - basic livepatching (multiple patches, atomic replace) - pre/post (un)patch callbacks - shadow variable API Signed-off-by: Joe Lawrence --- Documentation/livepatch

Re: [PATCH v4 0/1] Add livepatch kselftests

2018-04-26 Thread Joe Lawrence
>On 04/25/2018 02:28 PM, Joe Lawrence wrote: > [ ... snip ... ] > > base-commit: 0adb32858b0bddf4ada5f364a84ed60b196dbcda > prerequisite-patch-id: 5ed747c1a89a5dc4bba08186e21f927d7f3bf049 > prerequisite-patch-id: e9800288b71a9f339ea066e58d9ef70dece67083 >

Re: [PATCH v4 0/1] Add livepatch kselftests

2018-05-10 Thread Joe Lawrence
On Fri, May 11, 2018 at 10:53:24AM +0800, Ye Xiaolong wrote: > Hi, Joe > > Sorry for the late response. Hi Xiaolong, no worries... > On 04/26, Joe Lawrence wrote: > >>On 04/25/2018 02:28 PM, Joe Lawrence wrote: > > > >> [ .

Re: [PATCH v4 1/3] livepatch: add (un)patch callbacks

2017-08-29 Thread Joe Lawrence
On 08/29/2017 11:49 AM, Josh Poimboeuf wrote: > On Fri, Aug 25, 2017 at 03:10:00PM -0400, Joe Lawrence wrote: >> +Test 6 >> +-- >> + >> +Test a scenario where a vmlinux pre-patch callback returns a non-zero >> +status (ie, failure): >> + >> +- lo

Re: [PATCH v4 1/3] livepatch: add (un)patch callbacks

2017-08-30 Thread Joe Lawrence
On Tue, Aug 29, 2017 at 02:59:12PM -0500, Josh Poimboeuf wrote: > On Tue, Aug 29, 2017 at 03:22:06PM -0400, Joe Lawrence wrote: > > On 08/29/2017 11:49 AM, Josh Poimboeuf wrote: > > > On Fri, Aug 25, 2017 at 03:10:00PM -0400, Joe Lawrence wrote: > > >> +Test 6 > &

[PATCH v5 0/3] livepatch callbacks

2017-08-31 Thread Joe Lawrence
: 'livepatch_callbacks_demo': unpatching complete % rmmod samples/livepatch/livepatch-callbacks-demo.ko % rmmod samples/livepatch/livepatch-callbacks-mod.ko [ 100.986947] livepatch_callbacks_mod: livepatch_callbacks_mod_exit -- Joe Joe Lawrence (3): livepatch: add (un)patch callbacks live

[PATCH v5 2/3] livepatch: move transition "complete" notice into klp_complete_transition()

2017-08-31 Thread Joe Lawrence
transition() and into klp_complete_transition(). Suggested-by: Josh Poimboeuf Signed-off-by: Joe Lawrence --- kernel/livepatch/transition.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/kernel/livepatch/transition.c b/kernel/livepatch/transition.c index 7bf55b7f3687..53887f0bca10 100644 --

[PATCH v5 3/3] livepatch: add transition notices

2017-08-31 Thread Joe Lawrence
as the above messages. Suggested-by: Josh Poimboeuf Signed-off-by: Joe Lawrence --- kernel/livepatch/transition.c | 18 +- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/kernel/livepatch/transition.c b/kernel/livepatch/transition.c index 53887f0bca10..3d44a3cf27be 100644

[PATCH v5 1/3] livepatch: add (un)patch callbacks

2017-08-31 Thread Joe Lawrence
include modification of global data and registration of newly available services/handlers. See Documentation/livepatch/callbacks.txt for details and samples/livepatch/ for examples. Signed-off-by: Joe Lawrence --- Documentation/livepatch/callbacks.txt | 594

Re: [PATCH 2/8] kbuild: Support for Symbols.list creation

2017-08-31 Thread Joe Lawrence
Hi Joao, A few nitpicks in-line below... On Tue, Aug 29, 2017 at 04:01:34PM -0300, Joao Moreira wrote: > For automatic resolution of livepatch relocations, a file called > Symbols.list is used. This file maps symbols within every compiled > kernel object allowing the identification of symbols

[PATCH v6] Livepatch shadow variables

2017-08-31 Thread Joe Lawrence
mutual exclusion Joe Lawrence (1): livepatch: introduce shadow variable API Documentation/livepatch/shadow-vars.txt | 192 + include/linux/livepatch.h | 8 + kernel/livepatch/Makefile | 2 +- kernel/livepatch/shadow.c

[PATCH v6] livepatch: introduce shadow variable API

2017-08-31 Thread Joe Lawrence
ate shadow variables. Signed-off-by: Joe Lawrence --- Documentation/livepatch/shadow-vars.txt | 192 + include/linux/livepatch.h | 8 + kernel/livepatch/Makefile | 2 +- kernel/livepatch/shadow.c | 277 +

[PATCH v3] add (un)patch callbacks

2017-08-16 Thread Joe Lawrence
ed [ 102.977392] % rmmod samples/livepatch/livepatch-callbacks-demo.ko Part 1: Livepatch is loaded first, so vmlinux callbacks run Part 2: The livepatch's pre-patch-callback is setup to now return -ENODEV Part 3: When a targetted module is loaded, the pre-patch-callback returns -ENODEV an

[PATCH v3] livepatch: add (un)patch callbacks

2017-08-16 Thread Joe Lawrence
include modification of global data and registration of newly available services/handlers. See Documentation/livepatch/callback.txt for details. Signed-off-by: Joe Lawrence --- Documentation/livepatch/callbacks.txt| 87 include/linux/livepatch.h| 81

Re: [PATCH v4] livepatch: introduce shadow variable API

2017-08-17 Thread Joe Lawrence
On 08/17/2017 10:05 AM, Petr Mladek wrote: > On Mon 2017-08-14 16:02:43, Joe Lawrence wrote: >> Add exported API for livepatch modules: >> >> klp_shadow_get() >> klp_shadow_attach() >> klp_shadow_get_or_attach() >> klp_shadow_up

Re: [PATCH v4] livepatch: introduce shadow variable API

2017-08-18 Thread Joe Lawrence
On 08/17/2017 10:05 AM, Petr Mladek wrote: > On Mon 2017-08-14 16:02:43, Joe Lawrence wrote: >> [ ... snip ... ] >> diff --git a/samples/livepatch/livepatch-shadow-fix1.c >> b/samples/livepatch/livepatch-shadow-fix1.c >> new file mode 100644 >> index 00

Re: [PATCH v4] livepatch: introduce shadow variable API

2017-08-18 Thread Joe Lawrence
On 08/18/2017 10:04 AM, Petr Mladek wrote: > On Fri 2017-08-18 15:44:29, Nicolai Stange wrote: >> Joe Lawrence writes: >> >> >>> + >>> +/** >>> + * klp_shadow_get() - retrieve a shadow variable data pointer >>> + * @obj: pointer

Re: [PATCH v4] livepatch: introduce shadow variable API

2017-08-18 Thread Joe Lawrence
On 08/17/2017 10:05 AM, Petr Mladek wrote: > On Mon 2017-08-14 16:02:43, Joe Lawrence wrote: >> [ ... snip ... ] >> +/* Allocate a new shadow variable for use inside the lock below */ >> +new_shadow = kzalloc(size + sizeof(*new_shadow), gfp_flags); > > We sh

[PATCH v2] livepatch: unpatch all klp_objects if klp_module_coming fails

2017-10-02 Thread Joe Lawrence
objects fails to patch, klp_module_coming()'s error path needs to unpatch and cleanup any kernel objects that were already patched by a previous patch. Reported-by: Miroslav Benes Suggested-by: Petr Mladek Signed-off-by: Joe Lawrence --- v2: - cleanup comment describing the new function - s

[PATCH v2 3/3] pipe: add proc_dopipe_max_size() to safely assign pipe_max_size

2017-10-02 Thread Joe Lawrence
ng the new value from the user buffer, verifying bounds, and calling round_pipe_size() with a single assignment to pipe_max_size. Reported-by: Mikulas Patocka Signed-off-by: Joe Lawrence --- v2: - Fix !CONFIG_PROC_SYSCTL build case fs/pipe.c | 16 ++-- inc

[PATCH v6 2/3] livepatch: move transition "complete" notice into klp_complete_transition()

2017-10-13 Thread Joe Lawrence
transition() and into klp_complete_transition(). Suggested-by: Josh Poimboeuf Signed-off-by: Joe Lawrence Acked-by: Miroslav Benes Reviewed-by: Petr Mladek --- kernel/livepatch/transition.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/kernel/livepatch/transition.c b/kernel/livepatch/transiti

[PATCH v6 3/3] livepatch: add transition notices

2017-10-13 Thread Joe Lawrence
as the above messages. Suggested-by: Josh Poimboeuf Signed-off-by: Joe Lawrence Acked-by: Miroslav Benes --- kernel/livepatch/transition.c | 18 +- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/kernel/livepatch/transition.c b/kernel/livepatch/transition.c index 53887f0bca10

[PATCH v6 1/3] livepatch: add (un)patch callbacks

2017-10-13 Thread Joe Lawrence
include modification of global data and registration of newly available services/handlers. See Documentation/livepatch/callbacks.txt for details and samples/livepatch/ for examples. Signed-off-by: Joe Lawrence --- Documentation/livepatch/callbacks.txt | 605

[PATCH v6 0/3] livepatch callbacks

2017-10-13 Thread Joe Lawrence
ist to a single per-klp_object instance - revamp the sample callback demo - revamp documentation Joe Lawrence (3): livepatch: add (un)patch callbacks livepatch: move transition "complete" notice into klp_complete_transition() livepatch: add transition notices Documentation/livepatch/

Re: [PATCH v3 0/4] A few round_pipe_size() and pipe-max-size fixups

2017-10-16 Thread Joe Lawrence
On 10/10/2017 02:04 PM, Joe Lawrence wrote: > While backporting Michael's "pipe: fix limit handling" patchset to a > distro-kernel, Mikulas noticed that current upstream pipe limit handling > contains a few problems: > > 1 - procfs signed wrap: echo'ing a large number

[PATCH] livepatch: unpatch all klp_objects if klp_module_coming fails

2017-09-28 Thread Joe Lawrence
objects fails to patch, klp_module_coming()'s error path needs to unpatch and cleanup any kernel objects that were already patched by a previous patch. Reported-by: Miroslav Benes Suggested-by: Petr Mladek Signed-off-by: Joe Lawrence --- v1: - separated this patch from the klp_callbacks

Re: [PATCH v2 0/7] pipe: buffer limits fixes and cleanups

2018-01-11 Thread Joe Lawrence
pipe: simplify round_pipe_size() > pipe: read buffer limits atomically > > fs/pipe.c | 57 > --- > include/linux/pipe_fs_i.h | 5 ++--- > include/linux/sysctl.h| 3 --- > kernel/sysctl.c | 33 +-- > 4 files changed, 32 ins

Re: [PATCH RFC 2/3] pipe: protect pipe_max_size access with a mutex

2017-09-19 Thread Joe Lawrence
On 09/19/2017 03:53 AM, Mikulas Patocka wrote: > On Fri, 15 Sep 2017, Joe Lawrence wrote: > [ ... snip ... ] >> Hi Mikulas, >> >> I'm not strong when it comes to memory barriers, but one of the >> side-effects of using the mutex is that pipe_set_size() and &g

Re: [PATCH RFC 2/3] pipe: protect pipe_max_size access with a mutex

2017-09-19 Thread Joe Lawrence
On 09/14/2017 07:09 PM, Mikulas Patocka wrote: > On Tue, 5 Sep 2017, Joe Lawrence wrote: > >> pipe_max_size is assigned directly via procfs sysctl: >> >> static struct ctl_table fs_table[] = { >> ... >> { >>

Re: [RFC] livepatch: unpatch all klp_objects if klp_module_coming fails

2017-09-20 Thread Joe Lawrence
On Wed, Sep 20, 2017 at 01:19:05PM +0200, Miroslav Benes wrote: > On Wed, 13 Sep 2017, Joe Lawrence wrote: > > > Hi Miroslav, > > Hi, > > sorry for the late response. I'm also travelling now and we have SUSECon > conference next week, so just a quick answer.

Re: [PATCH v3] livepatch: introduce shadow variable API

2017-08-10 Thread Joe Lawrence
On Thu, Aug 10, 2017 at 04:40:05PM +0200, Miroslav Benes wrote: > > It generally looks ok. Only few questions below... > > [...] > > > +In-flight parent objects > > + > > + ps_lock = klp_shadow_get_or_attach(sta, PS_LOCK, > > + _lock_fallback,

[PATCH v5] shadow variables

2017-08-21 Thread Joe Lawrence
() and klp_shadow_free_all() - Samples: Fix use-after-free in memory leak fix modules - Doc: Simplify code in sta_info_free() use-case Joe Lawrence (1): livepatch: introduce shadow variable API Documentation/livepatch/shadow-vars.txt | 191 +++ include/linux/livepatch.h

[PATCH v5] livepatch: introduce shadow variable API

2017-08-21 Thread Joe Lawrence
ate shadow variables. Signed-off-by: Joe Lawrence --- Documentation/livepatch/shadow-vars.txt | 191 +++ include/linux/livepatch.h | 8 + kernel/livepatch/Makefile | 2 +- kernel/livepatch/shadow.c | 295 +

Re: [PATCH v3] livepatch: add (un)patch callbacks

2017-08-21 Thread Joe Lawrence
On Fri, Aug 18, 2017 at 03:58:16PM +0200, Petr Mladek wrote: > On Wed 2017-08-16 15:17:04, Joe Lawrence wrote: > > Provide livepatch modules a klp_object (un)patching notification > > mechanism. Pre and post-(un)patch callbacks allow livepatch modules to > > setup o

[PATCH v4 2/3] livepatch: move transition "complete" notice into klp_complete_transition()

2017-08-25 Thread Joe Lawrence
transition() and into klp_complete_transition(). Signed-off-by: Joe Lawrence Suggested-by: Josh Poimboeuf --- kernel/livepatch/transition.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/kernel/livepatch/transition.c b/kernel/livepatch/transition.c index 7bf55b7f3687..53887f0bca10 100644 --

[PATCH v4 3/3] livepatch: add transition notices

2017-08-25 Thread Joe Lawrence
as the above messages. Signed-off-by: Joe Lawrence Suggested-by: Josh Poimboeuf --- kernel/livepatch/transition.c | 18 +- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/kernel/livepatch/transition.c b/kernel/livepatch/transition.c index 53887f0bca10..3d44a3cf27be 100644

[PATCH v4 1/3] livepatch: add (un)patch callbacks

2017-08-25 Thread Joe Lawrence
include modification of global data and registration of newly available services/handlers. See Documentation/livepatch/callbacks.txt for details and samples/livepatch/ for examples. Signed-off-by: Joe Lawrence --- Documentation/livepatch/callbacks.txt | 595

[PATCH v4 0/3] livepatch callbacks

2017-08-25 Thread Joe Lawrence
operations. Note that these two patches could be standalone, I include them here in this patchset since they affect the content/ordering of kernel logs that were included as part of the Documentation. Joe Lawrence (3): livepatch: add (un)patch callbacks livepatch: move transiti

[PATCH v2 0/1] add (un)patch callbacks

2017-08-08 Thread Joe Lawrence
() and klp_module_coming/going() - reduce callbacks from a list to a single per-klp_object instance - revamp the sample callback demo - revamp documentation Feedback appreciated as always. Joe Lawrence (1): livepatch: add (un)patch callbacks Documentation/livepatch/callbacks.txt| 75

[PATCH v2 1/1] livepatch: add (un)patch callbacks

2017-08-08 Thread Joe Lawrence
include modification of global data and registration of newly available services/handlers. See Documentation/livepatch/callback.txt for details. Signed-off-by: Joe Lawrence --- Documentation/livepatch/callbacks.txt| 75 +++ include/linux/livepatch.h| 38

[PATCH RFC 0/3] A few round_pipe_size() and pipe-max-size fixups

2017-09-05 Thread Joe Lawrence
ue. Patch 3 - procfs signed wrap Before: % echo 2147483647 >/proc/sys/fs/pipe-max-size % cat /proc/sys/fs/pipe-max-size -2147483648 After: % echo 2147483647 >/proc/sys/fs/pipe-max-size % cat /proc/sys/fs/pipe-max-size 2147483648 Joe Lawrence (3): pipe: avoid round

[PATCH RFC 2/3] pipe: protect pipe_max_size access with a mutex

2017-09-05 Thread Joe Lawrence
Reported-by: Mikulas Patocka Signed-off-by: Joe Lawrence --- fs/pipe.c | 28 1 file changed, 24 insertions(+), 4 deletions(-) diff --git a/fs/pipe.c b/fs/pipe.c index fa28910b3c59..33bb11b0d78e 100644 --- a/fs/pipe.c +++ b/fs/pipe.c @@ -35,6 +35,11 @@ unsigned int pip

[PATCH RFC 1/3] pipe: avoid round_pipe_size() nr_pages overflow on 32-bit

2017-09-05 Thread Joe Lawrence
size value, and update callers to handle accordingly. Reported-by: Mikulas Patocka Signed-off-by: Joe Lawrence --- fs/pipe.c | 18 -- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/fs/pipe.c b/fs/pipe.c index 97e5be897753..fa28910b3c59 100644 --- a/fs/pipe

[PATCH RFC 3/3] pipe: match pipe_max_size data type with procfs

2017-09-05 Thread Joe Lawrence
s/fs/pipe-max-size -2147483648 Use unsigned operations on this variable to avoid such negative values. Reported-by: Mikulas Patocka Signed-off-by: Joe Lawrence --- fs/pipe.c | 2 +- kernel/sysctl.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/pipe.c b/fs

Re: [PATCH v3] livepatch: introduce shadow variable API

2017-08-14 Thread Joe Lawrence
On 08/11/2017 12:35 PM, Josh Poimboeuf wrote: > On Fri, Jul 28, 2017 at 01:25:22PM -0400, Joe Lawrence wrote: >> Add exported API for livepatch modules: >> >> klp_shadow_get() >> klp_shadow_attach() >> klp_shadow_get_or_attach() >> klp_shadow_up

Re: [PATCH v2 1/1] livepatch: add (un)patch callbacks

2017-08-14 Thread Joe Lawrence
On 08/11/2017 04:44 PM, Josh Poimboeuf wrote: > On Tue, Aug 08, 2017 at 03:36:07PM -0400, Joe Lawrence wrote: >> +++ b/Documentation/livepatch/callbacks.txt >> @@ -0,0 +1,75 @@ >> +(Un)patching Callbacks >> +== >> + >> +Livepatch

[PATCH v4] livepatch: introduce shadow variable API

2017-08-14 Thread Joe Lawrence
or example modules that demonstrate shadow variables. Signed-off-by: Joe Lawrence --- Documentation/livepatch/shadow-vars.txt | 215 + include/linux/livepatch.h | 10 + kernel/livepatch/Makefile | 2 +- kernel/livepatch/shadow.c

[PATCH v4] livepatch: shadow variables

2017-08-14 Thread Joe Lawrence
(), klp_shadow_set(), klp_shadow_add() - add "caller should hold lock" comments - Documentation - remove unnecessary klp_shadow_get() call in use-case - s/its shadow variable lifetimes/their shadow variables lifetimes/ Joe Lawrence (1): livepatch: introduce shadow variable API Doc

Re: [PATCH v4] livepatch: introduce shadow variable API

2017-08-16 Thread Joe Lawrence
On 08/16/2017 08:43 AM, Miroslav Benes wrote: > >> [ ... snip ... ] > > There is a comment above about locking and we do not take the spinlock > here. That could surprise someone. So I'd keep only klp_shadow_add() > comment, because there it is strictly needed. It depends on the context in >

[RFC] livepatch: unpatch all klp_objects if klp_module_coming fails

2017-09-13 Thread Joe Lawrence
atch-callbacks-demo3.ko % rmmod samples/livepatch/livepatch-callbacks-demo2.ko % rmmod samples/livepatch/livepatch-callbacks-demo.ko -->8-- -->8-- -->8-- -->8-- -->8-- -->8-- -->8-- -->8-- -->8-- -->8-- >From b80b90cb54b498d2b1165d409ce4b0ca47610b36 Mon Sep 17 00

Re: [PATCH RFC 0/3] A few round_pipe_size() and pipe-max-size fixups

2017-09-14 Thread Joe Lawrence
On 09/14/2017 12:57 PM, Randy Dunlap wrote: > On 09/14/17 06:26, Michael Kerrisk (man-pages) wrote: >> Hello Joe, >> >> On 5 September 2017 at 16:44, Joe Lawrence wrote: >>> While backporting Michael's "pipe: fix limit handling" [1] patchset to a >>

Re: [PATCH RFC 2/3] pipe: protect pipe_max_size access with a mutex

2017-09-15 Thread Joe Lawrence
On 09/14/2017 07:09 PM, Mikulas Patocka wrote: > On Tue, 5 Sep 2017, Joe Lawrence wrote: >> pipe_max_size is assigned directly via procfs sysctl: >> >> static struct ctl_table fs_table[] = { >> ... >> { >>

Re: [PATCH] livepatch: __klp_shadow_get_or_alloc() is local to shadow.c

2017-09-15 Thread Joe Lawrence
gt; *data, > size_t size, gfp_t gfp_flags, bool warn_on_exist) > { > struct klp_shadow *new_shadow; > -- > 1.8.5.6 Acked-by: Joe Lawrence Thanks for cleaning this up, Jiri. Also thanks to Miroslav, Petr, Nicolai and Josh for the patchset reviews! -- Joe

Re: [PATCH] livepatch: add (un)patch hooks

2017-07-27 Thread Joe Lawrence
On 07/20/2017 12:17 AM, Josh Poimboeuf wrote: > - The pre-patch and pre-unpatch hooks can be run before the > patching/unpatching process begins. Hi Josh, By "(un)patching process" are you referring to the klp_patch at large or each klp_object? ie, would all klp_objects execute their hooks

[PATCH v3] livepatch: shadow variables

2017-07-28 Thread Joe Lawrence
erhaul usage/comments, drop the verbose dmesg logs Joe Lawrence (1): livepatch: introduce shadow variable API Documentation/livepatch/shadow-vars.txt | 217 + include/linux/livepatch.h | 10 + kernel/livepatch/Makefile | 2 +- kernel/livepa

[PATCH v3] livepatch: introduce shadow variable API

2017-07-28 Thread Joe Lawrence
or exmaple modules that demonstrate shadow variables. Signed-off-by: Joe Lawrence --- Documentation/livepatch/shadow-vars.txt | 217 + include/linux/livepatch.h | 10 + kernel/livepatch/Makefile | 2 +- kernel/livepatch/shadow.c

Re: [PATCH] livepatch: add (un)patch hooks

2017-07-28 Thread Joe Lawrence
On 07/27/2017 05:36 PM, Josh Poimboeuf wrote: > On Thu, Jul 27, 2017 at 04:43:58PM -0400, Joe Lawrence wrote: >> On 07/20/2017 12:17 AM, Josh Poimboeuf wrote: >>> - The post-patch and post-unpatch hooks will need to be run from either >>> klp_complete_transition()

[PATCH v3] selftests/livepatch: introduce tests

2018-04-12 Thread Joe Lawrence
Add a few livepatch modules and simple target modules that the included regression suite can run tests against. Signed-off-by: Joe Lawrence --- Documentation/livepatch/callbacks.txt | 487 - lib/Kconfig.debug | 12 + lib/Makefile

[PATCH v3] Add livepatch kselftests

2018-04-12 Thread Joe Lawrence
safely https://lkml.kernel.org/r/20180405122315.29065-1-pmla...@suse.com which have been combined into a git tree, then branched: https://github.com/joe-lawrence/linux/tree/klp_kselftest_base https://github.com/joe-lawrence/linux/tree/klp_kselftest_v3 so that the kbuild test robot could verify

Re: [PATCH v3] selftests/livepatch: introduce tests

2018-04-13 Thread Joe Lawrence
On 04/13/2018 07:20 AM, Miroslav Benes wrote: > Hi, > > On Thu, 12 Apr 2018, Joe Lawrence wrote: > >> Add a few livepatch modules and simple target modules that the included >> regression suite can run tests against. > > Could you include a brief description whi

[PATCH v2] Add livepatch kselftests

2018-04-10 Thread Joe Lawrence
livepatch.sh (filename suffix) - Reduced between-test delay time - Split off common functions.sh file - Split into separate livepatch, callbacks, and shadow-vars scrips - Gave the tests short descriptions instead of TEST1, TEST2, etc. Joe Lawrence (1): selftests/livepatch: introduce tests

[PATCH v2] selftests/livepatch: introduce tests

2018-04-10 Thread Joe Lawrence
Add a few livepatch modules and simple target modules that the included regression suite can run tests against. Signed-off-by: Joe Lawrence --- Documentation/livepatch/callbacks.txt | 487 - lib/Kconfig.debug | 12 + lib/Makefile

Re: [PATCH v2] selftests/livepatch: introduce tests

2018-04-10 Thread Joe Lawrence
On 04/10/2018 04:00 PM, Josh Poimboeuf wrote: > On Tue, Apr 10, 2018 at 11:15:54AM -0400, Joe Lawrence wrote: >> +static void test_klp_shadow_vars_exit(void) >> +{ >> +} >> + >> +module_init(test_klp_shadow_vars_init); >> +module_init(test_klp_shadow

Re: [PATCH v3] selftests/livepatch: introduce tests

2018-04-17 Thread Joe Lawrence
On 04/17/2018 04:06 AM, Miroslav Benes wrote: > On Mon, 16 Apr 2018, Petr Mladek wrote: > >> On Mon 2018-04-16 13:33:55, Miroslav Benes wrote: >>> On Fri, 13 Apr 2018, Joe Lawrence wrote: >>>> Thanks for reviewing. I'll hold off on posting v4 until Petr (and >

Re: [PATCH v3] selftests/livepatch: introduce tests

2018-04-23 Thread Joe Lawrence
On Fri, Apr 20, 2018 at 02:56:05PM +0200, Libor Pechacek wrote: > Hi Joe, > > I know I am late to the party, yet have some questions about the code. Hi Libor, I'm planning another version, so you're comments are not too late! > On Thu 12-04-18 10:54:31, Joe Lawrence wrote: &

Re: [PATCH v3] selftests/livepatch: introduce tests

2018-04-24 Thread Joe Lawrence
On 04/23/2018 10:43 AM, Joe Lawrence wrote: > On Fri, Apr 20, 2018 at 02:56:05PM +0200, Libor Pechacek wrote: >> On Thu 12-04-18 10:54:31, Joe Lawrence wrote: >>> + fi >>> + echo "$ret" > /dev/kmsg >>> +} >>> + >>> +# unload_

Re: [PATCH] selftests/livepatch: introduce tests

2018-04-08 Thread Joe Lawrence
On Fri, Apr 06, 2018 at 09:36:46PM -0500, Josh Poimboeuf wrote: > On Wed, Mar 28, 2018 at 03:49:48PM -0400, Joe Lawrence wrote: > > Add a few livepatch modules and simple target modules that the included > > regression suite can run tests against. > > > >

[PATCH 2/2] sched/debug: adjust newlines for better alignment

2018-03-19 Thread Joe Lawrence
16 16:15:06 localhost kernel: runnable tasks: Mar 16 16:15:06 localhost kernel: S task PID tree-key ... Signed-off-by: Joe Lawrence --- kernel/sched/debug.c | 27 --- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/kernel/sched/deb

[PATCH 0/2] small scheduler debug stat fixups

2018-03-19 Thread Joe Lawrence
didn't suffer from these issues and its output remains unchanged by this patchset. Joe Lawrence (2): sched/debug: fix per-task line continuation for console sched/debug: adjust newlines for better alignment kernel/sched/debug.c | 29 + 1 file changed, 17 insertions

[PATCH 1/2] sched/debug: fix per-task line continuation for console

2018-03-19 Thread Joe Lawrence
runnable tasks: ... [ 106.716329] Scpuhp/537 2006.31502614 120 0.00 0.496893 0.00 0 0 / Signed-off-by: Joe Lawrence --- kernel/sched/debug.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/sched/debug.

Re: [PATCH 1/2] sched/debug: fix per-task line continuation for console

2018-03-19 Thread Joe Lawrence
On 03/19/2018 04:17 PM, Peter Zijlstra wrote: > On Mon, Mar 19, 2018 at 02:35:54PM -0400, Joe Lawrence wrote: >> When the SEQ_printf() macro prints to the console, it runs a simple >> printk() without KERN_CONT "continued" line printing. The result of >>

Re: [PATCH v10 00/10] livepatch: Atomic replace feature

2018-03-07 Thread Joe Lawrence
On 03/07/2018 03:20 AM, Petr Mladek wrote: > The atomic replace allows to create cumulative patches. They > are useful when you maintain many livepatches and want to remove > one that is lower on the stack. In addition it is very useful when > more patches touch the same function and there are

Re: [PATCH v8 8/8] livepatch: Atomic replace and cumulative patches documentation

2018-02-23 Thread Joe Lawrence
On 02/23/2018 05:41 AM, Miroslav Benes wrote: > On Wed, 21 Feb 2018, Petr Mladek wrote: > >> User documentation for the atomic replace feature. It makes it easier >> to maintain livepatches using so-called cumulative patches. >> >> Signed-off-by: Petr Mladek > > Acked-by: Miroslav Benes > >

[PATCH v0 2/3] livepatch: update documentation/samples for callbacks

2018-02-23 Thread Joe Lawrence
Update livepatch callback documentation and samples with respect to new atomic replace / cumulative patch functionality. Signed-off-by: Joe Lawrence --- Documentation/livepatch/callbacks.txt | 102 samples/livepatch/Makefile| 1 + samples/livepatch

[PATCH v0 1/3] livepatch: add sample cumulative patch

2018-02-23 Thread Joe Lawrence
Add a simple atomic replace / cumulative livepatch example. Signed-off-by: Joe Lawrence --- samples/livepatch/Makefile | 1 + samples/livepatch/livepatch-cumulative.c | 216 +++ 2 files changed, 217 insertions(+) create mode 100644 samples/livepatch

[PATCH v0 3/3] livepatch: update documentation for shadow variables

2018-02-23 Thread Joe Lawrence
Update livepatch shadow variable documentation with respect to new atomic replace / cumulative patch functionality. Signed-off-by: Joe Lawrence --- Documentation/livepatch/shadow-vars.txt | 24 1 file changed, 24 insertions(+) diff --git a/Documentation/livepatch

[PATCH v0 0/3] additional cumulative livepatch doc/samples

2018-02-23 Thread Joe Lawrence
some kind. Having regression tests would ease the burden of reviewing patches and accounting for all these use cases! Hope these help, let me know if you'd like any modification or other tests. Joe Lawrence (3): livepatch: add sample cumulative patch livepatch: update documentation/samples for

Re: [PATCH v8 7/8] livepatch: Correctly handle atomic replace for not yet loaded modules

2018-03-02 Thread Joe Lawrence
On 03/01/2018 05:28 AM, Petr Mladek wrote: > On Thu 2018-02-22 22:00:28, Miroslav Benes wrote: >> On Wed, 21 Feb 2018, Petr Mladek wrote: >>> This patch allows the late initialization. >>> >>> diff --git a/kernel/livepatch/core.c b/kernel/livepatch/core.c >>> index ad508a86b2f9..da1438d47d83

Re: [PATCH v0 2/3] livepatch: update documentation/samples for callbacks

2018-03-02 Thread Joe Lawrence
On 03/02/2018 06:11 AM, Petr Mladek wrote: > On Tue 2018-02-27 09:58:40, Joe Lawrence wrote: >> In my mind, atomic replace is the mechanism that forces patching to be >> cumulative. Perhaps this is too strict? Are there other use-cases for >> atomic-replace? > &g

Re: [PATCH v0 2/3] livepatch: update documentation/samples for callbacks

2018-02-27 Thread Joe Lawrence
On 02/27/2018 07:36 AM, Miroslav Benes wrote: > On Fri, 23 Feb 2018, Joe Lawrence wrote: > >> [ ... snip ... ] >> >> +If a livepatch is replaced by a cumulative patch, then only the >> +callbacks belonging to the cumulative patch will be executed. This >&g

Re: [PATCH v5 0/2] kprobes: improve error handling when arming/disarming kprobes

2018-02-13 Thread Joe Lawrence
Was this patch ever picked up in the tip tree? (Maybe I'm not looking in the right branch?) Thanks, -- Joe On 01/19/2018 02:06 AM, Masami Hiramatsu wrote: > Hi Ingo, > > Could you pick this to tip tree? > > Thank you, > > On Wed, 10 Jan 2018 00:51:22 +0100 > Jessica Yu wrote: > >> Hi, >>

Re: [PATCH v7 7/7] livepatch: Atomic replace and cumulative patches documentation

2018-02-06 Thread Joe Lawrence
On Tue, Feb 06, 2018 at 11:34:24AM +0100, Petr Mladek wrote: > User documentation for the atomic replace feature. It makes it easier > to maintain livepatches using so-called cumulative patches. Thanks for adding this doc. A few minor wording suggestions and typos below... > > Signed-off-by:

[PATCH] livepatch hooks, revisted

2017-07-12 Thread Joe Lawrence
ing, going). A new Documentation/ file is provided as well as a contrived sample module and livepatch demo to demonstrate the callbacks. The example is about as simple as possible, but could be further embellished to resemble a real-world livepatch fix if desired. Thanks, Joe Lawrence (1): livepatc

[PATCH] livepatch: add (un)patch hooks

2017-07-12 Thread Joe Lawrence
target and the livepatch module needs to execute code after the target is loaded, but before its module_init code is run. The patch-hook executes right before patching objects and the unpatch-hook executes right after unpatching objects. Signed-off-by: Joe Lawrence --- Documentation/livepatch

Re: [PATCH] livepatch: add (un)patch hooks

2017-07-14 Thread Joe Lawrence
On Thu, Jul 13, 2017 at 08:46:40PM -0500, Josh Poimboeuf wrote: > Date: Thu, 13 Jul 2017 20:46:40 -0500 > From: Josh Poimboeuf > To: Joe Lawrence > Cc: live-patch...@vger.kernel.org, linux-kernel@vger.kernel.org, Jessica Yu > , Jiri Kosina , Miroslav Benes > , Petr Mlad

Re: [PATCH v2 1/2] livepatch: introduce shadow variable API

2017-07-07 Thread Joe Lawrence
On Fri, Jun 30, 2017 at 09:49:46PM +0800, kbuild test robot wrote: > Date: Fri, 30 Jun 2017 21:49:46 +0800 > From: kbuild test robot > To: Joe Lawrence > Cc: kbuild-...@01.org, live-patch...@vger.kernel.org, > linux-kernel@vger.kernel.org, Josh Poimboeuf , > Jessica Yu , Jiri

[PATCH v2 0/2] livepatch: add shadow variable API

2017-06-28 Thread Joe Lawrence
e code is easier to follow than the periodic kernel messages logged. Suggestions welcome. Joe Lawrence (2): livepatch: introduce shadow variable API livepatch: add shadow variable sample programs Documentation/livepatch/shadow-vars.txt | 156 + include/linux/livepatch.h

[PATCH v2 1/2] livepatch: introduce shadow variable API

2017-06-28 Thread Joe Lawrence
s intended to be used by livepatch modules seeking to emulate additions to data structure definitions. See Documentation/livepatch/shadow-vars.txt for a summary of the new shadow variable API, including a few common use cases. Signed-off-by: Joe Lawrence --- Documentation/livepatch/shadow-vars

[PATCH v2 2/2] livepatch: add shadow variable sample programs

2017-06-28 Thread Joe Lawrence
Add sample livepatch modules to demonstrate the shadow variable API. Signed-off-by: Joe Lawrence --- Reviewers -- it's probably easier to grok reading livepatch-shadow-mod.c *before* the two livepatch modules, livepatch-shadow-fix1.c and livepatch-shadow-fix2.c

Re: [PATCH v2 2/2] livepatch: add shadow variable sample programs

2017-07-18 Thread Joe Lawrence
On Tue, Jul 18, 2017 at 04:47:45PM +0200, Petr Mladek wrote: > Date: Tue, 18 Jul 2017 16:47:45 +0200 > From: Petr Mladek > To: Joe Lawrence > Cc: live-patch...@vger.kernel.org, linux-kernel@vger.kernel.org, Josh > Poimboeuf , Jessica Yu , Jiri Kosina > , Miroslav Benes >

Re: [PATCH v2 1/2] livepatch: introduce shadow variable API

2017-07-18 Thread Joe Lawrence
On Tue, Jul 18, 2017 at 03:00:47PM +0200, Petr Mladek wrote: > Date: Tue, 18 Jul 2017 15:00:47 +0200 > From: Petr Mladek > To: Miroslav Benes > Cc: Josh Poimboeuf , Joe Lawrence > , live-patch...@vger.kernel.org, > linux-kernel@vger.kernel.org, Jessica Yu , Jiri Kosina

Re: [PATCH v2 1/2] livepatch: introduce shadow variable API

2017-07-18 Thread Joe Lawrence
On Mon, Jul 17, 2017 at 05:29:41PM +0200, Miroslav Benes wrote: > > On Wed, 28 Jun 2017, Joe Lawrence wrote: > > > +Brief API summary > > +- > > + [ ... snip ...] > > +* klp_shadow_detach() - detach and free all <*, num> shadow variabl

Re: [PATCH] livepatch: add (un)patch hooks

2017-07-19 Thread Joe Lawrence
On 07/17/2017 11:51 AM, Petr Mladek wrote: > On Wed 2017-07-12 10:10:00, Joe Lawrence wrote: >> When the livepatch core executes klp_(un)patch_object, call out to a >> livepatch-module specified array of callback hooks. These hooks provide >> a notification mechanism for l

Re: [PATCH v2 1/2] livepatch: introduce shadow variable API

2017-07-20 Thread Joe Lawrence
On 07/20/2017 10:45 AM, Miroslav Benes wrote: > > + * > + * Note: allocates @new_size space for shadow variable data and copies > + * @new_size bytes from @new_data into the shadow varaible's own > @new_data > + * space. If @new_data is NULL, @new_size is still allocated,

Re: [PATCH v2 1/2] livepatch: introduce shadow variable API

2017-07-20 Thread Joe Lawrence
On 07/18/2017 08:45 AM, Petr Mladek wrote: > On Wed 2017-06-28 11:37:26, Joe Lawrence wrote: >> diff --git a/Documentation/livepatch/shadow-vars.txt >> b/Documentation/livepatch/shadow-vars.txt >> new file mode 100644 >> index ..7f28982e6b1c >> ---

<    1   2   3   4   5   6   7   >