Skip to content

Conversation

@fatemender
Copy link

@fatemender fatemender commented Sep 11, 2025

The variable length array access check in aya_obj::btf::relocation::AccessSpec::new is wrong: index is the array index, not the field index. A similar but correct check can be found in match_candidate.


This change is Reviewable

@netlify
Copy link

netlify bot commented Sep 11, 2025

Deploy Preview for aya-rs-docs ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit 570dc10
🔍 Latest deploy log https://app.netlify.com/projects/aya-rs-docs/deploys/68c2f21514dc17000812c30c
😎 Deploy Preview https://deploy-preview-1343--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 project configuration.

@mergify mergify bot added the aya-obj Relating to the aya-obj crate label Sep 11, 2025
@tamird tamird requested a review from vadorovsky September 11, 2025 16:16
@vadorovsky
Copy link
Member

Good catch! Do you by any chance have a program that triggered the issue? If yes, it would be great to add it as an integration test.

@fatemender
Copy link
Author

It's actually as simple as this:

SEC("raw_tracepoint/sys_enter")
int
var_len_array_access(const struct bpf_raw_tracepoint_args *ctx) {
    unsigned long nr = BPF_CORE_READ(ctx, args[1]);
    return 0;
}

@vadorovsky
Copy link
Member

Mind adding that as an integration test? Would be great to write the test program in Rust.

Copy link
Member

@tamird tamird left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs integration test.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

aya-obj Relating to the aya-obj crate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants