News for hackers. Stuff that matters.
Re:OpenBSD system-call-origin verification by quotemstr on Sunday December 22, 2019 @08:14PM (#21860804)
I strongly support this policy not only for security, but also for general operating system robustness. Linux is pretty much the only system that places the ABI compatibility boundary and the machine privilege level boundary in the same place in the stack. I think that's the wrong place: it pushes a lot of complexity that could be in userspace into the kernel, because the kernel is the first place past the ABI break. Linux would be better if nobody except libc were allowed to make system calls and we just made libc (or a giant VDSO) the ABI support boundary.

We should at the very least have a VDSO for every system call. There should be some opportunity to run code in userspace before a privilege transition. Doing so would give us a lot more flexibility than we have now.

For example, consider socketcall(2): for a long time, all Linux socket system calls (like recvmsg) were multiplexed through a single system call. A few years ago, the kernel community realized that this multiplexing was a bad idea and made individual system calls for all the traditional socket operations. But since we have to support old programs, we have socketcall(2) and the new system calls in the kernel. Why should we?

If the ABI support level had been libc all along, we could have changed the system call strategy (from multiplexing to fine-grained calls) transparently without bloating the kernel with compatibility code.

Re:OpenBSD system-call-origin verification by saagarjha on Sunday December 22, 2019 @08:21PM (#21860832)
> We should have a VDSO for every system call.

This doesn't really make sense; the vDSO only works for system calls that do nothing but read a value from the kernel and return it to userspace.

Re:OpenBSD system-call-origin verification by quotemstr on Sunday December 22, 2019 @08:25PM (#21860854)
Not the case. Some VDSOs just forward to regular system calls. Try clock_gettime with CLOCK_BOOTTIME sometime. (I need to send a patch to fix this. Maybe over Christmas.)

Requiring that every system call go through a VDSO would be great because it would give us a "hook" for changing system behavior before entering the kernel, which is a good thing, because in the age of speculative execution mitigations, entering the kernel is expensive, just like in the days of yore.

Re:OpenBSD system-call-origin verification by saagarjha on Sunday December 22, 2019 @08:46PM (#21860926)
On my computer I ended up going through a rdtsc instead of a syscall…
Re:OpenBSD system-call-origin verification by me_again on Sunday December 22, 2019 @10:43PM (#21861349)
Wouldn't this make containers way more difficult?
Re:OpenBSD system-call-origin verification by quotemstr on Monday December 23, 2019 @09:46AM (#21863883)
Why would it? You need to bootstrap allowed call paths, and whatever init does to do that, PID 1 in a namespace could do that too.