by tedunangst · 5y ago · 0 comments
https://marc.info/?l=openbsd-ports-cvs&m=158083696719245&w=2
Seems like this is a good idea for multiple reasons. Another benefit is that it would seem to make something like "Wine in reverse" possible/easier to implement.
As far as I understand, Wine (a userspace-only Win32 emulator) is possible because Windows applications always go through the standard library for system calls, which therefore can be hooked without kernel support.
The same is not generally true for Linux binaries – these usually do go through glibc, but direct syscalls are possible (through raising the appropriate interrupt or instruction).
I don't think there's an easy way to trap these without kernel support (which is what WSL 1 has been doing).
OTOH Linux having a well defined set of syscalls you can very convincingly fake being a Linux kernel. That’s what wsl1 did. That’s also what SmartOS does, which allows it to mix native and Linux (LX) zones.
Thanks four your explanation. So is WSL2 different in this regards?
vDSO is also a language independent construct, so there's no special treatment for any favorite language, be it C (OpenBSD), C++ (Windows) or Oberon OS (Oberon).
Big Ouch. I wonder how the Linux developers will approach this bug since they don't enforce syscalls to be done from glibc.
I don't think it'll be a bit problem, anyway. In my experience not very much calls syscalls directly. Go is a big exception, though...
What about musl? uClibc?
Linux is well known for the fact that it guarantees its syscall interface as primary contract to userspace.
In either case though there is a libc that most software will use, and the mitigations can be applied there. Even though direct use of syscalls is legal on Linux, the fact that it's stable is primarily relevant and interesting to said libc developers.
The fact that syscalls aren't guaranteed on other systems is usually of little consequence since the libc is developed in tandem with the kernels of those systems. Linux's situation as a fully decoupled kernel means it does things differently in that sense. The developers are fully separated, so there needs to be a strong "contract" that syscalls will be stable.
Doesn't mean (IMO) it's a good idea for end-users e.g. software developers to use syscalls except in exceptional circumstances. Which is usually the case!
Desktop Linux is hardly the majority of Linux installations. How many containers in the cloud are using something like Alpine Linux?
I'd dare say by and large glibc is in the minority.
Note that the mail is from 2020. So it probably already is fixed. It might be this one
https://patchwork.kernel.org/project/linux-arm-kernel/patch/...