| 62597edf | 17-Oct-2024 |
Michael Vetter <[email protected]> |
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 <[email protected]> Reviewed-by: Miroslav Benes <[email protected]> Reviewed-by: Joe Lawrence <[email protected]> Tested-by: Marcos Paulo de Souza <[email protected]> Reviewed-by: Marcos Paulo de Souza <[email protected]> Reviewed-by: Petr Mladek <[email protected]> Tested-by: Petr Mladek <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Petr Mladek <[email protected]>
show more ...
|
| 54ee3526 | 21-Feb-2024 |
Marcos Paulo de Souza <[email protected]> |
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 <[email protected]> Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/ Signed-off-by: Marcos Paulo de Souza <[email protected]> Signed-off-by: Shuah Khan <[email protected]>
show more ...
|
| 6a717704 | 12-Jan-2024 |
Marcos Paulo de Souza <[email protected]> |
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 <[email protected]> Reviewed-by: Petr Mladek <[email protected]> Signed-off-by: Marcos Paulo de Souza <[email protected]> Signed-off-by: Shuah Khan <[email protected]>
show more ...
|
| 5e4d4688 | 14-Jul-2020 |
Petr Mladek <[email protected]> |
selftests/livepatch: adopt to newer sysctl error format
With procfs v3.3.16, the sysctl command doesn't print the set key and value on error. This change breaks livepatch selftest test-ftrace.sh, t
selftests/livepatch: adopt to newer sysctl error format
With procfs v3.3.16, the sysctl command doesn't print the set key and value on error. This change breaks livepatch selftest test-ftrace.sh, that tests the interaction of sysctl ftrace_enabled:
Make it work with all sysctl versions using '-q' option.
Explicitly print the final status on success so that it can be verified in the log. The error message is enough on failure.
Reported-by: Kamalesh Babulal <[email protected]> Signed-off-by: Petr Mladek <[email protected]> Reviewed-by: Kamalesh Babulal <[email protected]> Reviewed-by: Joe Lawrence <[email protected]> Acked-by: Miroslav Benes <[email protected]> Link: https://lore.kernel.org/r/[email protected]
show more ...
|