Comments (12)
from kpatch.
The config used in the test.
from kpatch.
Wow, riding the bleeding edge @liu-song-6 ... looking through some of the commits in v6.2, this one looks interesting:
torvalds/linux@bea75b3 ("x86/Kconfig: Introduce function padding") I wonder if that change explains this msg (also I notice readelf --wide --symbol
reports "FUNC" values are now 0x10.
I think disassembly confirms it:
$ KCFLAGS="-ffunction-sections -fdata-sections" \
make -j$(nproc) fs/proc/cmdline.o
...
$ objdump -Dr -j.text.cmdline_proc_show fs/proc/cmdline.o
fs/proc/cmdline.o: file format elf64-x86-64
Disassembly of section .text.cmdline_proc_show:
0000000000000000 <cmdline_proc_show-0x10>:
0: 90 nop
1: 90 nop
2: 90 nop
3: 90 nop
4: 90 nop
5: 90 nop
6: 90 nop
7: 90 nop
8: 90 nop
9: 90 nop
a: 90 nop
b: 90 nop
c: 90 nop
d: 90 nop
e: 90 nop
f: 90 nop
0000000000000010 <cmdline_proc_show>:
10: f3 0f 1e fa endbr64
14: 53 push %rbx
15: 48 8b 35 00 00 00 00 mov 0x0(%rip),%rsi # 1c <cmdline_proc_show+0xc>
18: R_X86_64_PC32 saved_command_line-0x4
1c: 48 89 fb mov %rdi,%rbx
1f: e8 00 00 00 00 call 24 <cmdline_proc_show+0x14>
20: R_X86_64_PLT32 seq_puts-0x4
24: 48 89 df mov %rbx,%rdi
27: be 0a 00 00 00 mov $0xa,%esi
2c: e8 00 00 00 00 call 31 <cmdline_proc_show+0x21>
2d: R_X86_64_PLT32 seq_putc-0x4
31: 31 c0 xor %eax,%eax
33: 5b pop %rbx
34: e9 00 00 00 00 jmp 39 <cmdline_proc_show+0x29>
35: R_X86_64_PLT32 __x86_return_thunk-0x4
from kpatch.
@liu-song-6 : I quickly hacked together: joe-lawrence@9c9426e this will at least build a few of the small patches... how about the one you are testing with?
from kpatch.
if (sym->sym.st_value != 0 &&
if (sym->sym.st_value != 0x10 &&
I think this breaks it on older kernels. And the error message in the line 244 needs update.
Somehow, I am getting sym->sym.st_value of 0 now, even with 6.2-rc2... I am not sure what was changed.
from kpatch.
if (sym->sym.st_value != 0 && if (sym->sym.st_value != 0x10 &&
I think this breaks it on older kernels. And the error message in the line 244 needs update.
Somehow, I am getting sym->sym.st_value of 0 now, even with 6.2-rc2... I am not sure what was changed.
Right it that commit was just hacked together for testing. A real fix would probably need to key off arch and kernel version and indicate to create-diff-object what the nop padding size should be (if any). You could probably make the condition check 0 or 0x10 offset if that moves you forward.
from kpatch.
liu-song-6 commented on September 28, 2024 I have got st_value == 0 for some functions, and st_value == 0x10 for some other functions. I guess we do need 0 for 0x10 here.
from kpatch.
joe-lawrence commented on September 28, 2024 Yeah, I notice that some/all? '.cold' functions don't get the padding, so there are definitely multiple offsets we'll need to handle.
from kpatch.
joe-lawrence commented on September 28, 2024 A second attempt: a3f3688 is more flexible in that it accounts for any amount of NOP padding on x86. That should retain backwards compat and keep the unit tests happy.
from kpatch.
liu-song-6 commented on September 28, 2024 I am getting
ERROR: multiple parent matches for raid10.o: drivers/md/built-in.a drivers/md/raid10.mod.
For a simple patch:
--- drivers/md/raid10.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/md/raid10.c b/drivers/md/raid10.c index 3aa8b6e11d58..5c1e95892b93 100644 --- a/drivers/md/raid10.c +++ b/drivers/md/raid10.c @@ -4298,6 +4298,9 @@ static void raid10_free(struct mddev *mddev, void *priv) { struct r10conf *conf = priv; + if (!conf) + return; + mempool_exit(&conf->r10bio_pool); safe_put_page(conf->tmppage); kfree(conf->mirrors); -- 2.30.2
from kpatch.
joe-lawrence commented on September 28, 2024 I agree w/ @swine. I could repro the same ancestor problem as I was adding .config options, starting with the =m, then moving on to grabbing @liu-song-6 's entire attached config. Only after doing a make clean and make mrproper, the error went away.
from kpatch.
liu-song-6 commented on September 28, 2024 Yeah, the error went away after
make clean
. Sorry about the noise.from kpatch.
Related Issues (20)
- Do we need more robust archeticture protection HOT 4
- kpatch-build: verify_patch_files might miss a parameter HOT 2
- ERROR in find_local_syms, couldn't find matching XXX local symbols in vmlinux symbol table HOT 14
- Can you add support for Rocky and Alma? HOT 1
- relocation with type R_X86_64_GOTPCREL is not supported HOT 5
- Arch Compile kpatch-git test failed HOT 4
- Regarding "statically allocated data" again HOT 2
- kpatch-build error when modifying an object file's only syscall
- nowhere to find the definition of klp_register_patch HOT 5
- x86 paravirt code uses alternatives v6.8+ HOT 1
- special-static.patch can fail to build on s390x / upstream v6.8 HOT 6
- CONFIG_FTRACE_MCOUNT_USE_PATCHABLE_FUNCTION_ENTRY not supported on ppc64le HOT 6
- function __pfx_new_sync_read has no fentry/mcount call, unable to patch HOT 6
- Unchanged and unpatchable function moves from .text to .text.unlikely HOT 5
- Why did the kpatch-build script export the KPATCH-BUILD environment variable from the BUILD directory to the SOURCE directory? HOT 3
- CONFIG_WERROR=y and CONFIG_LD_ORPHAN_WARN_LEVEL="error" break kpatch-build HOT 2
- linux 6.9.0-rc6 can't find special struct paravirt_patch_site size HOT 6
- fair.o: changed section .data..read_mostly not selected for inclusion HOT 11
- find_local_syms: 218: couldn't find matching cm.c local symbols in ib_mad symbol table HOT 7
- Kernel Warning: Unpatched return thunk in use. This should not happen! HOT 7
Recommend Projects
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
TensorFlow
An Open Source Machine Learning Framework for Everyone
Django
The Web framework for perfectionists with deadlines.
Laravel
A PHP framework for web artisans
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
Recommend Topics
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
web
Some thing interesting about web. New door for the world.
server
A server is a program made to process requests and deliver data to clients.
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Visualization
Some thing interesting about visualization, use data art
Game
Some thing interesting about game, make everyone happy.
Recommend Org
We are working to build community through open source technology. NB: members must have two-factor auth.
Microsoft
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba
Alibaba Open Source for everyone
D3
Data-Driven Documents codes.
Tencent
China tencent open source team.
from kpatch.