retis-org / retis

Tracing packets in the Linux networking stack & friends
https://retis.readthedocs.io/en/stable/
100 stars 14 forks source link

tree: add skb offset validation helpers #277

Closed atenart closed 1 year ago

atenart commented 1 year ago

Validating offsets in an skb is no easy task. Add helpers to make checks more consistent in our probes and do the best we can do to guess if offsets are valid or not.

Note that this cannot be 100% failsafe. When converting Retis to parse packets in the Rust side we'll be able to improve further offset detection by using the BPF side as a hint only.

atenart commented 1 year ago

Turns out the pcap support (merged in #265) was causing a verifier issue on Ubuntu 22.04. This PR now also fixes it (which was not straightforward but I think the fix is acceptable).