All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] livepatch: fix merge bug in klp_cleanup_module_patches_limited()
@ 2017-10-31 19:53 Josh Poimboeuf
  2017-10-31 20:12 ` Jiri Kosina
  0 siblings, 1 reply; 4+ messages in thread
From: Josh Poimboeuf @ 2017-10-31 19:53 UTC (permalink / raw)
  To: Jiri Kosina, Miroslav Benes, Jessica Yu
  Cc: live-patching, linux-kernel, Joe Lawrence

When the patch for "livepatch: add (un)patch callbacks" was posted to
the mailing list at:

  https://lkml.kernel.org/r/1507921723-1996-2-git-send-email-joe.lawrence@redhat.com

... it was based on top of the following commit:

  ef8daf8eeb5b ("livepatch: unpatch all klp_objects if klp_module_coming fails").

But when it was applied to git on the livepatching
for-4.15/shadow-variables branch, that branch was missing the above
commit.  The patch was rebased accordingly:

  93862e385ded ("livepatch: add (un)patch callbacks")

Then the two above commits were merged into livepatching/for-next:

  6a18fdf2d8d3 ("Merge branch 'for-4.15/callbacks' into for-next"),

The result of the merge commit was that the klp_post_unpatch_callback()
call in the klp_cleanup_module_patches_limited() function disappeared.
The original patch on the mailing list had that call, so put it back.

Fixes: 6a18fdf2d8d3 ("Merge branch 'for-4.15/callbacks' into for-next")
Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com>
---
 kernel/livepatch/core.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/kernel/livepatch/core.c b/kernel/livepatch/core.c
index 30e392858281..de9e45dca70f 100644
--- a/kernel/livepatch/core.c
+++ b/kernel/livepatch/core.c
@@ -875,6 +875,8 @@ static void klp_cleanup_module_patches_limited(struct module *mod,
 				pr_notice("reverting patch '%s' on unloading module '%s'\n",
 					  patch->mod->name, obj->mod->name);
 				klp_unpatch_object(obj);
+
+				klp_post_unpatch_callback(obj);
 			}
 
 			klp_free_object_loaded(obj);
-- 
2.13.6

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

* Re: [PATCH] livepatch: fix merge bug in klp_cleanup_module_patches_limited()
  2017-10-31 19:53 [PATCH] livepatch: fix merge bug in klp_cleanup_module_patches_limited() Josh Poimboeuf
@ 2017-10-31 20:12 ` Jiri Kosina
  2017-10-31 20:24   ` Josh Poimboeuf
  0 siblings, 1 reply; 4+ messages in thread
From: Jiri Kosina @ 2017-10-31 20:12 UTC (permalink / raw)
  To: Josh Poimboeuf
  Cc: Miroslav Benes, Jessica Yu, live-patching, linux-kernel, Joe Lawrence

On Tue, 31 Oct 2017, Josh Poimboeuf wrote:

> When the patch for "livepatch: add (un)patch callbacks" was posted to
> the mailing list at:
> 
>   https://lkml.kernel.org/r/1507921723-1996-2-git-send-email-joe.lawrence@redhat.com
> 
> ... it was based on top of the following commit:
> 
>   ef8daf8eeb5b ("livepatch: unpatch all klp_objects if klp_module_coming fails").
> 
> But when it was applied to git on the livepatching
> for-4.15/shadow-variables branch, that branch was missing the above
> commit.  The patch was rebased accordingly:
> 
>   93862e385ded ("livepatch: add (un)patch callbacks")
> 
> Then the two above commits were merged into livepatching/for-next:
> 
>   6a18fdf2d8d3 ("Merge branch 'for-4.15/callbacks' into for-next"),
> 
> The result of the merge commit was that the klp_post_unpatch_callback()
> call in the klp_cleanup_module_patches_limited() function disappeared.
> The original patch on the mailing list had that call, so put it back.
> 
> Fixes: 6a18fdf2d8d3 ("Merge branch 'for-4.15/callbacks' into for-next")
> Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com>
> ---
>  kernel/livepatch/core.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/kernel/livepatch/core.c b/kernel/livepatch/core.c
> index 30e392858281..de9e45dca70f 100644
> --- a/kernel/livepatch/core.c
> +++ b/kernel/livepatch/core.c
> @@ -875,6 +875,8 @@ static void klp_cleanup_module_patches_limited(struct module *mod,
>  				pr_notice("reverting patch '%s' on unloading module '%s'\n",
>  					  patch->mod->name, obj->mod->name);
>  				klp_unpatch_object(obj);
> +
> +				klp_post_unpatch_callback(obj);

Bah, thanks a lot for spotting and fixing my brainfart, really 
appreciated.

Now, the only branch I could actually technically apply this patch to 
would be for-next, but that'd be useless, as that is only an 
integration/testing branch, that doesn't get merged anywhere else than 
linux-next.

Would you be okay with me just redoing the merge into for-next with this 
fixup attributed to you in the merge message (and my git-rerere picking it 
up for upstream)?

Thanks Josh,

-- 
Jiri Kosina
SUSE Labs

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

* Re: [PATCH] livepatch: fix merge bug in klp_cleanup_module_patches_limited()
  2017-10-31 20:12 ` Jiri Kosina
@ 2017-10-31 20:24   ` Josh Poimboeuf
  2017-11-01 14:28     ` Jiri Kosina
  0 siblings, 1 reply; 4+ messages in thread
From: Josh Poimboeuf @ 2017-10-31 20:24 UTC (permalink / raw)
  To: Jiri Kosina
  Cc: Miroslav Benes, Jessica Yu, live-patching, linux-kernel, Joe Lawrence

On Tue, Oct 31, 2017 at 09:12:07PM +0100, Jiri Kosina wrote:
> On Tue, 31 Oct 2017, Josh Poimboeuf wrote:
> 
> > When the patch for "livepatch: add (un)patch callbacks" was posted to
> > the mailing list at:
> > 
> >   https://lkml.kernel.org/r/1507921723-1996-2-git-send-email-joe.lawrence@redhat.com
> > 
> > ... it was based on top of the following commit:
> > 
> >   ef8daf8eeb5b ("livepatch: unpatch all klp_objects if klp_module_coming fails").
> > 
> > But when it was applied to git on the livepatching
> > for-4.15/shadow-variables branch, that branch was missing the above
> > commit.  The patch was rebased accordingly:
> > 
> >   93862e385ded ("livepatch: add (un)patch callbacks")
> > 
> > Then the two above commits were merged into livepatching/for-next:
> > 
> >   6a18fdf2d8d3 ("Merge branch 'for-4.15/callbacks' into for-next"),
> > 
> > The result of the merge commit was that the klp_post_unpatch_callback()
> > call in the klp_cleanup_module_patches_limited() function disappeared.
> > The original patch on the mailing list had that call, so put it back.
> > 
> > Fixes: 6a18fdf2d8d3 ("Merge branch 'for-4.15/callbacks' into for-next")
> > Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com>
> > ---
> >  kernel/livepatch/core.c | 2 ++
> >  1 file changed, 2 insertions(+)
> > 
> > diff --git a/kernel/livepatch/core.c b/kernel/livepatch/core.c
> > index 30e392858281..de9e45dca70f 100644
> > --- a/kernel/livepatch/core.c
> > +++ b/kernel/livepatch/core.c
> > @@ -875,6 +875,8 @@ static void klp_cleanup_module_patches_limited(struct module *mod,
> >  				pr_notice("reverting patch '%s' on unloading module '%s'\n",
> >  					  patch->mod->name, obj->mod->name);
> >  				klp_unpatch_object(obj);
> > +
> > +				klp_post_unpatch_callback(obj);
> 
> Bah, thanks a lot for spotting and fixing my brainfart, really 
> appreciated.
> 
> Now, the only branch I could actually technically apply this patch to 
> would be for-next, but that'd be useless, as that is only an 
> integration/testing branch, that doesn't get merged anywhere else than 
> linux-next.

Makes sense, I didn't know the rebase policy for that branch.

> Would you be okay with me just redoing the merge into for-next with this 
> fixup attributed to you in the merge message (and my git-rerere picking it 
> up for upstream)?

Sure, no problem.

-- 
Josh

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

* Re: [PATCH] livepatch: fix merge bug in klp_cleanup_module_patches_limited()
  2017-10-31 20:24   ` Josh Poimboeuf
@ 2017-11-01 14:28     ` Jiri Kosina
  0 siblings, 0 replies; 4+ messages in thread
From: Jiri Kosina @ 2017-11-01 14:28 UTC (permalink / raw)
  To: Josh Poimboeuf
  Cc: Miroslav Benes, Jessica Yu, live-patching, linux-kernel, Joe Lawrence

On Tue, 31 Oct 2017, Josh Poimboeuf wrote:

> > Now, the only branch I could actually technically apply this patch to 
> > would be for-next, but that'd be useless, as that is only an 
> > integration/testing branch, that doesn't get merged anywhere else than 
> > linux-next.
> 
> Makes sense, I didn't know the rebase policy for that branch.

for-next is the only branch which I ocasionaly rebase; the most prominent 
example is due to dropping a particular topic branch.

The topic branches themselves, I never actually rebase, as they are 
usually used as basis for actual development, while for-next really should 
not; that's just an integration branch.

> > Would you be okay with me just redoing the merge into for-next with this 
> > fixup attributed to you in the merge message (and my git-rerere picking it 
> > up for upstream)?
> 
> Sure, no problem.

Thanks a lot again; I've just pushed out a fixed merge.

-- 
Jiri Kosina
SUSE Labs

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

end of thread, other threads:[~2017-11-01 14:29 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-10-31 19:53 [PATCH] livepatch: fix merge bug in klp_cleanup_module_patches_limited() Josh Poimboeuf
2017-10-31 20:12 ` Jiri Kosina
2017-10-31 20:24   ` Josh Poimboeuf
2017-11-01 14:28     ` Jiri Kosina

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.