[PATCH v3 0/2] Improve handling of the __klp_{objects,funcs} sections in modules

Petr Pavlu posted 2 patches 2 weeks ago
include/linux/livepatch.h           |  3 +++
kernel/livepatch/core.c             | 19 +++++++++++++++++++
scripts/livepatch/init.c            | 20 +++++++++-----------
scripts/module.lds.S                |  9 ++-------
tools/objtool/check.c               |  2 +-
tools/objtool/include/objtool/klp.h | 10 +++++-----
tools/objtool/klp-diff.c            |  2 +-
7 files changed, 40 insertions(+), 25 deletions(-)
[PATCH v3 0/2] Improve handling of the __klp_{objects,funcs} sections in modules
Posted by Petr Pavlu 2 weeks ago
Changes since v2 [1]:
- Generalize the helper function that locates __klp_objects in a module
  to allow it to find any data in other sections as well.

Changes since v1 [2]:
- Generalize the helper function that locates __klp_objects in a module
  to allow it to find objects in other sections as well.

[1] https://lore.kernel.org/linux-modules/20260121082842.3050453-1-petr.pavlu@suse.com/
[2] https://lore.kernel.org/linux-modules/20260114123056.2045816-1-petr.pavlu@suse.com/

Petr Pavlu (2):
  livepatch: Fix having __klp_objects relics in non-livepatch modules
  livepatch: Free klp_{object,func}_ext data after initialization

 include/linux/livepatch.h           |  3 +++
 kernel/livepatch/core.c             | 19 +++++++++++++++++++
 scripts/livepatch/init.c            | 20 +++++++++-----------
 scripts/module.lds.S                |  9 ++-------
 tools/objtool/check.c               |  2 +-
 tools/objtool/include/objtool/klp.h | 10 +++++-----
 tools/objtool/klp-diff.c            |  2 +-
 7 files changed, 40 insertions(+), 25 deletions(-)


base-commit: 0f61b1860cc3f52aef9036d7235ed1f017632193
-- 
2.52.0
Re: [PATCH v3 0/2] Improve handling of the __klp_{objects,funcs} sections in modules
Posted by Miroslav Benes 3 days, 19 hours ago
On Fri, 23 Jan 2026, Petr Pavlu wrote:

> Changes since v2 [1]:
> - Generalize the helper function that locates __klp_objects in a module
>   to allow it to find any data in other sections as well.
> 
> Changes since v1 [2]:
> - Generalize the helper function that locates __klp_objects in a module
>   to allow it to find objects in other sections as well.
> 
> [1] https://lore.kernel.org/linux-modules/20260121082842.3050453-1-petr.pavlu@suse.com/
> [2] https://lore.kernel.org/linux-modules/20260114123056.2045816-1-petr.pavlu@suse.com/
> 
> Petr Pavlu (2):
>   livepatch: Fix having __klp_objects relics in non-livepatch modules
>   livepatch: Free klp_{object,func}_ext data after initialization
> 
>  include/linux/livepatch.h           |  3 +++
>  kernel/livepatch/core.c             | 19 +++++++++++++++++++
>  scripts/livepatch/init.c            | 20 +++++++++-----------
>  scripts/module.lds.S                |  9 ++-------
>  tools/objtool/check.c               |  2 +-
>  tools/objtool/include/objtool/klp.h | 10 +++++-----
>  tools/objtool/klp-diff.c            |  2 +-
>  7 files changed, 40 insertions(+), 25 deletions(-)
> 
> 
> base-commit: 0f61b1860cc3f52aef9036d7235ed1f017632193

Acked-by: Miroslav Benes <mbenes@suse.cz>

Thank you,
M
Re: [PATCH v3 0/2] Improve handling of the __klp_{objects,funcs} sections in modules
Posted by Josh Poimboeuf 1 week ago
On Fri, Jan 23, 2026 at 11:26:55AM +0100, Petr Pavlu wrote:
> Changes since v2 [1]:
> - Generalize the helper function that locates __klp_objects in a module
>   to allow it to find any data in other sections as well.
> 
> Changes since v1 [2]:
> - Generalize the helper function that locates __klp_objects in a module
>   to allow it to find objects in other sections as well.
> 
> [1] https://lore.kernel.org/linux-modules/20260121082842.3050453-1-petr.pavlu@suse.com/
> [2] https://lore.kernel.org/linux-modules/20260114123056.2045816-1-petr.pavlu@suse.com/
> 
> Petr Pavlu (2):
>   livepatch: Fix having __klp_objects relics in non-livepatch modules
>   livepatch: Free klp_{object,func}_ext data after initialization

If there are no objections, I will go ahead and queue these patches up
in -tip.

-- 
Josh
Re: [PATCH v3 0/2] Improve handling of the __klp_{objects,funcs} sections in modules
Posted by Aaron Tomlin 1 week ago
On Fri, Jan 23, 2026 at 11:26:55AM +0100, Petr Pavlu wrote:
> Changes since v2 [1]:
> - Generalize the helper function that locates __klp_objects in a module
>   to allow it to find any data in other sections as well.
> 
> Changes since v1 [2]:
> - Generalize the helper function that locates __klp_objects in a module
>   to allow it to find objects in other sections as well.
> 
> [1] https://lore.kernel.org/linux-modules/20260121082842.3050453-1-petr.pavlu@suse.com/
> [2] https://lore.kernel.org/linux-modules/20260114123056.2045816-1-petr.pavlu@suse.com/
> 
> Petr Pavlu (2):
>   livepatch: Fix having __klp_objects relics in non-livepatch modules
>   livepatch: Free klp_{object,func}_ext data after initialization
> 
>  include/linux/livepatch.h           |  3 +++
>  kernel/livepatch/core.c             | 19 +++++++++++++++++++
>  scripts/livepatch/init.c            | 20 +++++++++-----------
>  scripts/module.lds.S                |  9 ++-------
>  tools/objtool/check.c               |  2 +-
>  tools/objtool/include/objtool/klp.h | 10 +++++-----
>  tools/objtool/klp-diff.c            |  2 +-
>  7 files changed, 40 insertions(+), 25 deletions(-)
> 
> 
> base-commit: 0f61b1860cc3f52aef9036d7235ed1f017632193
> -- 
> 2.52.0
> 

Reviewed-by: Aaron Tomlin <atomlin@atomlin.com>

-- 
Aaron Tomlin
Re: [PATCH v3 0/2] Improve handling of the __klp_{objects,funcs} sections in modules
Posted by Josh Poimboeuf 2 weeks ago
On Fri, Jan 23, 2026 at 11:26:55AM +0100, Petr Pavlu wrote:
> Changes since v2 [1]:
> - Generalize the helper function that locates __klp_objects in a module
>   to allow it to find any data in other sections as well.
> 
> Changes since v1 [2]:
> - Generalize the helper function that locates __klp_objects in a module
>   to allow it to find objects in other sections as well.
> 
> [1] https://lore.kernel.org/linux-modules/20260121082842.3050453-1-petr.pavlu@suse.com/
> [2] https://lore.kernel.org/linux-modules/20260114123056.2045816-1-petr.pavlu@suse.com/
> 
> Petr Pavlu (2):
>   livepatch: Fix having __klp_objects relics in non-livepatch modules
>   livepatch: Free klp_{object,func}_ext data after initialization

Thanks!

Acked-by: Josh Poimboeuf <jpoimboe@kernel.org>

-- 
Josh