lkml.org 
[lkml]   [2015]   [Apr]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH] livepatch: Enhance livepatch to support remove patch module dynamically
From
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.

Thanks
Minfei

> --
> Jiri Kosina
> SUSE Labs


\
 
 \ /
  Last update: 2015-04-01 17:21    [W:0.063 / U:4.504 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site