Re: powerpc-part: was: Re: [PATCH v6] livepatch: Clear relocation targets on a module removal

2022-12-13 Thread Joe Lawrence
On 12/13/22 8:29 AM, Petr Mladek wrote: > On Tue 2022-12-13 00:13:46, Song Liu wrote: >> )() ()On Mon, Dec 12, 2022 at 9:12 AM Petr Mladek wrote: >>> >>> On Fri 2022-12-09 11:59:35, Song Liu wrote: On Fri, Dec 9, 2022 at 3:41 AM Petr Mladek wrote: > On Mon 2022-11-28 17:57:06, Song Liu

Re: powerpc-part: was: Re: [PATCH v6] livepatch: Clear relocation targets on a module removal

2022-12-13 Thread Song Liu
On Fri, Dec 9, 2022 at 3:41 AM Petr Mladek wrote: > > Hi, > > this reply is only about the powerpc-specific part. > > Also adding Kamalesh and Michael into Cc who worked on the related > commit a443bf6e8a7674b86221f49 ("powerpc/modules: Add REL24 relocation > support of livepatch symbols"). > > >

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

2022-12-13 Thread Petr Mladek
On Tue 2022-12-13 00:28:34, Song Liu wrote: > On Fri, Dec 9, 2022 at 4:55 AM Miroslav Benes wrote: > > > > Hi, > > > > first thank you for taking over and I also appologize for not replying > > much sooner. > > > > On Thu, 1 Sep 2022, Song Liu wrote: > > > > > From: Miroslav Benes > > > > > >

Re: powerpc-part: was: Re: [PATCH v6] livepatch: Clear relocation targets on a module removal

2022-12-13 Thread Petr Mladek
On Tue 2022-12-13 00:13:46, Song Liu wrote: > )() ()On Mon, Dec 12, 2022 at 9:12 AM Petr Mladek wrote: > > > > On Fri 2022-12-09 11:59:35, Song Liu wrote: > > > On Fri, Dec 9, 2022 at 3:41 AM Petr Mladek wrote: > > > > On Mon 2022-11-28 17:57:06, Song Liu wrote: > > > > > On Fri, Nov 18, 2022 at

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

2022-12-13 Thread Song Liu
On Fri, Dec 9, 2022 at 4:55 AM Miroslav Benes wrote: > > Hi, > > first thank you for taking over and I also appologize for not replying > much sooner. > > On Thu, 1 Sep 2022, Song Liu wrote: > > > From: Miroslav Benes > > > > Josh reported a bug: > > > > When the object to be patched is a

Re: powerpc-part: was: Re: [PATCH v6] livepatch: Clear relocation targets on a module removal

2022-12-13 Thread Song Liu
)() ()On Mon, Dec 12, 2022 at 9:12 AM Petr Mladek wrote: > > On Fri 2022-12-09 11:59:35, Song Liu wrote: > > On Fri, Dec 9, 2022 at 3:41 AM 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 wrote: > > > > > > > > > > > ---

Re: powerpc-part: was: Re: [PATCH v6] livepatch: Clear relocation targets on a module removal

2022-12-12 Thread Song Liu
On Mon, Dec 12, 2022 at 9:12 AM Petr Mladek wrote: > > On Fri 2022-12-09 11:59:35, Song Liu wrote: > > On Fri, Dec 9, 2022 at 3:41 AM 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 wrote: > > > > > > > > > > > ---

Re: powerpc-part: was: Re: [PATCH v6] livepatch: Clear relocation targets on a module removal

2022-12-12 Thread Petr Mladek
On Fri 2022-12-09 11:59:35, Song Liu wrote: > On Fri, Dec 9, 2022 at 3:41 AM 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 wrote: > > > > > > > > > --- a/arch/powerpc/kernel/module_64.c > > > > > +++

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

2022-12-12 Thread Miroslav Benes
> > Petr has commented on the code aspects. I will just add that s390x was not > > dealt with at the time because there was no live patching support for > > s390x back then if I remember correctly and my notes do not lie. The same > > applies to powerpc32. I think that both should be fixed as well

Re: powerpc-part: was: Re: [PATCH v6] livepatch: Clear relocation targets on a module removal

2022-12-09 Thread Song Liu
On Fri, Dec 9, 2022 at 3:41 AM Petr Mladek wrote: > > Hi, > > this reply is only about the powerpc-specific part. > > Also adding Kamalesh and Michael into Cc who worked on the related > commit a443bf6e8a7674b86221f49 ("powerpc/modules: Add REL24 relocation > support of livepatch symbols"). > > >

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

2022-12-09 Thread Song Liu
On Fri, Dec 9, 2022 at 10:52 AM Christophe Leroy wrote: > > > > Le 09/12/2022 à 19:30, Song Liu a écrit : > > On Fri, Dec 9, 2022 at 4:55 AM Miroslav Benes wrote: > >> > >> Hi, > >> > >> first thank you for taking over and I also appologize for not replying > >> much sooner. > >> > >> On Thu, 1

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

2022-12-09 Thread Christophe Leroy
Le 09/12/2022 à 19:30, Song Liu a écrit : > On Fri, Dec 9, 2022 at 4:55 AM Miroslav Benes wrote: >> >> Hi, >> >> first thank you for taking over and I also appologize for not replying >> much sooner. >> >> On Thu, 1 Sep 2022, Song Liu wrote: >> >>> From: Miroslav Benes >>> >>> Josh reported a

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

2022-12-09 Thread Song Liu
On Fri, Dec 9, 2022 at 4:55 AM Miroslav Benes wrote: > > Hi, > > first thank you for taking over and I also appologize for not replying > much sooner. > > On Thu, 1 Sep 2022, Song Liu wrote: > > > From: Miroslav Benes > > > > Josh reported a bug: > > > > When the object to be patched is a

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

2022-12-09 Thread Song Liu
On Fri, Dec 9, 2022 at 5:54 AM 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 wrote: > > > > --- a/kernel/livepatch/core.c > > > > +++ b/kernel/livepatch/core.c > > > > @@ -316,6 +316,45 @@ int klp_apply_section_relocs(struct

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

2022-12-09 Thread Petr Mladek
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 wrote: > > > > --- a/kernel/livepatch/core.c > > > > +++ b/kernel/livepatch/core.c > I see that you removed also: > > if (strcmp(objname ? objname :

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

2022-12-09 Thread Petr Mladek
On Mon 2022-11-28 17:57:06, Song Liu wrote: > On Fri, Nov 18, 2022 at 8:24 AM Petr Mladek wrote: > > > --- a/kernel/livepatch/core.c > > > +++ b/kernel/livepatch/core.c > > > @@ -316,6 +316,45 @@ int klp_apply_section_relocs(struct module *pmod, > > > Elf_Shdr *sechdrs, > > > return

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

2022-12-09 Thread Miroslav Benes
Hi, first thank you for taking over and I also appologize for not replying much sooner. On Thu, 1 Sep 2022, Song Liu wrote: > From: Miroslav Benes > > Josh reported a bug: > > When the object to be patched is a module, and that module is > rmmod'ed and reloaded, it fails to load with: >

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

2022-12-09 Thread Miroslav Benes
> > > --- a/kernel/livepatch/core.c > > > +++ b/kernel/livepatch/core.c > > > @@ -316,6 +316,45 @@ int klp_apply_section_relocs(struct module *pmod, > > > Elf_Shdr *sechdrs, > > > return apply_relocate_add(sechdrs, strtab, symndx, secndx, pmod); > > > } > > > > > > +static void

x86 part: was: Re: [PATCH v6] livepatch: Clear relocation targets on a module removal

2022-12-09 Thread Petr Mladek
On Mon 2022-11-28 17:57:06, Song Liu wrote: > On Fri, Nov 18, 2022 at 8:24 AM Petr Mladek wrote: > --- a/arch/x86/kernel/module.c > +++ b/arch/x86/kernel/module.c > > This duplicates a lot of code. Please, rename apply_relocate_add() the > > same way as __apply_clear_relocate_add() and add the

powerpc-part: was: Re: [PATCH v6] livepatch: Clear relocation targets on a module removal

2022-12-09 Thread Petr Mladek
Hi, this reply is only about the powerpc-specific part. Also adding Kamalesh and Michael into Cc who worked on the related commit a443bf6e8a7674b86221f49 ("powerpc/modules: Add REL24 relocation support of livepatch symbols"). On Mon 2022-11-28 17:57:06, Song Liu wrote: > On Fri, Nov 18, 2022

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

2022-11-28 Thread Song Liu
On Fri, Nov 18, 2022 at 8:24 AM Petr Mladek wrote: > [...] > > > > +#ifdef CONFIG_LIVEPATCH > > +void clear_relocate_add(Elf64_Shdr *sechdrs, > > +const char *strtab, > > +unsigned int symindex, > > +unsigned int relsec, > > +

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

2022-11-21 Thread Song Liu
On Mon, Nov 21, 2022 at 8:32 AM Joe Lawrence wrote: > > On 11/18/22 12:14 PM, Song Liu wrote: > > Hi Petr, > > > > On Fri, Nov 18, 2022 at 8:24 AM Petr Mladek wrote: > >> > >> On Thu 2022-09-01 10:12:52, Song Liu wrote: > > [...] > >>> > >>> arch/powerpc/kernel/module_32.c | 10 > >>>

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

2022-11-21 Thread Joe Lawrence
On 11/18/22 12:14 PM, Song Liu wrote: > Hi Petr, > > On Fri, Nov 18, 2022 at 8:24 AM Petr Mladek wrote: >> >> On Thu 2022-09-01 10:12:52, Song Liu wrote: > [...] >>> >>> arch/powerpc/kernel/module_32.c | 10 >>> arch/powerpc/kernel/module_64.c | 49 +++ >>>

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

2022-11-18 Thread Song Liu
Hi Petr, On Fri, Nov 18, 2022 at 8:24 AM Petr Mladek wrote: > > On Thu 2022-09-01 10:12:52, Song Liu wrote: [...] > > > > arch/powerpc/kernel/module_32.c | 10 > > arch/powerpc/kernel/module_64.c | 49 +++ > > arch/s390/kernel/module.c | 8 +++ > >

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

2022-11-18 Thread Petr Mladek
On Thu 2022-09-01 10:12:52, Song Liu wrote: > From: Miroslav Benes > > Josh reported a bug: > > When the object to be patched is a module, and that module is > rmmod'ed and reloaded, it fails to load with: > > module: x86/modules: Skipping invalid relocation target, existing value is >

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

2022-11-17 Thread Song Liu
Hi folks, It seems we forgot about this work... What shall we do to move forward? Thanks, Song On Thu, Sep 1, 2022 at 10:16 AM Song Liu wrote: > > From: Miroslav Benes > > Josh reported a bug: > > When the object to be patched is a module, and that module is > rmmod'ed and reloaded, it

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

2022-09-01 Thread Song Liu
From: Miroslav Benes Josh reported a bug: When the object to be patched is a module, and that module is rmmod'ed and reloaded, it fails to load with: module: x86/modules: Skipping invalid relocation target, existing value is nonzero for type 2, loc ba0302e9, val a03e293c