You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Linux admin-pc 4.18.0-10-generic #11-Ubuntu SMP Thu Oct 11 15:13:55 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
I compile a simple test program,when I run with btf file, I obtained the following error message:
error message
libbpf: loading openat2_kern.o
libbpf: elf: section(3) kprobe/, size 16, link 0, flags 6, type=1
libbpf: sec 'kprobe/': found program 'bpf_prog' at insn offset 0 (0 bytes), code size 2 insns (16 bytes)
libbpf: elf: section(4) license, size 4, link 0, flags 3, type=1
libbpf: license of openat2_kern.o is GPL
libbpf: elf: section(5) .eh_frame, size 48, link 0, flags 2, type=1
libbpf: elf: skipping unrecognized data section(5) .eh_frame
libbpf: elf: section(6) .rel.eh_frame, size 16, link 7, flags 0, type=9
libbpf: elf: skipping relo section(6) .rel.eh_frame for section(5) .eh_frame
libbpf: elf: section(7) .symtab, size 120, link 1, flags 0, type=2
libbpf: looking for externs among 5 symbols...
libbpf: collected 0 externs total
kernel is 267008
find program is ok
libbpf: load bpf program failed: Invalid argument
libbpf: failed to load program 'bpf_prog'
libbpf: failed to load object 'openat2_kern.o'
load object file error!
Your running kernel is 4.18.0-10 and the BTF is for 4.18.0-13, why is that ? Although it might work, having types from another kernel build might not be good (or sometimes work).
Apart from that, can u make it work with a simple "return" ? Have you tried other kprobes ? Or raw tracepoints ? Unfortunately old verifiers are very lousy in their error messages and one good practice is to "bisect" your source code until "it works", thus trying to have a kprobe with a single return could git you a good indication (iirc char * will be placed in rodata, which is something that might not work in older kernels, it is worth checking).
testing environment:
Linux admin-pc 4.18.0-10-generic #11-Ubuntu SMP Thu Oct 11 15:13:55 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
I compile a simple test program,when I run with btf file, I obtained the following error message:
error message
The btf file I'm using comes from the github repository: https://github.com/aquasecurity/btfhub-archive/
test code
The text was updated successfully, but these errors were encountered: