3 ms·
> The sVirt and Seccomp functionalities used to restrict host's QEMU process privileges and resource access might mitigate the impact of successful exploitation
by wyldfire 11y ago
> The sVirt and Seccomp functionalities used to restrict host's QEMU process privileges and resource access might mitigate the impact of successful exploitation of this issue.
seccomp is pretty awesome IMO. Would that more software opted in to dropping unneeded system access.
- groovy2shoes 11y agoSounds similar to OpenBSD's `pledge`, a system call that a process can use to tell the system which minimum privileges it needs, so that a buffer overflow exploit has less of a chance of running amok (depending on the program). It's new in 5.9 and most of the base system and a bunch of ports (including Chromium) have been updated to make use of it. Of course, it doesn't completely prevent someone from doing something nasty, but it does force them to be much more targeted in which programs they can attack. Every little thing helps a little bit, and it all adds up.
- cyphar 11y agoMy issue with pledge is that it doesn't get applied to the new process on exec. This makes it essentially useless for a program that needs to start any other programs to do it's job. Seccomp is quite cool because it lets you filter syscalls and then there's no way for you to disable the filtering (assuming no bugs in the implementation).
- IcePic 11y agoThen again, any program that in any way starts another binary (or several) would always end up having to pledge the sum of all possible child permissions, so it would just mean that any such program (like sudo) would just not be limited at all just so it can run both ls and reboot, when the setuid sudo program would be just the kind of program you would like to have pledged so that it doesn't talk net when it shouldn't or does other out of line weirdness.
- cyphar 11y agoRight, so then sudo could conditionally pledge things based on what its ACL says. And that whitelist would apply to the program it starts. I'd understand there being "temporary" pledges, where it gets reset on exec, but I don't understand making it by default temporary.
- aseipp 11y agoI agree in general. But in this case - look at the actual source code: https://github.com/qemu/qemu/blob/master/qemu-seccomp.c https://github.com/qemu/qemu/blob/master/qemu-seccomp.c There's also no further refinement of seccomp privileges at runtime, so that list of syscalls is statically whitelisted up front and nothing else is done (search 'seccomp' in the repository). Is there anything I obviously couldn't achieve with that list of syscalls? Given the list of what's whitelisted for the whole process, I wouldn't put much stock in it, for now. qemu would probably need some real upgrades and significant work to make this more fine grained and reduce the attack surface using it (both against the kernel and for rogue programs attacking the host qemu instance itself).
- wyldfire 11y agoYou're right, I hadn't checked this list. If open() were missing from the list it might be much harder to do damage outside the current VM. It's the most critical one in this whitelist IMO. Many/most of the remaining would have their scope limited to currently open fds/this-process' maps/segments.