
Networking
Fix 'invalid access to packet' Verifier Errors in XDP
Decode the eBPF verifier message invalid access to packet in an XDP program, read the off, size and r values, and add the missing data_end bounds check.
7 min read
Tag
3 posts

Decode the eBPF verifier message invalid access to packet in an XDP program, read the off, size and r values, and add the missing data_end bounds check.

Write, compile and attach an XDP program in C that drops UDP packets for one port, with the bounds checks the verifier demands and a test you can run.

XDP runs eBPF programs on packets inside the NIC driver, before the kernel builds an skb. See the hook point, the five verdicts and the three attach modes.