Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix verifier error to run --filter-trace-tc + --filter-track-bpf-helpers
When to run `./pwru --filter-track-bpf-helpers --filter-trace-tc --filter-func '.*udp.*' --output-limit-lines 10 icmp`, there will be a verifier error: ```log 2024/10/08 13:11:17 Attaching tc-bpf progs... 2024/10/08 13:11:17 failed to trace TC progs: failed to trace bpf progs: failed to load objects: Verifier error: load program: permission denied: func#0 @0 func#1 @43 func#2 @1062 func#3 @1118 0: R1=ctx() R10=fp0 ; int BPF_PROG(fentry_tc, struct sk_buff *skb) { @ kprobe_pwru.c:594 ... ; u64 fp = PT_REGS_FP(ctx); @ kprobe_pwru.c:399 69: (79) r1 = *(u64 *)(r10 -64) ; frame1: R1_w=ctx() R10=fp0 fp-64=ctx() 70: (79) r7 = *(u64 *)(r1 +32) func 'entry2' doesn't have 3-th argument invalid bpf_context access off=32 size=8 processed 51 insns (limit 1000000) max_states_per_insn 0 total_states 1 peak_states 1 mark_read 1 program fentry_tc: load program: permission denied: func 'entry2' doesn't have 3-th argument: invalid bpf_context access off=32 size=8 (110 line(s) omitted) ``` That's because `fentry` does not support `PT_REGS_FP`. And, there's no way for `fentry` to get FP. So, let us skip getting FP for `fentry_tc`. Signed-off-by: Leon Hwang <[email protected]>
- Loading branch information