-
Notifications
You must be signed in to change notification settings - Fork 11
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
Use FUNC_RET_READ
for inet_csk_accept
#201
Conversation
Not sure I grok this but, won't this break for multiple cpus? Two cpus entering the same function would basically store the return value in the same storage space. |
@haesbaert hmm, good point, didn't think of that. @stanek-michal do you know how this will work across CPUs? |
Hmm. Tested with bpftrace via
|
Using the branch where I rewrote the probes to use an updated vmlinux, it works fine:
I guess |
So I was wrong, ctx + 0 is supposed to be where the return address is, but I can't seem to find the layout of ctx. |
with the rellocation addition it's correct I believe. |
Yeah, its eBPF's R0 which is the return value, the layout I guess is just the eBPF registers (like pt_regs but for eBPF arch) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, I don't see any issues, multiple CPUs don't seem to matter here. Thanks for the changes!
Not sure that's quite right, if I understand this now, it does
So the patched_return_index here would be 4, meaning use R5 (R1=sk; R2=flags; R3=err; R4=kern; R5=ret). |
Oh interesting. I guess the ctx (which seems to be struct 'bpf_context') can be different things in different cases, like for network stuff its the packet data etc. |
Not really sure what's going on with the CI failures, can't see anything other than this:
|
I guess so as well, I'll try to read the bpf code later and see if I can confirm. |
are the tests just....timing out?
|
closes #200
This changes the
inet_csk_accept
fexit probe to useFUNC_RET_READ
instead of passing args to the method; this means we don't have to deal with the function arguments changing, like with the 6.10 kernel.Tested on Fedora with 6.10.3, but we seem to be missing the addr fields. Not sure if this is a quirk of using the fexit probe, or if there's a bug here and the
inet_csk_accept
method no longer works the way we assume.