Re: [PATCH v1 3/5] kbuild/modpost: integrate klp-convert

2024-01-25 Thread Lukas Hruska
There is also a typo in Makefile which causes a modules.livepatch file to be created in kernel sources even in case of building an external module. > diff --git a/Makefile b/Makefile > index 2fdd8b40b7e0..459b9c9fe0a8 100644 > --- a/Makefile > +++ b/Makefile > @@ -1185,6 +1185,7 @@ PHONY += prepar

Re: [PATCH v1 0/5] livepatch: klp-convert tool - Minimal version

2024-04-11 Thread Lukas Hruska
Hi, > > Do we have anything that blocks klp-convert-mini to be merged, or something > > that > > needs to be fixed? > > there is feedback from Petr and I agree with him that a selftest would be > appropriate. > > Lukas, are you planning to send v2 with everything addressed? Yes, I definitely

[PATCH v2 0/5] livepatch: klp-convert tool - Minimal version

2024-05-16 Thread Lukas Hruska
Summary --- This is a significantly simplified version of the original klp-convert tool. The klp-convert code has never got a proper review and also clean ups were not easy. The last version was v7, see https://lore.kernel.org/r/20230306140824.3858543-1-joe.lawre...@redhat.com The main change

[PATCH v2 1/6] livepatch: Create and include UAPI headers

2024-05-16 Thread Lukas Hruska
From: Josh Poimboeuf Define klp prefixes in include/uapi/linux/livepatch.h, and use them for replacing hard-coded values in kernel/livepatch/core.c. Signed-off-by: Josh Poimboeuf Signed-off-by: Lukas Hruska Reviewed-by: Petr Mladek Reviewed-by: Marcos Paulo de Souza --- MAINTAINERS

[PATCH v2 3/6] kbuild/modpost: integrate klp-convert

2024-05-16 Thread Lukas Hruska
From: Josh Poimboeuf Call klp-convert for the livepatch modules after the final linking. Also update the modpost tool so that it does not warn about unresolved symbols matching the expected format which will be then resolved by klp-convert. Signed-off-by: Josh Poimboeuf Signed-off-by: Lukas

[PATCH v2 2/6] livepatch: Add klp-convert tool

2024-05-16 Thread Lukas Hruska
tly support the compilation of the new tool, update MAINTAINERS file and add a .gitignore file. [jpoim...@redhat.com: initial version] Signed-off-by: Josh Poimboeuf [joe.lawre...@redhat.com: clean-up and fixes] Signed-off-by: Joe Lawrence [lhru...@suse.cz: klp-convert code, minimal approach] Signed

[PATCH v2 4/6] livepatch: Add sample livepatch module

2024-05-16 Thread Lukas Hruska
function cmdline_proc_show to print the string referenced by the symbol saved_command_line appended by the string "livepatch=1". Signed-off-by: Josh Poimboeuf Signed-off-by: Lukas Hruska Reviewed-by: Petr Mladek --- samples/livepatch/Makefile | 1 + samples/livepatch

[PATCH v2 5/6] documentation: Update on livepatch elf format

2024-05-16 Thread Lukas Hruska
Add a section to Documentation/livepatch/module-elf-format.rst describing how klp-convert works for fixing relocations. Signed-off-by: Lukas Hruska Reviewed-by: Petr Mladek Reviewed-by: Marcos Paulo de Souza --- Documentation/livepatch/module-elf-format.rst | 67 +++ 1 file

[PATCH v2 6/6] selftests: livepatch: Test livepatching function using an external symbol

2024-05-16 Thread Lukas Hruska
The test proves that klp-convert works as intended and it is possible to livepatch a function that use an external symbol. Signed-off-by: Lukas Hruska --- .../testing/selftests/livepatch/functions.sh | 16 +- .../selftests/livepatch/test-extern.sh| 57

[PATCH v1 0/5] livepatch: klp-convert tool - Minimal version

2023-11-06 Thread Lukas Hruska
Summary --- This is a significantly simplified version of the original klp-convert tool. The klp-convert code has never got a proper review and also clean ups were not easy. The last version was v7, see https://lore.kernel.org/r/20230306140824.3858543-1-joe.lawre...@redhat.com The main chan

[PATCH v1 1/5] livepatch: Create and include UAPI headers

2023-11-06 Thread Lukas Hruska
From: Josh Poimboeuf Define klp prefixes in include/uapi/linux/livepatch.h, and use them for replacing hard-coded values in kernel/livepatch/core.c. Signed-off-by: Josh Poimboeuf Signed-off-by: Lukas Hruska --- MAINTAINERS| 1 + include/uapi/linux/livepatch.h | 15

[PATCH v1 2/5] livepatch: Add klp-convert tool

2023-11-06 Thread Lukas Hruska
tly support the compilation of the new tool, update MAINTAINERS file and add a .gitignore file. [jpoim...@redhat.com: initial version] Signed-off-by: Josh Poimboeuf [joe.lawre...@redhat.com: clean-up and fixes] Signed-off-by: Joe Lawrence [lhru...@suse.cz: klp-convert code, minimal appr

[PATCH v1 3/5] kbuild/modpost: integrate klp-convert

2023-11-06 Thread Lukas Hruska
From: Josh Poimboeuf Update the modpost program so that it does not warn about unresolved symbols matching the expected format which will be then resolved by klp-convert. Signed-off-by: Josh Poimboeuf Signed-off-by: Lukas Hruska --- .gitignore| 1 + Makefile

[PATCH v1 4/5] livepatch: Add sample livepatch module

2023-11-06 Thread Lukas Hruska
function cmdline_proc_show to print the string referenced by the symbol saved_command_line appended by the string "livepatch=1". Signed-off-by: Josh Poimboeuf Signed-off-by: Lukas Hruska --- samples/livepatch/Makefile| 1 + .../livepatch/livepatch-annotated-sample

[PATCH v1 5/5] documentation: Update on livepatch elf format

2023-11-06 Thread Lukas Hruska
Add a section to Documentation/livepatch/module-elf-format.rst describing how klp-convert works for fixing relocations. Signed-off-by: Lukas Hruska --- Documentation/livepatch/module-elf-format.rst | 67 +++ 1 file changed, 67 insertions(+) diff --git a/Documentation/livepatch

Re: [PATCH v2 2/6] livepatch: Add klp-convert tool

2024-06-06 Thread Lukas Hruska
Hello Joe, > > +#define KLP_RELOC_SYMBOL_POS(LP_OBJ_NAME, SYM_OBJ_NAME, SYM_NAME, SYM_POS) > > \ > > + asm("\".klp.sym.rela." #LP_OBJ_NAME "." #SYM_OBJ_NAME "." #SYM_NAME "," > > #SYM_POS "\"") > > ^^^ > I think I foun

[PATCH v3 1/6] livepatch: Create and include UAPI headers

2024-08-27 Thread Lukas Hruska
From: Josh Poimboeuf Define klp prefixes in include/uapi/linux/livepatch.h, and use them for replacing hard-coded values in kernel/livepatch/core.c. Signed-off-by: Josh Poimboeuf Signed-off-by: Lukas Hruska Reviewed-by: Petr Mladek Reviewed-by: Marcos Paulo de Souza --- MAINTAINERS

[PATCH v3 0/6] livepatch: klp-convert tool - Minimal version

2024-08-27 Thread Lukas Hruska
Summary --- This is a significantly simplified version of the original klp-convert tool. The klp-convert code has never got a proper review and also clean ups were not easy. The last version was v7, see https://lore.kernel.org/r/20230306140824.3858543-1-joe.lawre...@redhat.com The main change

[PATCH v3 3/6] kbuild/modpost: integrate klp-convert

2024-08-27 Thread Lukas Hruska
From: Josh Poimboeuf Call klp-convert for the livepatch modules after the final linking. Also update the modpost tool so that it does not warn about unresolved symbols matching the expected format which will be then resolved by klp-convert. Signed-off-by: Josh Poimboeuf Signed-off-by: Lukas

[PATCH v3 2/6] livepatch: Add klp-convert tool

2024-08-27 Thread Lukas Hruska
tly support the compilation of the new tool, update MAINTAINERS file and add a .gitignore file. [jpoim...@redhat.com: initial version] Signed-off-by: Josh Poimboeuf [joe.lawre...@redhat.com: clean-up and fixes] Signed-off-by: Joe Lawrence [lhru...@suse.cz: klp-convert code, minimal approach] Signed-off-b

[PATCH v3 4/6] livepatch: Add sample livepatch module

2024-08-27 Thread Lukas Hruska
function cmdline_proc_show to print the string referenced by the symbol saved_command_line appended by the string "livepatch=1". Signed-off-by: Josh Poimboeuf Signed-off-by: Lukas Hruska Reviewed-by: Petr Mladek --- samples/livepatch/Makefile | 1 + samples/livepatch

[PATCH v3 5/6] documentation: Update on livepatch elf format

2024-08-27 Thread Lukas Hruska
Add a section to Documentation/livepatch/module-elf-format.rst describing how klp-convert works for fixing relocations. Signed-off-by: Lukas Hruska Reviewed-by: Petr Mladek Reviewed-by: Marcos Paulo de Souza --- Documentation/livepatch/module-elf-format.rst | 67 +++ 1 file

[PATCH v3 6/6] selftests: livepatch: Test livepatching function using an external symbol

2024-08-27 Thread Lukas Hruska
The test proves that klp-convert works as intended and it is possible to livepatch a function that use an external symbol. Signed-off-by: Lukas Hruska Reviewed-by: Petr Mladek Tested-by: Petr Mladek --- tools/testing/selftests/livepatch/Makefile| 3 +- .../testing/selftests/livepatch

[PATCH v3 7/6 DONT_MERGE] selftests: livepatch: Test failing IBT checks crashing the module

2024-08-27 Thread Lukas Hruska
This patch is only an example of how to generate #GP by IBT. It serves only as an example for those wondering how the Linux behaves in this case. Don't merge this patch, because it causes a refcount underflow of the test module, so it's not possible to unload it. Signed-off-by: Lu