[PATCH v6] livepatch: Clear relocation targets on a module removal

Petr Mladek pmladek at suse.com
Sat Dec 10 01:20:13 AEDT 2022


On Fri 2022-12-09 14:54:10, Petr Mladek wrote:
> On Mon 2022-11-28 17:57:06, Song Liu wrote:
> > On Fri, Nov 18, 2022 at 8:24 AM Petr Mladek <pmladek at suse.com> wrote:
> > > > --- a/kernel/livepatch/core.c
> > > > +++ b/kernel/livepatch/core.c
> I see that you removed also:
> 
> 	if (strcmp(objname ? objname : "vmlinux", sec_objname))
> 		return 0;
> 
> This is another bug in your "simplification".

This actually is not a bug. It was replaced by the strcmp() check below.

> > > > +
> > > > +             if (strcmp(objname, sec_objname))
> > > > +                     continue;

But this works only because the function is not called for "vmlinux".
It can't be unloaded.

Well, this optimization is not worth it. IMHO, it is better when
the API is able to handle "vmlinux" object a safe way.

We always try to make the livepatch API as error-proof as possible.
It is the main idea of livepatching. It should fix bugs without
breaking the running system.

Best Regards,
Petr


More information about the Linuxppc-dev mailing list