kpatch/kmod
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
..
core deal with the deadlock may occur in stop_machine context. 2020-08-10 14:53:04 +08:00
patch macros: add syscall patching macros 2022-04-19 19:11:44 -07:00
Makefile kmod: Fix install path 2016-05-06 10:47:43 +01:00