[PATCH 1/3] livepatch: Nullify obj->mod in klp_module_coming()'s error path

2018-06-07 Thread Miroslav Benes
gt;mod variable and could currently give a wrong return value. The bug is probably harmless as of now, but we're gonna rely on klp_is_object_loaded() and correct obj->mod much more and the bug would be visible then. Signed-off-by: Miroslav Benes --- kernel/livepatch/core.c | 1 + 1 file c

Re: [PATCH 1/2] livepatch: Send a fake signal periodically

2018-06-06 Thread Miroslav Benes
On Tue, 5 Jun 2018, Josh Poimboeuf wrote: > On Tue, Jun 05, 2018 at 09:17:52AM +0200, Miroslav Benes wrote: > > On Mon, 4 Jun 2018, Josh Poimboeuf wrote: > > > > > On Mon, Jun 04, 2018 at 04:16:35PM +0200, Miroslav Benes wrote: > > > > An administrator may

Re: [PATCH 1/2] livepatch: Send a fake signal periodically

2018-06-06 Thread Miroslav Benes
On Tue, 5 Jun 2018, Josh Poimboeuf wrote: > On Tue, Jun 05, 2018 at 09:17:52AM +0200, Miroslav Benes wrote: > > On Mon, 4 Jun 2018, Josh Poimboeuf wrote: > > > > > On Mon, Jun 04, 2018 at 04:16:35PM +0200, Miroslav Benes wrote: > > > > An administrator may

Re: [PATCH 1/2] livepatch: Send a fake signal periodically

2018-06-05 Thread Miroslav Benes
On Mon, 4 Jun 2018, Josh Poimboeuf wrote: > On Mon, Jun 04, 2018 at 04:16:35PM +0200, Miroslav Benes wrote: > > An administrator may send a fake signal to all remaining blocking tasks > > of a running transition by writing to > > /sys/kernel/livepatch//signa

Re: [PATCH 1/2] livepatch: Send a fake signal periodically

2018-06-05 Thread Miroslav Benes
On Mon, 4 Jun 2018, Josh Poimboeuf wrote: > On Mon, Jun 04, 2018 at 04:16:35PM +0200, Miroslav Benes wrote: > > An administrator may send a fake signal to all remaining blocking tasks > > of a running transition by writing to > > /sys/kernel/livepatch//signa

[PATCH 2/2] livepatch: Remove signal sysfs attribute

2018-06-04 Thread Miroslav Benes
The fake signal is send automatically now. We can rely on it completely and remove the sysfs attribute. Signed-off-by: Miroslav Benes --- .../ABI/testing/sysfs-kernel-livepatch| 12 --- Documentation/livepatch/livepatch.txt | 16 ++-- kernel/livepatch/core.c

[PATCH 1/2] livepatch: Send a fake signal periodically

2018-06-04 Thread Miroslav Benes
. Theoretically, sending it once should be more than enough. Better be safe than sorry, so send it periodically. A new workqueue job could be a cleaner solution to achieve it, but it could also introduce deadlocks and cause more headaches with synchronization and cancelling. Signed-off-by: Miroslav Benes

[PATCH 2/2] livepatch: Remove signal sysfs attribute

2018-06-04 Thread Miroslav Benes
The fake signal is send automatically now. We can rely on it completely and remove the sysfs attribute. Signed-off-by: Miroslav Benes --- .../ABI/testing/sysfs-kernel-livepatch| 12 --- Documentation/livepatch/livepatch.txt | 16 ++-- kernel/livepatch/core.c

[PATCH 1/2] livepatch: Send a fake signal periodically

2018-06-04 Thread Miroslav Benes
. Theoretically, sending it once should be more than enough. Better be safe than sorry, so send it periodically. A new workqueue job could be a cleaner solution to achieve it, but it could also introduce deadlocks and cause more headaches with synchronization and cancelling. Signed-off-by: Miroslav Benes

[PATCH 0/2] Periodic fake signal

2018-06-04 Thread Miroslav Benes
This is what we have in SLES and I wondered if upstream would be interested as well. Miroslav Benes (2): livepatch: Send a fake signal periodically livepatch: Remove signal sysfs attribute .../ABI/testing/sysfs-kernel-livepatch| 12 --- Documentation/livepatch/livepatch.txt

[PATCH 0/2] Periodic fake signal

2018-06-04 Thread Miroslav Benes
This is what we have in SLES and I wondered if upstream would be interested as well. Miroslav Benes (2): livepatch: Send a fake signal periodically livepatch: Remove signal sysfs attribute .../ABI/testing/sysfs-kernel-livepatch| 12 --- Documentation/livepatch/livepatch.txt

Re: [PATCH] livepatch: Remove not longer valid limitations from the documentation

2018-05-23 Thread Miroslav Benes
2b63de37 > ("livepatch: introduce shadow variable API"). > > It is a high time we removed these limitations from the documentation. > > Signed-off-by: Petr Mladek <pmla...@suse.com> Acked-by: Miroslav Benes <mbe...@suse.cz> M

Re: [PATCH] livepatch: Remove not longer valid limitations from the documentation

2018-05-23 Thread Miroslav Benes
2b63de37 > ("livepatch: introduce shadow variable API"). > > It is a high time we removed these limitations from the documentation. > > Signed-off-by: Petr Mladek Acked-by: Miroslav Benes M

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

2018-05-22 Thread Miroslav Benes
On Wed, 25 Apr 2018, Joe Lawrence wrote: > This round incorporates feedback from SUSE folks, Miroslav, Petr and > Libor. Thanks for the reviews and feedback! > > Like the previous version, this applies on top of Petr's shadow variable > changes and the atomic replace patchset. I skimmed

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

2018-05-22 Thread Miroslav Benes
On Wed, 25 Apr 2018, Joe Lawrence wrote: > This round incorporates feedback from SUSE folks, Miroslav, Petr and > Libor. Thanks for the reviews and feedback! > > Like the previous version, this applies on top of Petr's shadow variable > changes and the atomic replace patchset. I skimmed

Re: [PATCH v3 0/2] livepatch: Allocate and free shadow variables more safely

2018-04-17 Thread Miroslav Benes
+++--- > samples/livepatch/livepatch-shadow-fix2.c | 33 - > 5 files changed, 163 insertions(+), 81 deletions(-) Acked-by: Miroslav Benes <mbe...@suse.cz> M

Re: [PATCH v3 0/2] livepatch: Allocate and free shadow variables more safely

2018-04-17 Thread Miroslav Benes
+++--- > samples/livepatch/livepatch-shadow-fix2.c | 33 - > 5 files changed, 163 insertions(+), 81 deletions(-) Acked-by: Miroslav Benes M

Re: [PATCH v10 05/10] livepatch: Support separate list for replaced patches.

2018-04-17 Thread Miroslav Benes
> > > > Second, unrelated patches must never patch the same functions. > > > > Otherwise we would not be able to define which implementation > > > > should be used. This is especially important when a patch is > > > > removed and we need to fallback either to another patch or > > > > original

Re: [PATCH v10 05/10] livepatch: Support separate list for replaced patches.

2018-04-17 Thread Miroslav Benes
> > > > Second, unrelated patches must never patch the same functions. > > > > Otherwise we would not be able to define which implementation > > > > should be used. This is especially important when a patch is > > > > removed and we need to fallback either to another patch or > > > > original

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

2018-04-17 Thread Miroslav Benes
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 > > > others) get a chance to comment. Perhaps there are o

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

2018-04-17 Thread Miroslav Benes
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 > > > others) get a chance to comment. Perhaps there are o

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

2018-04-16 Thread Miroslav Benes
On Fri, 13 Apr 2018, Joe Lawrence wrote: > 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 su

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

2018-04-16 Thread Miroslav Benes
On Fri, 13 Apr 2018, Joe Lawrence wrote: > 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 su

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

2018-04-13 Thread Miroslav Benes
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 which features are tested? > Signed-off-by: Joe Lawrence > --- >

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

2018-04-13 Thread Miroslav Benes
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 which features are tested? > Signed-off-by: Joe Lawrence > --- > diff --git

Re: [PATCH v2] Add livepatch kselftests

2018-04-12 Thread Miroslav Benes
> Questions for v3: > > - Should we split off the atomic replace and shadow variable update > tests so that the this patchset could be merged before the ones > listed above? What Josh said. If we merge it almost together, there is no need to split it. > - I didn't remove any of

Re: [PATCH v2] Add livepatch kselftests

2018-04-12 Thread Miroslav Benes
> Questions for v3: > > - Should we split off the atomic replace and shadow variable update > tests so that the this patchset could be merged before the ones > listed above? What Josh said. If we merge it almost together, there is no need to split it. > - I didn't remove any of

Re: [PATCH v10 05/10] livepatch: Support separate list for replaced patches.

2018-04-11 Thread Miroslav Benes
On Wed, 11 Apr 2018, Josh Poimboeuf wrote: > On Wed, Apr 11, 2018 at 10:07:31AM +0200, Miroslav Benes wrote: > > > > I was confused by wording "in the middle". It suggested that there > > > > might had been enabled patches on the top and the bottom of the st

Re: [PATCH v10 05/10] livepatch: Support separate list for replaced patches.

2018-04-11 Thread Miroslav Benes
On Wed, 11 Apr 2018, Josh Poimboeuf wrote: > On Wed, Apr 11, 2018 at 10:07:31AM +0200, Miroslav Benes wrote: > > > > I was confused by wording "in the middle". It suggested that there > > > > might had been enabled patches on the top and the bottom of the st

Re: [PATCH v2 1/2] livepatch: Initialize shadow variables safely by a custom callback

2018-04-11 Thread Miroslav Benes
On Thu, 5 Apr 2018, Petr Mladek wrote: > The existing API allows to pass a sample data to initialize the shadow > data. It works well when the data are position independent. But it fails > miserably when we need to set a pointer to the shadow structure itself. > > Unfortunately, we might need to

Re: [PATCH v2 1/2] livepatch: Initialize shadow variables safely by a custom callback

2018-04-11 Thread Miroslav Benes
On Thu, 5 Apr 2018, Petr Mladek wrote: > The existing API allows to pass a sample data to initialize the shadow > data. It works well when the data are position independent. But it fails > miserably when we need to set a pointer to the shadow structure itself. > > Unfortunately, we might need to

Re: [PATCH v10 05/10] livepatch: Support separate list for replaced patches.

2018-04-11 Thread Miroslav Benes
On Tue, 10 Apr 2018, Josh Poimboeuf wrote: > On Tue, Apr 10, 2018 at 10:34:55AM +0200, Petr Mladek wrote: > > > > > > > We were just recently discussing the possibility of not allowing > > > > > > > the > > > > > > > disabling of patches at all. If we're not going that far, let's > > > > > > >

Re: [PATCH v10 05/10] livepatch: Support separate list for replaced patches.

2018-04-11 Thread Miroslav Benes
On Tue, 10 Apr 2018, Josh Poimboeuf wrote: > On Tue, Apr 10, 2018 at 10:34:55AM +0200, Petr Mladek wrote: > > > > > > > We were just recently discussing the possibility of not allowing > > > > > > > the > > > > > > > disabling of patches at all. If we're not going that far, let's > > > > > > >

Re: [PATCH v10 05/10] livepatch: Support separate list for replaced patches.

2018-04-11 Thread Miroslav Benes
On Tue, 10 Apr 2018, Josh Poimboeuf wrote: > > > I agree here. Practically we use only cumulative replacement patches at > > > SUSE. So with that in mind I don't care about the stacking much. But, it > > > may make sense for someone else. Evgenii mentioned they used it for > > > hotfixes.

Re: [PATCH v10 05/10] livepatch: Support separate list for replaced patches.

2018-04-11 Thread Miroslav Benes
On Tue, 10 Apr 2018, Josh Poimboeuf wrote: > > > I agree here. Practically we use only cumulative replacement patches at > > > SUSE. So with that in mind I don't care about the stacking much. But, it > > > may make sense for someone else. Evgenii mentioned they used it for > > > hotfixes.

Re: [PATCH] selftests/livepatch: introduce tests

2018-04-10 Thread Miroslav Benes
> > > I love this. Nice work! Yes, it looks really good. > > > As you and Petr discussed, it would be nice to get rid of some of the > > > delays, and also the callback tests will be very important. > > > > I've got v2 WIP that minimizes the delays, cleans up build flags, and > > adds a basic

Re: [PATCH] selftests/livepatch: introduce tests

2018-04-10 Thread Miroslav Benes
> > > I love this. Nice work! Yes, it looks really good. > > > As you and Petr discussed, it would be nice to get rid of some of the > > > delays, and also the callback tests will be very important. > > > > I've got v2 WIP that minimizes the delays, cleans up build flags, and > > adds a basic

Re: [PATCH v10 05/10] livepatch: Support separate list for replaced patches.

2018-04-10 Thread Miroslav Benes
> > > > I think you're missing my point. This isn't about your patch set, per > > > > se. It's really about our existing code. Today, our patch stack > > > > doesn't follow real stack semantics, because patches in the middle might > > > > be disabled. I see that as a problem. > > > > No,

Re: [PATCH v10 05/10] livepatch: Support separate list for replaced patches.

2018-04-10 Thread Miroslav Benes
> > > > I think you're missing my point. This isn't about your patch set, per > > > > se. It's really about our existing code. Today, our patch stack > > > > doesn't follow real stack semantics, because patches in the middle might > > > > be disabled. I see that as a problem. > > > > No,

Re: [PATCH 6/8] livepatch: Remove Nop structures when unused

2018-04-10 Thread Miroslav Benes
On Fri, 23 Mar 2018, Petr Mladek wrote: > Replaced patches are removed from the stack when the transition is > finished. It means that Nop structures will never be needed again > and can be removed. Why should we care? > > + Nop structures make false feeling that the function is patched >

Re: [PATCH 6/8] livepatch: Remove Nop structures when unused

2018-04-10 Thread Miroslav Benes
On Fri, 23 Mar 2018, Petr Mladek wrote: > Replaced patches are removed from the stack when the transition is > finished. It means that Nop structures will never be needed again > and can be removed. Why should we care? > > + Nop structures make false feeling that the function is patched >

Re: [PATCH 4/8] livepatch: Add an extra flag to distinguish registered patches

2018-04-09 Thread Miroslav Benes
Cc: Josh Poimboeuf <jpoim...@redhat.com> > Cc: Jessica Yu <j...@kernel.org> > Cc: Jiri Kosina <ji...@kernel.org> > Cc: Miroslav Benes <mbe...@suse.cz> > Cc: Jason Baron <jba...@akamai.com> > --- > include/linux/livepatch.h | 2 ++ > kernel/livepa

Re: [PATCH 4/8] livepatch: Add an extra flag to distinguish registered patches

2018-04-09 Thread Miroslav Benes
to klp_is_patch_on_stack() and used in __klp_enable_patch() > as a new sanity check. > > This patch does not change the existing behavior. In my opinion it could be easier for a review to squash the patch into the next one. > Signed-off-by: Petr Mladek > Cc: Josh Poimboeuf > Cc:

Re: [PATCH 3/8] livepatch: Add atomic replace

2018-04-09 Thread Miroslav Benes
> > +* see klp_init_object_loaded(). > > +*/ > > + if (!func->new_func && !func->nop) > > return -EINVAL; > > > > > INIT_LIST_HEAD(>stack_node); > > @@ -742,6 +920,9 @@ static int klp_init_object_loaded(struct klp_patch > > *patch, > > return

Re: [PATCH 3/8] livepatch: Add atomic replace

2018-04-09 Thread Miroslav Benes
> > +* see klp_init_object_loaded(). > > +*/ > > + if (!func->new_func && !func->nop) > > return -EINVAL; > > > > > INIT_LIST_HEAD(>stack_node); > > @@ -742,6 +920,9 @@ static int klp_init_object_loaded(struct klp_patch > > *patch, > > return

Re: [PATCH 2/2] livepatch: Allow to unregister or free shadow data using a custom function

2018-03-21 Thread Miroslav Benes
On Wed, 14 Mar 2018, Josh Poimboeuf wrote: > On Tue, Mar 13, 2018 at 04:54:48PM +0100, Petr Mladek wrote: > > We might need to do some actions before the shadow variable is freed. > > For example, we might need to remove it from a list or free some data > > that it points to. > > > > This is

Re: [PATCH 2/2] livepatch: Allow to unregister or free shadow data using a custom function

2018-03-21 Thread Miroslav Benes
On Wed, 14 Mar 2018, Josh Poimboeuf wrote: > On Tue, Mar 13, 2018 at 04:54:48PM +0100, Petr Mladek wrote: > > We might need to do some actions before the shadow variable is freed. > > For example, we might need to remove it from a list or free some data > > that it points to. > > > > This is

Re: [PATCH 1/2] livepatch: Initialize shadow variables by init function safely

2018-03-21 Thread Miroslav Benes
> @@ -186,10 +198,13 @@ static void *__klp_shadow_get_or_alloc(void *obj, > unsigned long id, void *data, > * Return: the shadow variable data element, NULL on duplicate or > * failure. > */ > -void *klp_shadow_alloc(void *obj, unsigned long id, void *data, > -size_t

Re: [PATCH 1/2] livepatch: Initialize shadow variables by init function safely

2018-03-21 Thread Miroslav Benes
> @@ -186,10 +198,13 @@ static void *__klp_shadow_get_or_alloc(void *obj, > unsigned long id, void *data, > * Return: the shadow variable data element, NULL on duplicate or > * failure. > */ > -void *klp_shadow_alloc(void *obj, unsigned long id, void *data, > -size_t

Re: [PATCH v10 05/10] livepatch: Support separate list for replaced patches.

2018-03-20 Thread Miroslav Benes
> > I don't know, does anybody really care about this case (patching on top > > of a disabled patch)? It just adds to the crazy matrix of possible > > scenarios we have to keep in our heads, which means more bugs, for very > > little (hypothetical) gain. > > It depends if the we remove the

Re: [PATCH v10 05/10] livepatch: Support separate list for replaced patches.

2018-03-20 Thread Miroslav Benes
> > I don't know, does anybody really care about this case (patching on top > > of a disabled patch)? It just adds to the crazy matrix of possible > > scenarios we have to keep in our heads, which means more bugs, for very > > little (hypothetical) gain. > > It depends if the we remove the

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

2018-03-20 Thread Miroslav Benes
On Mon, 12 Mar 2018, Joe Lawrence wrote: > These are the callback tests that I hacked up into a livepatch > kselftest. (Basically I copied a bunch of the sample modules and > verified the expected dmesg output as I had listed in in the > Documentation/livepatch/callbacks.txt file.) The script

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

2018-03-20 Thread Miroslav Benes
On Mon, 12 Mar 2018, Joe Lawrence wrote: > These are the callback tests that I hacked up into a livepatch > kselftest. (Basically I copied a bunch of the sample modules and > verified the expected dmesg output as I had listed in in the > Documentation/livepatch/callbacks.txt file.) The script

Re: [PATCH v8 0/8] livepatch: Atomic replace feature

2018-03-05 Thread Miroslav Benes
On Mon, 5 Mar 2018, Evgenii Shatokhin wrote: > Hi, Hi, > > 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

Re: [PATCH v8 0/8] livepatch: Atomic replace feature

2018-03-05 Thread Miroslav Benes
On Mon, 5 Mar 2018, Evgenii Shatokhin wrote: > Hi, Hi, > > 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

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

2018-03-05 Thread Miroslav Benes
On Fri, 2 Mar 2018, Joe Lawrence wrote: > 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. > >>> > >

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

2018-03-05 Thread Miroslav Benes
On Fri, 2 Mar 2018, Joe Lawrence wrote: > 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. > >>> > >

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

2018-03-02 Thread Miroslav Benes
On Fri, 2 Mar 2018, Greg Kroah-Hartman wrote: > On Thu, Mar 01, 2018 at 05:19:28PM -0800, Philippe Ombredanne wrote: > > Miroslav, > > > > On Tue, Feb 27, 2018 at 3:54 AM, Miroslav Benes <mbe...@suse.cz> wrote: > > > On Sat, 24 Feb 2018, Philipp

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

2018-03-02 Thread Miroslav Benes
On Fri, 2 Mar 2018, Greg Kroah-Hartman wrote: > On Thu, Mar 01, 2018 at 05:19:28PM -0800, Philippe Ombredanne wrote: > > Miroslav, > > > > On Tue, Feb 27, 2018 at 3:54 AM, Miroslav Benes wrote: > > > On Sat, 24 Feb 2018, Philippe Ombredanne wrote: > > > &

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

2018-02-28 Thread Miroslav Benes
On Tue, 27 Feb 2018, Joe Lawrence wrote: > 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 > &g

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

2018-02-28 Thread Miroslav Benes
On Tue, 27 Feb 2018, Joe Lawrence wrote: > 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 > &g

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

2018-02-27 Thread Miroslav Benes
On Fri, 23 Feb 2018, Joe Lawrence wrote: > 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

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

2018-02-27 Thread Miroslav Benes
On Fri, 23 Feb 2018, Joe Lawrence wrote: > 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 >

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

2018-02-27 Thread Miroslav Benes
On Sat, 24 Feb 2018, Philippe Ombredanne wrote: > Joe, > > On Fri, Feb 23, 2018 at 1:33 PM, Joe Lawrence wrote: > > Add a simple atomic replace / cumulative livepatch example. > > > > Signed-off-by: Joe Lawrence > > --- > >

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

2018-02-27 Thread Miroslav Benes
On Sat, 24 Feb 2018, Philippe Ombredanne wrote: > Joe, > > On Fri, Feb 23, 2018 at 1:33 PM, Joe Lawrence wrote: > > Add a simple atomic replace / cumulative livepatch example. > > > > Signed-off-by: Joe Lawrence > > --- > > samples/livepatch/Makefile | 1 + > >

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

2018-02-27 Thread Miroslav Benes
Hi, On Fri, 23 Feb 2018, Joe Lawrence wrote: > Add a simple atomic replace / cumulative livepatch example. It's not a cumulative patch, so I'd stick with an atomic replace example. The same applies to the subject, module name and also the comments. > Signed-off-by: Joe Lawrence

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

2018-02-27 Thread Miroslav Benes
Hi, On Fri, 23 Feb 2018, Joe Lawrence wrote: > Add a simple atomic replace / cumulative livepatch example. It's not a cumulative patch, so I'd stick with an atomic replace example. The same applies to the subject, module name and also the comments. > Signed-off-by: Joe Lawrence > --- >

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

2018-02-23 Thread Miroslav Benes
On Fri, 23 Feb 2018, Joe Lawrence wrote: > 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 cum

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

2018-02-23 Thread Miroslav Benes
On Fri, 23 Feb 2018, Joe Lawrence wrote: > 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 cum

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

2018-02-23 Thread Miroslav Benes
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 <pmla...@suse.com> Acked-by: Miroslav Benes <mbe...@suse.cz>

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

2018-02-23 Thread Miroslav Benes
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 Joe, are you planning to extend shadow vars docum

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

2018-02-22 Thread Miroslav Benes
On Wed, 21 Feb 2018, Petr Mladek wrote: > The atomic replace feature uses dynamically allocated struct klp_func to > handle functions that will not longer be patched. These structures are s/not longer/no longer/, but "handle functions that will not be patched any longer" may be even better. >

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

2018-02-22 Thread Miroslav Benes
On Wed, 21 Feb 2018, Petr Mladek wrote: > The atomic replace feature uses dynamically allocated struct klp_func to > handle functions that will not longer be patched. These structures are s/not longer/no longer/, but "handle functions that will not be patched any longer" may be even better. >

Re: [PATCH v8 4/8] livepatch: Allow to unpatch only functions of the given type

2018-02-22 Thread Miroslav Benes
ron <jba...@akamai.com> > [pmla...@suse.com: Split and modified to use the generic ftype] > Signed-off-by: Petr Mladek <pmla...@suse.com> > Cc: Josh Poimboeuf <jpoim...@redhat.com> > Cc: Jessica Yu <j...@kernel.org> > Cc: Jiri Kosina <ji...@kernel.org> > Cc: Miroslav Benes <mbe...@suse.cz> Acked-by: Miroslav Benes <mbe...@suse.cz> Miroslav

Re: [PATCH v8 4/8] livepatch: Allow to unpatch only functions of the given type

2018-02-22 Thread Miroslav Benes
m: Split and modified to use the generic ftype] > Signed-off-by: Petr Mladek > Cc: Josh Poimboeuf > Cc: Jessica Yu > Cc: Jiri Kosina > Cc: Miroslav Benes Acked-by: Miroslav Benes Miroslav

Re: [PATCH v8 0/8] livepatch: Atomic replace feature

2018-02-22 Thread Miroslav Benes
> I have found one bug in v7. We were not able to initialize NOP > struct klp_func when the patches module is not loaded. It was > because func->new_func was NULL. I have fixed it in separate patch > for an easier review. This is embarassing. I'd swear I tested this. At least it was a part of my

Re: [PATCH v8 0/8] livepatch: Atomic replace feature

2018-02-22 Thread Miroslav Benes
> I have found one bug in v7. We were not able to initialize NOP > struct klp_func when the patches module is not loaded. It was > because func->new_func was NULL. I have fixed it in separate patch > for an easier review. This is embarassing. I'd swear I tested this. At least it was a part of my

Re: [PATCH v7 0/7] livepatch: Atomic replace feature

2018-02-14 Thread Miroslav Benes
On Tue, 6 Feb 2018, 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 v7 0/7] livepatch: Atomic replace feature

2018-02-14 Thread Miroslav Benes
On Tue, 6 Feb 2018, 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 v7 6/7] livepatch: Add atomic replace

2018-02-12 Thread Miroslav Benes
nk about > interactions caused by running many scripts from older patches. > No to say that the old scripts even would not expect to be called > in this situation. > > Signed-off-by: Jason Baron <jba...@akamai.com> > [pmla...@suse.com: Split, reuse existing code

Re: [PATCH v7 6/7] livepatch: Add atomic replace

2018-02-12 Thread Miroslav Benes
ractions caused by running many scripts from older patches. > No to say that the old scripts even would not expect to be called > in this situation. > > Signed-off-by: Jason Baron > [pmla...@suse.com: Split, reuse existing code, simplified] > Signed-off-by: Petr Mladek

Re: [PATCH v7 5/7] livepatch: Support separate list for replaced patches.

2018-02-09 Thread Miroslav Benes
ch does not change the existing behavior. > > Signed-off-by: Jason Baron <jba...@akamai.com> > [pmla...@suse.com: Split and renamed klp_is_patch_usable()] > Signed-off-by: Petr Mladek <pmla...@suse.com> > Cc: Josh Poimboeuf <jpoim...@redhat.com> > Cc: Jessi

Re: [PATCH v7 5/7] livepatch: Support separate list for replaced patches.

2018-02-09 Thread Miroslav Benes
existing behavior. > > Signed-off-by: Jason Baron > [pmla...@suse.com: Split and renamed klp_is_patch_usable()] > Signed-off-by: Petr Mladek > Cc: Josh Poimboeuf > Cc: Jessica Yu > Cc: Jiri Kosina > Cc: Miroslav Benes > --- > kernel/livepatch/core.c | 30 +

Re: [PATCH v7 4/7] livepatch: Allow to unpatch only functions of the given type

2018-02-09 Thread Miroslav Benes
> +/* > + * Remove ftrace handler for the given object and function type. Isn't it imprecise? It does not necessarily remove ftrace handler. It removes a function of given ftype from func_stack. I'd remove the sentence. > + * > + * It keeps obj->patched flag true when any listed function is

Re: [PATCH v7 4/7] livepatch: Allow to unpatch only functions of the given type

2018-02-09 Thread Miroslav Benes
> +/* > + * Remove ftrace handler for the given object and function type. Isn't it imprecise? It does not necessarily remove ftrace handler. It removes a function of given ftype from func_stack. I'd remove the sentence. > + * > + * It keeps obj->patched flag true when any listed function is

Re: [PATCH v7 2/7] livepatch: Free only structures with initialized kobject

2018-02-09 Thread Miroslav Benes
later with > the support for dynamic structures. > > This patch does not change the existing behavior. > > Signed-off-by: Petr Mladek <pmla...@suse.com> > Cc: Josh Poimboeuf <jpoim...@redhat.com> > Cc: Jessica Yu <j...@kernel.org> > Cc: Jiri Kosina &

Re: [PATCH v7 2/7] livepatch: Free only structures with initialized kobject

2018-02-09 Thread Miroslav Benes
later with > the support for dynamic structures. > > This patch does not change the existing behavior. > > Signed-off-by: Petr Mladek > Cc: Josh Poimboeuf > Cc: Jessica Yu > Cc: Jiri Kosina > Cc: Miroslav Benes > Cc: Jason Baron > --- > kernel/livepatch/

Re: [PATCH v7 3/7] livepatch: Initial support for dynamic structures

2018-02-09 Thread Miroslav Benes
ust be updated when a particular dynamic > klp_func_type is introduced. > > Signed-off-by: Jason Baron <jba...@akamai.com> > [pmla...@suse.com: Converted into a generic API] > Signed-off-by: Petr Mladek <pmla...@suse.com> > Cc: Josh Poimboeuf <jpoim...@red

Re: [PATCH v7 1/7] livepatch: Use lists to manage patches, objects and functions

2018-02-09 Thread Miroslav Benes
oimboeuf <jpoim...@redhat.com> > Cc: Jessica Yu <j...@kernel.org> > Cc: Jiri Kosina <ji...@kernel.org> > Cc: Miroslav Benes <mbe...@suse.cz> Acked-by: Miroslav Benes <mbe...@suse.cz> Miroslav

Re: [PATCH v7 1/7] livepatch: Use lists to manage patches, objects and functions

2018-02-09 Thread Miroslav Benes
ated structures. > > This patch does not change the existing behavior. > > Signed-off-by: Jason Baron > [pmla...@suse.com: Initialize lists before init calls] > Signed-off-by: Petr Mladek > Cc: Josh Poimboeuf > Cc: Jessica Yu > Cc: Jiri Kosina > Cc: Miroslav Benes Acked-by: Miroslav Benes Miroslav

Re: [PATCH v7 3/7] livepatch: Initial support for dynamic structures

2018-02-09 Thread Miroslav Benes
dynamic > klp_func_type is introduced. > > Signed-off-by: Jason Baron > [pmla...@suse.com: Converted into a generic API] > Signed-off-by: Petr Mladek > Cc: Josh Poimboeuf > Cc: Jessica Yu > Cc: Jiri Kosina > Cc: Miroslav Benes This patch introduces klp_get_or_add_o

Re: PATCH v6 0/6] livepatch: Atomic replace feature

2018-02-01 Thread Miroslav Benes
On Thu, 1 Feb 2018, Josh Poimboeuf wrote: > On Thu, Feb 01, 2018 at 04:08:14PM +0100, Miroslav Benes wrote: > > On Thu, 1 Feb 2018, Joe Lawrence wrote: > > > > > On 02/01/2018 08:49 AM, Miroslav Benes wrote: > > > > > > > > Well, one more thing.

Re: PATCH v6 0/6] livepatch: Atomic replace feature

2018-02-01 Thread Miroslav Benes
On Thu, 1 Feb 2018, Josh Poimboeuf wrote: > On Thu, Feb 01, 2018 at 04:08:14PM +0100, Miroslav Benes wrote: > > On Thu, 1 Feb 2018, Joe Lawrence wrote: > > > > > On 02/01/2018 08:49 AM, Miroslav Benes wrote: > > > > > > > > Well, one more thing.

Re: PATCH v6 0/6] livepatch: Atomic replace feature

2018-02-01 Thread Miroslav Benes
On Thu, 1 Feb 2018, Joe Lawrence wrote: > On 02/01/2018 08:49 AM, Miroslav Benes wrote: > > > > Well, one more thing. I think there is a problem with shadow variables. > > Similar to callbacks situation. Shadow variables cannot be destroyed the > > way it is shown

Re: PATCH v6 0/6] livepatch: Atomic replace feature

2018-02-01 Thread Miroslav Benes
On Thu, 1 Feb 2018, Joe Lawrence wrote: > On 02/01/2018 08:49 AM, Miroslav Benes wrote: > > > > Well, one more thing. I think there is a problem with shadow variables. > > Similar to callbacks situation. Shadow variables cannot be destroyed the > > way it is shown

Re: PATCH v6 6/6] livepatch: Add atomic replace

2018-02-01 Thread Miroslav Benes
> -struct klp_object *klp_get_or_add_object(struct klp_patch *patch, > +static struct klp_object *klp_get_or_add_object(struct klp_patch *patch, > struct klp_object *old_obj) A nit, but this change belongs to 3/6, doesn't it? > { > struct

Re: PATCH v6 6/6] livepatch: Add atomic replace

2018-02-01 Thread Miroslav Benes
> -struct klp_object *klp_get_or_add_object(struct klp_patch *patch, > +static struct klp_object *klp_get_or_add_object(struct klp_patch *patch, > struct klp_object *old_obj) A nit, but this change belongs to 3/6, doesn't it? > { > struct

Re: PATCH v6 0/6] livepatch: Atomic replace feature

2018-02-01 Thread Miroslav Benes
On Thu, 25 Jan 2018, Petr Mladek wrote: > Hi, > > 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

Re: PATCH v6 0/6] livepatch: Atomic replace feature

2018-02-01 Thread Miroslav Benes
On Thu, 25 Jan 2018, Petr Mladek wrote: > Hi, > > 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

Re: PATCH v6 5/6] livepatch: Support separate list for replaced patches.

2018-01-31 Thread Miroslav Benes
On Thu, 25 Jan 2018, Petr Mladek wrote: > From: Jason Baron > > We are going to add a feature called atomic replace. It will allow to > create a patch that would replace all already registered patches. > > The replaced patches will stay registered because they are typically

<    1   2   3   4   5   6   7   8   9   10   >