The basic idea is to make it harder for remote code execution bugs to result in useful abilities. Restricting access to syscalls to libc, and using adress randomization to make it hard to find libc makes it harder to do system calls when you take over a program.
https://lwn.net/Articles/806863/
> For static binaries, the valid regions are the base program's text segment and the signal trampoline page.
I'm not sure but it looks like the BSD libc is some kind a special case? Surely this is not necessary? A compiler or language runtime should be able to somehow mark those segments with the appropriate permissions.
The problem, again, is not that this kernel-entry interface is factored out into a separate shared library; the problem is that it's glued into a runtime of one specific programming language that now apparently everybody has to use.
Yeah. I don't like that. Just because that's the way it works now doesn't mean it must work that way forever. Because of its stable system calls, Linux doesn't impose any design on user space. People could theoretically rebuild the entire system in Lisp or Rust or something. Potential is limitless. Also, it's amazing that I can compile a freestanding program with zero dependencies and boot Linux straight into it.
> the problem is that it's glued into a runtime of one specific programming language that now apparently everybody has to use
I agree. It's a really hard problem to solve. Since it's based on the POSIX APIs there are tons of definitions and data types that are specified exclusively in C and its preprocessor. Not exactly accessible for other languages. The preprocessor macros in particular are extremely problematic. The only sane way to untangle those is to use a C compiler.
There's an interesting discussion in that thread you linked. What if the vDSO was the entry point for all system calls? That would certainly be interesting.
I think the vDSO ABI is underspecified. It's just the C ABI, whatever that means on your system. This can cause bugs due to assumptions. For example, this Go bug happened because Go called hardened versions of the vDSO functions with insufficient stack space:
https://news.ycombinator.com/item?id=28411786
Compared to the C ABIs, the Linux system call ABI is really simple and easy to understand. No way to screw it up.
The vDSO ABI should be as simple as the system call ABI. As it is right now, it pretty much forces people to use C.
I didn't know about these efforts. Please elaborate.