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

Improve uprobe dynamic library path resolution to be glibc-agnostic #1110

Open
epompeii opened this issue Dec 5, 2024 · 0 comments
Open

Comments

@epompeii
Copy link
Contributor

epompeii commented Dec 5, 2024

Currently, when you provide Aya a target to attach a uprobe to, it has the following resolution strategy:

fn resolve_attach_path(target: &Path, pid: Option<pid_t>) -> Result<Cow<'_, Path>, UProbeError> {

  1. Check if the pid is set; if so find the lib in the proc maps
  2. Check if an absolute path is provided; if so assume that the path is to a binary/library path
  3. Otherwise, fallback to looking up a dynamic library in ld.so.cache

However, the use of ld.so.cache is specific to glibc. Even though Aya can be compiled to musl targets, this prevents using uprobes with dynamic library resolution in non-glibc environments, such as Alpine.

Improve the uprobe dynamic library path resolution to be glibc-agnostic.
This will likely involve searching for the provided dynamic library in PATH ourselves, instead of relying ld.so.cache.

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