Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1411120

Re: [PATCH v2] livepatch: allow removal of a disabled patch

From Miroslav Benes <mbenes@suse.cz>
Newsgroups linux.kernel
Subject Re: [PATCH v2] livepatch: allow removal of a disabled patch
Date 2016-06-01 13:50 +0200
Message-ID <rFcOS-7Tq-13@gated-at.bofh.it> (permalink)
References <rF9QZ-641-1@gated-at.bofh.it> <rFcFc-7Qb-43@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Wed, 1 Jun 2016, Christopher Arges wrote:

> On Wed, Jun 01, 2016 at 10:31:59AM +0200, Miroslav Benes wrote:
> >
> > diff --git a/kernel/livepatch/transition.c b/kernel/livepatch/transition.c
> > index 92819bb0961b..6cc49d253195 100644
> > --- a/kernel/livepatch/transition.c
> > +++ b/kernel/livepatch/transition.c
> > @@ -197,13 +197,21 @@ void klp_complete_transition(void)
> >  	struct klp_func *func;
> >  	struct task_struct *g, *task;
> >  	unsigned int cpu;
> > +	bool is_immediate = false;
> >  
> >  	if (klp_transition_patch->immediate)
> >  		goto done;
> >  
> > -	klp_for_each_object(klp_transition_patch, obj)
> > -		klp_for_each_func(obj, func)
> > +	klp_for_each_object(klp_transition_patch, obj) {
> > +		klp_for_each_func(obj, func) {
> >  			func->transition = false;
> > +			if (func->immediate)
> > +				is_immediate = true;
> 
> Once an immediate function is found you could return from this function since
> releasing a reference from the livepatch module is no longer possible.

That is true, but I think we should tidy up after the patching process 
even in this case. That is clear all func->transition, task->patch_state 
and task->TIF_PATCH_PENDING flags. These all could be set if 
patch->immediate is false and one of the func->immediate is true.

Regards,
Miroslav

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v2] livepatch: allow removal of a disabled patch Miroslav Benes <mbenes@suse.cz> - 2016-06-01 10:40 +0200
  Re: [PATCH v2] livepatch: allow removal of a disabled patch Christopher Arges <chris.j.arges@canonical.com> - 2016-06-01 13:40 +0200
    Re: [PATCH v2] livepatch: allow removal of a disabled patch Miroslav Benes <mbenes@suse.cz> - 2016-06-01 13:50 +0200
  Re: [PATCH v2] livepatch: allow removal of a disabled patch Petr Mladek <pmladek@suse.com> - 2016-06-07 11:40 +0200
    Re: livepatch: allow removal of a disabled patch Jessica Yu <jeyu@redhat.com> - 2016-06-08 00:50 +0200
      Re: livepatch: allow removal of a disabled patch Petr Mladek <pmladek@suse.com> - 2016-06-08 10:20 +0200

csiph-web