current_cred in Rust

48 Views Asked by At

I am implementing a Linux Security Module (LSM) in Rust using eBPF (aya-rs). While I was able to define different hooks, I havent been able to get the current task's credentials (as LSM modules do by calling current_cred).

How can I get them?

I tried to define current_cred as an extern function

#[allow(improper_ctypes)]
extern "C" {
    fn current_cred() -> *const cred;
}

But I received the following error during compilation:

function 0x90 not found while relocating `file_open`
0

There are 0 best solutions below