-
Notifications
You must be signed in to change notification settings - Fork 131
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Binary syscall bypass through VDSO
MUSL utilizes the `__syscall` macro to perform system calls. Syscalls with varying numbers of parameters are further dispatched to implementations like `__syscall1`, `__syscall2`, and so on. These implementations employ the `syscall` instruction for binary syscalls. To bypass binary syscalls, we extract the `__kernel_vsyscall` symbol from VDSO and replace the `syscall` instruction with a direct call to the kernel functions. Note that during the initialization process of MUSL, certain syscalls will be used. However, at this point, the `__kernel_vsyscall` symbol has not yet been extracted. It's also possible that the kernel could not provide this interface. In such cases, the `__kernel_vsyscall` pointer remains at its default value of `NULL`, and MUSL will continue to use binary syscalls. Since we do not support syscalls with cancellation points (syscall_cp), we merely map them to regular syscalls. Signed-off-by: Tianyi Liu <[email protected]> Signed-off-by: Simon Kuenzer <[email protected]> Co-authored-by: Simon Kuenzer <[email protected]> Reviewed-by: Ioan-Teodor Teugea <[email protected]> Reviewed-by: Andra Paraschiv <[email protected]> Approved-by: Simon Kuenzer <[email protected]> GitHub-Closes: #1
- Loading branch information
Showing
2 changed files
with
103 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters