-
Notifications
You must be signed in to change notification settings - Fork 336
Interface improvements #4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This makes it somewhat easy to use. From the root git dir, just: sudo scripts/kpatch-build ~/foo.patch and it'll take care of everything, eventually spitting out the base module (kpatch.ko) and the hotpatch module kpatch-foo.ko. This is still all very crude, but a better user interface is coming soon.
Member
Author
|
Added a commit to clarify that kpatch should work on non-Fedora |
Organize the files functionally: - kmod/core: core kmod source - kmod/patch: patch kmod source - kpatch: kpatch script - kpatch-build: kpatch build script and supporting tools - contrib: distro-related files
Saves about 2G disk space per kernel version
jpoimboe
pushed a commit
to jpoimboe/kpatch
that referenced
this pull request
Feb 6, 2019
ppc64le: Add test object for section addralign
sm00th
added a commit
to sm00th/kpatch
that referenced
this pull request
Feb 14, 2022
Yet another hack, which needs to be addressed properly. Without this create-diff-object segfaults in kpatch_is_core_module_symbol() trying to compare rela->sym->name which has been zeroed by kelf_patched teardown. #0 0x00007ffff7f10c0e in __strcmp_avx2 () from /lib64/libc.so.6 dynup#1 0x000000000040a09d in kpatch_is_core_module_symbol (name=0x0) at create-diff-object.c:3130 dynup#2 0x000000000040a209 in need_dynrela (table=0x95c52c80, sec=0x95c52300, rela=0xa7648330) at create-diff-object.c:3186 dynup#3 0x000000000040a463 in kpatch_create_intermediate_sections (kelf=0x4dbc940, table=0x95c52c80, objname=0x7fffffffd8a1 "vmlinux", pmod_name=0x7fffffffd8f9 "livepatch_0001_cmdline_test_patch") at create-diff-object.c:3350 dynup#4 0x000000000040c206 in main (argc=8, argv=0x7fffffffd428) at create-diff-object.c:3954 Signed-off-by: Artem Savkov <asavkov@redhat.com>
jpoimboe
added a commit
to jpoimboe/kpatch
that referenced
this pull request
Apr 6, 2022
A seg fault was reported: Program received signal SIGSEGV, Segmentation fault. 0x00007ffff7f18c8e in __strcmp_avx2 () from /lib64/libc.so.6 Missing separate debuginfos, use: dnf debuginfo-install elfutils-libelf-0.186-1.fc34.x86_64 zlib-1.2.11-26.fc34.x86_64 (gdb) bt #0 0x00007ffff7f18c8e in __strcmp_avx2 () from /lib64/libc.so.6 #1 0x000000000040a0f7 in kpatch_is_core_module_symbol (name=0x0) at create-diff-object.c:3060 #2 0x000000000040a267 in need_dynrela (kelf=0x4669a0, table=0x92af30, sec=0x6d6b20, rela=0x8c7fd0) at create-diff-object.c:3117 dynup#3 0x000000000040a4cc in kpatch_create_intermediate_sections (kelf=0x4669a0, table=0x92af30, objname=0x7fffffffcfc6 "vmlinux", pmod_name=0x7fffffffd020 "livepatch_a") at create-diff-object.c:3281 dynup#4 0x000000000040c7c5 in main (argc=8, argv=0x7fffffffca48) at create-diff-object.c:3931 It happened because 'rela->sym->name' was NULL, and kpatch_is_core_module_symbol() tried to dereference it. Here's the corresponding relocation: Relocation section [455] '.rela.debug_loclists' for section [454] '.debug_loclists' at offset 0xd0478 contains 2432 entries: Offset Type Value Addend Name ... 0x000000000000aad6 X86_64_64 000000000000000000 +32 .LC55 ... That '.LC55' symbol lives in the following section: [104] .rodata.btf_show_end_aggr_type.str1.8 PROGBITS 0000000000000000 00003ef0 00000021 1 AMS 0 0 8 The problem is that the symbol wasn't included in the output file (though its corresponding section was). So it got zeroed by kpatch_elf_teardown(), which was designed to trigger seg faults to help find bugs like this. The string literal sections which hold the '.LCx' string symbols are already being included. Include their symbols as well. Fixes dynup#1257. Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com>
jpoimboe
added a commit
to jpoimboe/kpatch
that referenced
this pull request
Apr 6, 2022
A seg fault was reported: Program received signal SIGSEGV, Segmentation fault. 0x00007ffff7f18c8e in __strcmp_avx2 () from /lib64/libc.so.6 Missing separate debuginfos, use: dnf debuginfo-install elfutils-libelf-0.186-1.fc34.x86_64 zlib-1.2.11-26.fc34.x86_64 (gdb) bt #0 0x00007ffff7f18c8e in __strcmp_avx2 () from /lib64/libc.so.6 #1 0x000000000040a0f7 in kpatch_is_core_module_symbol (name=0x0) at create-diff-object.c:3060 #2 0x000000000040a267 in need_dynrela (kelf=0x4669a0, table=0x92af30, sec=0x6d6b20, rela=0x8c7fd0) at create-diff-object.c:3117 dynup#3 0x000000000040a4cc in kpatch_create_intermediate_sections (kelf=0x4669a0, table=0x92af30, objname=0x7fffffffcfc6 "vmlinux", pmod_name=0x7fffffffd020 "livepatch_a") at create-diff-object.c:3281 dynup#4 0x000000000040c7c5 in main (argc=8, argv=0x7fffffffca48) at create-diff-object.c:3931 It happened because 'rela->sym->name' was NULL, and kpatch_is_core_module_symbol() tried to dereference it. Here's the corresponding relocation: Relocation section [455] '.rela.debug_loclists' for section [454] '.debug_loclists' at offset 0xd0478 contains 2432 entries: Offset Type Value Addend Name ... 0x000000000000aad6 X86_64_64 000000000000000000 +32 .LC55 ... That '.LC55' symbol lives in the following section: [104] .rodata.btf_show_end_aggr_type.str1.8 PROGBITS 0000000000000000 00003ef0 00000021 1 AMS 0 0 8 The problem is that the symbol wasn't included in the output file (though its corresponding section was). So it got zeroed by kpatch_elf_teardown(), which was designed to trigger seg faults to help find bugs like this. The string literal sections which hold the '.LCx' string symbols are already being included. Include their symbols as well. Fixes dynup#1257. Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Add build caching and flesh out kpatch-build so that it's a one-step process.
This is just a first step, I'll have much better makefiles and user interface soon.