From bd6ba3ad8bae0537eee9eb78d20620592daa3c76 Mon Sep 17 00:00:00 2001 From: Mike Rostecki Date: Wed, 4 Oct 2023 14:27:47 +0100 Subject: [PATCH] util: Deprecate `syscall_prefix` 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. --- aya/src/util.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/aya/src/util.rs b/aya/src/util.rs index a0cc357d..3184dae4 100644 --- a/aya/src/util.rs +++ b/aya/src/util.rs @@ -265,6 +265,13 @@ fn parse_kernel_symbols(reader: impl BufRead) -> Result, 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( + since = "0.12.0", + note = "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." +)] pub fn syscall_prefix() -> Result<&'static str, io::Error> { const PREFIXES: [&str; 7] = [ "sys_",