-
Notifications
You must be signed in to change notification settings - Fork 290
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
ebpf: Call bpf_probe_read
on *const T
BTF arguments
#543
base: main
Are you sure you want to change the base?
Conversation
✅ Deploy Preview for aya-rs-docs ready!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify site configuration. |
487a8c5
to
f41be0b
Compare
@vadorovsky mind rebasing? |
@vadorovsky, this pull request is now in conflict and requires a rebase. |
@vadorovsky, this pull request is now in conflict and requires a rebase. |
LGTM. I think this should be merged. @vadorovsky mind rebasing? |
f41be0b
to
cbb2602
Compare
70f4e76
to
497d3e3
Compare
I rebased this, but I think the tests need more work. |
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.
Reviewed 7 of 9 files at r1, 6 of 6 files at r2, all commit messages.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @vadorovsky)
test/integration-test/src/tests/args.rs
line 1 at r2 (raw file):
use aya::{
not clear to me what we're testing here
test/integration-ebpf/src/args.rs
line 11 at r2 (raw file):
#[kprobe] pub fn kprobe_vfs_write(ctx: ProbeContext) { let _: Option<usize> = ctx.arg(3);
what exactly are we testing here?
497d3e3
to
e38ac3a
Compare
It's necessary to call `bpf_probe_read` not only for pointers retrieved from `PtRegs`, but also from BTF arguments. `bpf_probe_read` might return an error, so the return type of `.arg()` methods in contexts handling BTF arguments changes from `T` to `Option<T>`. `None` is returned when `bpf_probe_read` call is not successful. Fixes: aya-rs#542
e38ac3a
to
40b1c02
Compare
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.
Reviewed 5 of 5 files at r3, all commit messages.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @vadorovsky)
It's necessary to call
bpf_probe_read
not only for pointers retrieved fromPtRegs
, but also from BTF arguments.bpf_probe_read
might return an error, so the return type of.arg()
methods in contexts handling BTF arguments changes fromSelf
toOption<Self>
.None
is returned whenbpf_probe_read
call is not successful.Fixes: #542
This change is