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

Inside aya-ebpf::programs some raw pointers are having pub visibility. #931

Open
gabhijit opened this issue Apr 17, 2024 · 0 comments
Open

Comments

@gabhijit
Copy link

Inside the crate aya-ebpf in the programs module (ebpf/aya-ebpf/src/programs), some internal raw pointers are exposed to user facing code as pub members. For example inside programs/device.rs) -

pub struct DeviceContext {
    pub device: *mut bpf_cgroup_dev_ctx,
}

This would allow the user code to use a raw pointer.

This is not consistent across all sub-modules.

Locally, I tried to fix those pub members and checked following -

$ cargo test
$ cargo xtask integration-tests local

Integration tests suggested a few failures as follows, but they appear to be unrelated.

failures:
    tests::btf_relocations::relocation_tests::_enum_signed_32_checked_variants_true_some_kernelversion_new_6_0_0_https_github_com_torvalds_linux_commit_6089fb3_0x7bbbbbbbi32_as_u64_expects
    tests::btf_relocations::relocation_tests::_enum_signed_32_true_some_kernelversion_new_6_0_0_https_github_com_torvalds_linux_commit_6089fb3_0x7bbbbbbbi32_as_u64_expects
    tests::btf_relocations::relocation_tests::_enum_signed_64_checked_variants_true_some_kernelversion_new_6_0_0_https_github_com_torvalds_linux_commit_6089fb3_0xcccccccdddddddi64_as_u64_expects
    tests::btf_relocations::relocation_tests::_enum_signed_64_true_some_kernelversion_new_6_0_0_https_github_com_torvalds_linux_commit_6089fb3_0xcccccccddddddddi64_as_u64_expects
    tests::btf_relocations::relocation_tests::_enum_unsigned_64_checked_variants_true_some_kernelversion_new_6_0_0_https_github_com_torvalds_linux_commit_6089fb3_0xccccccccdddddddd_expects
    tests::btf_relocations::relocation_tests::_enum_unsigned_64_true_some_kernelversion_new_6_0_0_https_github_com_torvalds_linux_commit_6089fb3_0xccccccccdddddddd_expects

Can send a draft PR for this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant