All of lore.kernel.org
 help / color / mirror / Atom feed
From: Josh Poimboeuf <jpoimboe@redhat.com>
To: Minfei Huang <mnfhuang@gmail.com>
Cc: Jiri Kosina <jkosina@suse.cz>,
	sjenning@redhat.com, vojtech@suse.cz,
	live-patching@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] livepatch: Enhance livepatch to support remove patch module dynamically
Date: Wed, 1 Apr 2015 12:22:56 -0500	[thread overview]
Message-ID: <20150401172256.GA6265@treble.redhat.com> (raw)
In-Reply-To: <CAKoi8FLXgxMPTEQ=ATWfoDnTmEuzyMd3wH_7iRrNe7K3EgqYvg@mail.gmail.com>

On Wed, Apr 01, 2015 at 10:40:19PM +0800, Minfei Huang wrote:
> 2015-04-01 22:13 GMT+08:00 Jiri Kosina <jkosina@suse.cz>:
> > On Wed, 1 Apr 2015, Minfei Huang wrote:
> >
> >> > > diff --git a/kernel/livepatch/core.c b/kernel/livepatch/core.c
> >> > > index 3f9f1d6..0266950 100644
> >> > > --- a/kernel/livepatch/core.c
> >> > > +++ b/kernel/livepatch/core.c
> >> > > @@ -502,6 +502,17 @@ static int __klp_disable_patch(struct klp_patch *patch)
> >> > >       return 0;
> >> > >  }
> >> > >
> >> > > +static int __klp_disable_patch_nolock(struct klp_patch *patch)
> >> > > +{
> >> > > +     int ret = 0;
> >> > > +
> >> > > +     ret = __klp_disable_patch(patch);
> >> > > +     if (ret)
> >> > > +             return ret;
> >> > > +     module_put(patch->mod);
> >> > > +     return ret;
> >> > > +}
> >> > > +
> >> >
> >> > Your patch doesn't solve the problem at all.
> >> >
> >> > There is no guarantee that once __klp_disable_patch() returns noone is
> >> > using the old code any more.
> >> >
> >>
> >> Yes, thanks.
> >>
> >> The __klp_disable_patch only guarantees that we will never call the
> >> function in patch module. For now, patch module can never be removed
> >> from the kernel once it was loaded. It may be inconvenience if we want
> >> re-load a new patch module replace the old patch module.
> >
> > Patch stacking is possible though.
> >
> 
> How about check the stack when start to remove the patch module? We
> can use the interface stop_machine to hang other CPU, then check and
> remove if no function in patch module is used.

Yeah, we'll eventually have something like that as part of the
consistency model.  The exact implementation is still undecided.  Until
then I think we want to disallow removing the patch module.

-- 
Josh

  reply	other threads:[~2015-04-01 17:23 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CAKoi8FLeHsdyVnnWLcBxCibFw_B3yXKvV8DBncEOGqBy1_zzuw@mail.gmail.com>
2015-04-01 14:00 ` [PATCH] livepatch: Enhance livepatch to support remove patch module dynamically Minfei Huang
2015-04-01 14:13   ` Jiri Kosina
2015-04-01 14:40     ` Minfei Huang
2015-04-01 17:22       ` Josh Poimboeuf [this message]
     [not found] <1427893812-15936-1-git-send-email-minfei.huang@yahoo.com>
2015-04-01 13:35 ` Jiri Kosina

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150401172256.GA6265@treble.redhat.com \
    --to=jpoimboe@redhat.com \
    --cc=jkosina@suse.cz \
    --cc=linux-kernel@vger.kernel.org \
    --cc=live-patching@vger.kernel.org \
    --cc=mnfhuang@gmail.com \
    --cc=sjenning@redhat.com \
    --cc=vojtech@suse.cz \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.