TGTGInsighttelegram intelligenceLIVE / telegram public index
Post content
Post content
我服了,kernel 6.1 的 patch version 居然引入了新的 bug,下面的 bpf 在 6.1.152 是好的,但 6.1.158 ~ 6.1.160(HEAD) 都会在 bpf(BPF_PROG_LOAD, {prog_type=BPF_PROG_TYPE_CGROUP_SKB}) 的时候报错 EINVAL (不是 verifer error)。 struct { __uint(type, BPF_MAP_TYPE_PROG_ARRAY); __uint(max_entries, 3); __uint(key_size, sizeof(__u32)); __uint(value_size, sizeof(__u32)); } jmp_table SEC(".maps"); SEC("cgroup_skb/ingress") int cgroup_skb_ingress(struct __sk_buff *skb) { bpf_tail_call(skb, &jmp_table, 0); return 1; } SEC("cgroup_skb/egress") int cgroup_skb_egress(struct __sk_buff *skb) { bpf_tail_call(skb, &jmp_table, 0); return 1; } https://github.com/jschwinger233/kernel-6.1.160-bpf_tail_call 在更高的 minor version 上 (6.6/6.14) 也都没问题,唯有 6.1 最近几个 patch versions... 开源之美,是美酒千杯,我怎能不醉 😀