| 5cb55753 | 10-Oct-2025 |
Fushuai Wang <wangfushuai@baidu.com> |
selftests: livepatch: use canonical ftrace path
Since v4.1 kernel, a new interface for ftrace called "tracefs" was introduced, which is usually mounted in /sys/kernel/tracing. Therefore, tracing fil
selftests: livepatch: use canonical ftrace path
Since v4.1 kernel, a new interface for ftrace called "tracefs" was introduced, which is usually mounted in /sys/kernel/tracing. Therefore, tracing files can now be accessed via either the legacy path /sys/kernel/debug/tracing or the newer path /sys/kernel/tracing.
Signed-off-by: Fushuai Wang <wangfushuai@baidu.com> Reviewed-by: Petr Mladek <pmladek@suse.com> Tested-by: Petr Mladek <pmladek@suse.com> Signed-off-by: Petr Mladek <pmladek@suse.com>
show more ...
|
| 474eecc8 | 24-Mar-2025 |
Filipe Xavier <felipeaggger@gmail.com> |
selftests: livepatch: test if ftrace can trace a livepatched function
This new test makes sure that ftrace can trace a function that was introduced by a livepatch.
Signed-off-by: Filipe Xavier <fel
selftests: livepatch: test if ftrace can trace a livepatched function
This new test makes sure that ftrace can trace a function that was introduced by a livepatch.
Signed-off-by: Filipe Xavier <felipeaggger@gmail.com> Acked-by: Miroslav Benes <mbenes@suse.cz> Acked-by: Joe Lawrence <joe.lawrence@redhat.com> Reviewed-by: Petr Mladek <pmladek@suse.com> Tested-by: Petr Mladek <pmladek@suse.com> Link: https://lore.kernel.org/r/20250324-ftrace-sftest-livepatch-v3-2-d9d7cc386c75@gmail.com Signed-off-by: Petr Mladek <pmladek@suse.com>
show more ...
|
| 62597edf | 17-Oct-2024 |
Michael Vetter <mvetter@suse.com> |
selftests: livepatch: test livepatching a kprobed function
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_F
selftests: livepatch: test livepatching a kprobed function
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.
Note that the conflicting kprobe could not be created using the tracefs interface, see 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 <mvetter@suse.com> Reviewed-by: Miroslav Benes <mbenes@suse.cz> Reviewed-by: Joe Lawrence <joe.lawrence@redhat.com> Tested-by: Marcos Paulo de Souza <mpdesouza@suse.com> Reviewed-by: Marcos Paulo de Souza <mpdesouza@suse.com> Reviewed-by: Petr Mladek <pmladek@suse.com> Tested-by: Petr Mladek <pmladek@suse.com> Link: https://lore.kernel.org/r/20241017200132.21946-4-mvetter@suse.com Signed-off-by: Petr Mladek <pmladek@suse.com>
show more ...
|
| 59766286 | 17-Oct-2024 |
Michael Vetter <mvetter@suse.com> |
selftests: livepatch: save and restore kprobe state
Save the state of /sys/kernel/debug/kprobes/enabled during setup_config() and restore it during cleanup().
This is in preparation for a future co
selftests: livepatch: save and restore kprobe state
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 Vetter <mvetter@suse.com> Reviewed-by: Miroslav Benes <mbenes@suse.cz> Reviewed-by: Joe Lawrence <joe.lawrence@redhat.com> Tested-by: Marcos Paulo de Souza <mpdesouza@suse.com> Reviewed-by: Marcos Paulo de Souza <mpdesouza@suse.com> Reviewed-by: Petr Mladek <pmladek@suse.com> Tested-by: Petr Mladek <pmladek@suse.com> Link: https://lore.kernel.org/r/20241017200132.21946-3-mvetter@suse.com [pmladek@suse.com: Added few more substitutions in test-syscall.sh] Signed-off-by: Petr Mladek <pmladek@suse.com>
show more ...
|
| 61894818 | 03-Jun-2024 |
Marcos Paulo de Souza <mpdesouza@suse.com> |
selftests: livepatch: Test atomic replace against multiple modules
Adapt the current test-livepatch.sh script to account the number of applied livepatches and ensure that an atomic replace livepatch
selftests: livepatch: Test atomic replace against multiple modules
Adapt the current test-livepatch.sh script to account the number of applied livepatches and ensure that an atomic replace livepatch disables all previously applied livepatches.
Signed-off-by: Marcos Paulo de Souza <mpdesouza@suse.com> Acked-by: Joe Lawrence <joe.lawrence@redhat.com> Reviewed-by: Miroslav Benes <mbenes@suse.cz> Link: https://lore.kernel.org/r/20240603-lp-atomic-replace-v3-1-9f3b8ace5c9f@suse.com [mbenes@suse.cz: Fixed typo in a comment.] Reviewed-by: Petr Mladek <pmladek@suse.com> Signed-off-by: Petr Mladek <pmladek@suse.com>
show more ...
|
| 54ee3526 | 21-Feb-2024 |
Marcos Paulo de Souza <mpdesouza@suse.com> |
selftests: livepatch: Avoid running the tests if kernel-devel is missing
By checking if KDIR is a valid directory we can safely skip the tests if kernel-devel isn't installed (default value of KDIR)
selftests: livepatch: Avoid running the tests if kernel-devel is missing
By checking if KDIR is a valid directory we can safely skip the tests if kernel-devel isn't installed (default value of KDIR), or if KDIR variable passed doesn't exists.
Reported-by: kernel test robot <lkp@intel.com> Closes: https://lore.kernel.org/oe-kbuild-all/202402191417.XULH88Ct-lkp@intel.com/ Signed-off-by: Marcos Paulo de Souza <mpdesouza@suse.com> Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
show more ...
|
| 6a717704 | 12-Jan-2024 |
Marcos Paulo de Souza <mpdesouza@suse.com> |
selftests: livepatch: Test livepatching a heavily called syscall
The test proves that a syscall can be livepatched. It is interesting because syscalls are called a tricky way. Also the process gets
selftests: livepatch: Test livepatching a heavily called syscall
The test proves that a syscall can be livepatched. It is interesting because syscalls are called a tricky way. Also the process gets livepatched either when sleeping in the userspace or when entering or leaving the kernel space.
The livepatch is a bit tricky: 1. The syscall function name is architecture specific. Also ARCH_HAS_SYSCALL_WRAPPER must be taken in account.
2. The syscall must stay working the same way for other processes on the system. It is solved by decrementing a counter only for PIDs of the test processes. It means that the test processes has to call the livepatched syscall at least once.
The test creates one userspace process per online cpu. The processes are calling getpid in a busy loop. The intention is to create random locations when the livepatch gets enabled. Nothing is guarantted. The magic is in the randomness.
Reviewed-by: Joe Lawrence <joe.lawrence@redhat.com> Reviewed-by: Petr Mladek <pmladek@suse.com> Signed-off-by: Marcos Paulo de Souza <mpdesouza@suse.com> Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
show more ...
|