kpatch/kmod/patch
Joe Lawrence 906bb8f393 kmod: maintain syscall metadata sections in kpatch syscall macros
The KPATCH_SYSCALL_DEFINEn macros in kpatch-syscall.h do not provide the
same syscall metadata (saved in the __syscalls_metadata and
_ftrace_events ELF sections) as the kernel.  These same macros also
instruct kpatch-build to ignore changes to these sections.  This works
fine as long as there are other unmodified syscalls present in the
object file.  However, if not, the kpatch syscall macros may result in
either metadata ELF sections not appearing in the patched object file.
The create-diff-object program expects to encounter any ELF section that
has been marked by KPATCH_IGNORE_SECTION in the patched object file.

To avoid this limitation, create dummy __syscalls_metadata and
_ftrace_events entries for the kpatch-modified syscall.  The specific
values shouldn't matter since their sections will still be marked with
KPATCH_IGNORE_SECTION and now their presence will be guarenteed for
create-diff-object.

Closes: #1375 ("kpatch-build error when modifying an object file's only syscall")
Signed-off-by: Joe Lawrence <joe.lawrence@redhat.com>
2024-02-29 16:58:45 -05:00
..
Makefile kmod/patch: clean only rebuildable objs 2021-10-01 15:33:00 +02:00
kpatch-macros.h kpatch-macros: add KPATCH_STATIC_CALL() 2022-11-30 12:58:31 -08:00
kpatch-patch-hook.c kmod: add support for in-kernel livepatch hooks 2018-03-23 10:32:14 -04:00
kpatch-patch.h create-kpatch-module: Fix -Wconversion warnings 2020-02-11 19:25:10 +05:30
kpatch-syscall.h kmod: maintain syscall metadata sections in kpatch syscall macros 2024-02-29 16:58:45 -05:00
kpatch.h
kpatch.lds.S kmod: add support for in-kernel livepatch hooks 2018-03-23 10:32:14 -04:00
livepatch-patch-hook.c livepatch-patch-hook: add comments 2021-10-01 15:29:13 +02:00
patch-hook.c CONFIG_LIVE_PATCHING -> CONFIG_LIVEPATCH 2015-02-04 08:32:08 -06:00