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

util: Deprecate syscall_prefix #806

Merged
merged 1 commit into from
Oct 9, 2023

Conversation

vadorovsky
Copy link
Member

Using the prefix only for the host architecture is often not enough, kernels usually provide symbols for more architectures, which are used by multilib applications. Handling them might or might not be necessary depending on the use case. Due to that complexity, we decided to let the callers to handle prefixes the way they prefer.

@netlify
Copy link

netlify bot commented Oct 4, 2023

Deploy Preview for aya-rs-docs ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit bd6ba3a
🔍 Latest deploy log https://app.netlify.com/sites/aya-rs-docs/deploys/6520244a67b7f900095f68bf
😎 Deploy Preview https://deploy-preview-806--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 configuration.

@mergify mergify bot added the aya This is about aya (userspace) label Oct 4, 2023
@@ -265,6 +265,14 @@ fn parse_kernel_symbols(reader: impl BufRead) -> Result<BTreeMap<u64, String>, i
/// # Errors
///
/// Returns [`std::io::ErrorKind::NotFound`] if the prefix can't be guessed. Returns other [`std::io::Error`] kinds if `/proc/kallsyms` can't be opened or is somehow invalid.
#[deprecated(
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'd say:

On some systems - commonly on 64 bit kernels that support running 32 bit applications - the syscall prefix depends on what architecture an application is compiled for, therefore attaching to only one prefix is incorrect and can lead to security issues.

To hook into syscalls most programs should use tracepoints which provide stable, unprefixed syscall names. For cases where that's not feasible, determining syscall prefixes is left to developers.

Copy link
Member Author

Choose a reason for hiding this comment

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

Done, thanks!

Using the prefix only for the host architecture is often not enough,
kernels usually provide symbols for more architectures, which are
used by multilib applications. Handling them might or might not be
necessary depending on the use case. Due to that complexity, we
decided to let the callers to handle prefixes the way they prefer.
@vadorovsky vadorovsky merged commit 66bd85a into aya-rs:main Oct 9, 2023
21 checks passed
@vadorovsky vadorovsky deleted the deprecate-syscall-prefix branch October 9, 2023 14:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
aya This is about aya (userspace)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants