Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

track skb pointer #84

Closed
borkmann opened this issue Aug 25, 2022 · 3 comments · Fixed by #194
Closed

track skb pointer #84

borkmann opened this issue Aug 25, 2022 · 3 comments · Fixed by #194
Labels
good first issue Good for newcomers help wanted Extra attention is needed

Comments

@borkmann
Copy link
Member

borkmann commented Aug 25, 2022

Would be great to track the pointer itself after the initial pkt classification match, and then keep following based on pointer value. Example was filtering on specific port:

[...]
0xffff8882262bf600    [ksoftirqd/1]             tcf_classify    4840296765444
0xffff8882262bf600    [ksoftirqd/1]      skb_ensure_writable    4840296788712
0xffff8882262bf600    [ksoftirqd/1] inet_proto_csum_replace4    4840296792231
0xffff8882262bf600    [ksoftirqd/1]      skb_ensure_writable    4840296794062         <--- last occurrence before out of sight
0xffff8882262bf900        [<empty>]             ip_local_out    4856424668947
0xffff8882262bf900        [<empty>]           __ip_local_out    4856424679151
0xffff8882262bf900        [<empty>]             nf_hook_slow    4856424682172
[...]

What can be seen, we lost track of pointer 0xffff8882262bf600 after skb_ensure_writable because in the tc BPF program we did NAT'ing of the packet.

@brb brb added good first issue Good for newcomers help wanted Extra attention is needed labels Aug 29, 2022
@varunkumare99
Copy link
Contributor

I would like to work on this.
Any advice on how to begin?
Thanks

@brb
Copy link
Member

brb commented Nov 24, 2022

@varunkumare99 Great. The idea is to introduce a BPF map to store SKB pointer, and then check for each SKB whether the pointer exists in that map. The feature should be protected by the --filter-track-skb flag.

@varunkumare99
Copy link
Contributor

cool.
I'm on it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants