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

ebpf: Call bpf_probe_read on *const T BTF arguments #543

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

vadorovsky
Copy link
Member

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 Self to Option<Self>. None is returned when bpf_probe_read call is not successful.

Fixes: #542

@netlify
Copy link

netlify bot commented Mar 14, 2023

Deploy Preview for aya-rs-docs ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit f41be0b
🔍 Latest deploy log https://app.netlify.com/sites/aya-rs-docs/deploys/64107e6c8c0e1300085d8b9a
😎 Deploy Preview https://deploy-preview-543--aya-rs-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

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
@tamird
Copy link
Member

tamird commented Aug 25, 2023

@vadorovsky mind rebasing?

@mergify mergify bot added aya-bpf This is about aya-bpf (kernel) test A PR that improves test cases or CI labels Sep 14, 2023
@mergify
Copy link

mergify bot commented Sep 14, 2023

@vadorovsky, this pull request is now in conflict and requires a rebase.

@mergify mergify bot added the needs-rebase label Sep 14, 2023
Copy link

mergify bot commented Feb 6, 2024

@vadorovsky, this pull request is now in conflict and requires a rebase.

@kamyuentse
Copy link

LGTM. I think this should be merged. @vadorovsky mind rebasing?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
aya-bpf This is about aya-bpf (kernel) needs-rebase test A PR that improves test cases or CI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

fentry/fexit: Do bpf_probe_read inside .arg()
3 participants