From fe5df04d3093a00b58a2ff28332d21bb5a0ca14c Mon Sep 17 00:00:00 2001 From: Josh Poimboeuf Date: Fri, 22 Apr 2022 08:36:11 -0700 Subject: [PATCH] patch-author-guide: Add section about patching syscalls Signed-off-by: Josh Poimboeuf --- doc/patch-author-guide.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/doc/patch-author-guide.md b/doc/patch-author-guide.md index c240d02..85d65b8 100644 --- a/doc/patch-author-guide.md +++ b/doc/patch-author-guide.md @@ -874,3 +874,14 @@ To track down specifically what caused a symbol CRC change, tools like detailed symbol definition report. For a kpatch-build, kabi-dw can be modified to operate on .o object files (not just .ko and vmlinux files) and the `$CACHEDIR/tmp/{orig, patched}` directories compared. + +System calls +------------ + +Attempting to patch a syscall typically 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'. + +This problem can be worked around by adding `#include "kpatch-syscall.h"` and +replacing the use of the `SYSCALL_DEFINE1` (or similar) macro with the +`KPATCH_` prefixed version.