[PATCH v4 3/3] selftests: livepatch: test livepatching a kprobed function

2024-09-30 Thread Michael Vetter
The test proves that a function that is being kprobed and uses a post_handler cannot be livepatched. Only one ftrace_ops with FTRACE_OPS_FL_IPMODIFY set may be registered to any given function at a time. Signed-off-by: Michael Vetter --- tools/testing/selftests/livepatch/Makefile| 3

[PATCH v4 1/3] selftests: livepatch: rename KLP_SYSFS_DIR to SYSFS_KLP_DIR

2024-09-30 Thread Michael Vetter
This naming makes more sense according to the directory structure. Especially when we later add more paths. Signed-off-by: Michael Vetter --- tools/testing/selftests/livepatch/functions.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/testing/selftests

[PATCH v4 2/3] selftests: livepatch: save and restore kprobe state

2024-09-30 Thread Michael Vetter
Save the state of /sys/kernel/debug/kprobes/enabled during setup_config() and restore it during cleanup(). This is in preparation for a future commit that will add a test that should confirm that we cannot livepatch a kprobed function if that kprobe has a post handler. Signed-off-by: Michael

[PATCH v4 0/3] selftests: livepatch: test livepatching a kprobed function

2024-09-30 Thread Michael Vetter
nfig() and cleanup(). Rename SYSFS variables in a more logical way. Sort test modules in alphabetical order. Rename module description. V2: Save and restore kprobe state. Michael Vetter (3): selftests: livepatch: rename KLP_SYSFS_DIR to SYSFS_KLP_DIR selftests: livepatch: save and restore kp

[PATCH v5 1/3] selftests: livepatch: rename KLP_SYSFS_DIR to SYSFS_KLP_DIR

2024-10-17 Thread Michael Vetter
This naming makes more sense according to the directory structure. Especially when we later add more paths. Addtionally replace `/sys/kernel/livepatch` with `$SYSFS_KLP_DIR` in the livepatch test files. Signed-off-by: Michael Vetter --- .../testing/selftests/livepatch/functions.sh | 16

[PATCH v5 0/3] selftests: livepatch: test livepatching a kprobed function

2024-10-17 Thread Michael Vetter
: Save and restore kprobe state also when test fails, by integrating it into setup_config() and cleanup(). Rename SYSFS variables in a more logical way. Sort test modules in alphabetical order. Rename module description. V2: Save and restore kprobe state. Michael Vetter (3): selftests: livepat

[PATCH v5 2/3] selftests: livepatch: save and restore kprobe state

2024-10-17 Thread Michael Vetter
Save the state of /sys/kernel/debug/kprobes/enabled during setup_config() and restore it during cleanup(). This is in preparation for a future commit that will add a test that should confirm that we cannot livepatch a kprobed function if that kprobe has a post handler. Signed-off-by: Michael

[PATCH v5 3/3] selftests: livepatch: test livepatching a kprobed function

2024-10-17 Thread Michael Vetter
Documentation/trace/kprobetrace.rst. This interface uses only the pre_handler(), see alloc_trace_kprobe(). But FTRACE_OPS_FL_IPMODIFY is used only when the kprobe is using a post_handler, see arm_kprobe_ftrace(). Signed-off-by: Michael Vetter --- tools/testing/selftests/livepatch/Makefile| 3

[PATCH v3 3/3] selftests: livepatch: test livepatching a kprobed function

2024-09-20 Thread Michael Vetter
The test proves that a function that is being kprobed and uses a post_handler cannot be livepatched. Only one ftrace_ops with FTRACE_OPS_FL_IPMODIFY set may be registered to any given function at a time. Signed-off-by: Michael Vetter --- tools/testing/selftests/livepatch/Makefile| 3

[PATCH v3 0/3] selftests: livepatch: test livepatching a kprobed function

2024-09-20 Thread Michael Vetter
order. Rename module description. V2: Save and restore kprobe state. Michael Vetter (3): selftests: livepatch: rename KLP_SYSFS_DIR to SYSFS_KLP_DIR selftests: livepatch: save and restore kprobe state selftests: livepatch: test livepatching a kprobed function tools/testing/selftests

[PATCH v3 1/3] selftests: livepatch: rename KLP_SYSFS_DIR to SYSFS_KLP_DIR

2024-09-20 Thread Michael Vetter
This naming makes more sense according to the directory structure. Especially when we later add more paths. Signed-off-by: Michael Vetter --- tools/testing/selftests/livepatch/functions.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/testing/selftests

[PATCH v3 2/3] selftests: livepatch: save and restore kprobe state

2024-09-20 Thread Michael Vetter
: Michael Vetter --- tools/testing/selftests/livepatch/functions.sh | 9 - 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/tools/testing/selftests/livepatch/functions.sh b/tools/testing/selftests/livepatch/functions.sh index 50361fceff06..6684c01c0567 100644 --- a/tools/testing