]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
selftests/livepatch: add test for module function patching
authorPablo Alessandro Santos Hugen <phugen@redhat.com>
Fri, 20 Mar 2026 20:11:17 +0000 (17:11 -0300)
committerPetr Mladek <pmladek@suse.com>
Mon, 30 Mar 2026 13:37:31 +0000 (15:37 +0200)
commit57000fe6a60421b35ce51a338cc33caf057f5795
tree18e4e4eea01d84f7a17e85d17abb60ff50ab75bf
parent51ab33fc0a8bef9454849371ef897a1241911b37
selftests/livepatch: add test for module function patching

Add a target module and livepatch pair that verify module function
patching via a proc entry. Two test cases cover both the
klp_enable_patch path (target loaded before livepatch) and the
klp_module_coming path (livepatch loaded before target).

Signed-off-by: Pablo Alessandro Santos Hugen <phugen@redhat.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://patch.msgid.link/20260320201135.1203992-1-phugen@redhat.com
Signed-off-by: Petr Mladek <pmladek@suse.com>
tools/testing/selftests/livepatch/test-livepatch.sh
tools/testing/selftests/livepatch/test_modules/Makefile
tools/testing/selftests/livepatch/test_modules/test_klp_mod_patch.c [new file with mode: 0644]
tools/testing/selftests/livepatch/test_modules/test_klp_mod_target.c [new file with mode: 0644]