3 ms·
> Is it possible to authorize arbitrary code, or is access to msyscall (via libc or otherwise) restricted outside of boot? It looks like there are restrictions
by saagarjha 7y ago
> Is it possible to authorize arbitrary code, or is access to msyscall (via libc or otherwise) restricted outside of boot?
It looks like there are restrictions if the binary is statically-linked, but I didn’t see anything else. You could probably pledge out of it.
> It seems that the kernel itself also undergoes randomized re-linking at boot (https://www.openbsd.org/innovations.html https://www.openbsd.org/innovations.html). So what does forcing everything through libc gain us?
This doesn’t protect against attacks on the kernel (which randomizing the kernel object files protects against); exploits at this stage are trying to spawn a shell (or similar) in userspace. Going through libc means you need to 1. find it and 2. pass whatever checks it has in place to get it to make the syscall.
> Is equivalent hardening likely to make it to the Linux world in the foreseeable future?
Parts of it, maybe. But turning this on by default would break applications.
> What sort of attacks is this likely to prevent in practice?
JIT code that has maliciously crafted to call execve(“/bin/sh”, …)