I wrote an kind of SELinux clone that supervises system call execution such as open and execve.
The result is proven by SELinux as a secure way to monitor all disk access made by users.
The code modifies the syscall table in the following way:
- Change the name->address relationship of a syscall
- After the change, the syscall name is my own function, which then calls the original syscall.
- the original syscall address is protected by address space layout randomization which requires scanning 16 exabytes of data, and the address changes with every reboot.
Old trick, but the only way I found to achieve this is via a service routine exported only to GPL modules with the following code:
MODULE_LICENSE("GPL");
Is there a way to discover either the syscall table or the syscall address without a GPL kernel module?