kpatch/kmod/patch
Josh Poimboeuf e9c0b67862 macros: add syscall patching macros
Attempting to patch a syscall results in an error due to a missing
fentry hook in the inner __do_sys##name() function.  The fentry hook is
missing because of the 'inline' annotation, which invokes 'notrace'.

Add some kpatch-specific syscall definition macros which can be used for
patching a syscall.

These macros are copied almost verbatim from the kernel, the main
difference being a 'kpatch' prefix added to the __do_sys##name()
function name.  This causes kpatch-build to treat it as a new function
(due to its new name), and its caller __se_sys##name() function is
inlined by its own caller __x64_sys##name() function, which has an
fentry hook.

To patch a syscall, just use replace the use of the SYSCALL_DEFINE1 (or
similar) macro with the "KPATCH_" prefixed version.

Fixes: #1171

Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com>
2022-04-19 19:11:44 -07:00
..
Makefile kmod/patch: clean only rebuildable objs 2021-10-01 15:33:00 +02:00
kpatch-macros.h macros: add syscall patching macros 2022-04-19 19:11:44 -07: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 macros: add syscall patching macros 2022-04-19 19:11:44 -07:00
kpatch.h build and install core module with make 2014-02-18 07:44:33 -06:00
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