Skip to contentSkip to conversation

Mismatching UAPI and helper proto definitions

QUESTION Jakub Antoni Gonera 1 participant 1 message Oct 19 BPF

lore
Share & tools
lore
#0 lore raw

Hi all,

When poking around in the verifier I noticed a mismatch between the kernel bpf_func_proto for the bpf_tail_call helper function and the declaration used by C users generated from include/uapi/linux/bpf.h, where UAPI declares the function returning long and the function proto states that the function has a void return type. After looking around there are more mismatches between function protos and UAPI:
- bpf_spin_lock/bpf_spin_unlock: protos state void return vs. UAPI long return
- bpf_get_branch_snapshot: proto states 2 arguments vs. UAPI has a third argument (u64 flags) which gets ignored

As this is essentially a documentation mismatch issue it's not a bug in the verifier per se, but this will be confusing for the users writing their eBPF programs in C relying on the header for specification. Is this a known issue?