LWN.net Logo

Why do all this? Shouldn't the OS do it?

Why do all this? Shouldn't the OS do it?

Posted Jun 4, 2009 9:00 UTC (Thu) by epa (subscriber, #39769)
Parent article: Google's Native Client

I am not sure why running 'untrusted' native code is considered so dangerous or novel. Since the seventies or earlier time-sharing systems have allowed different users to run their own code on the system, and each user or process is isolated from the others. Modern hardware such as the 386 family was specifically designed to support this. Each process runs in a virtual machine set up by the operating system and cannot access memory belonging to other processes or the kernel. The only access granted to it is what the operating system explicitly provides through its system call interface.

Why, then, is it necessary to go to all this trouble of verifying binaries? Surely it would be far simpler for the operating system to provide a bit of help, setting up a new process with its own memory space, CPU quota, and a limited set of system calls (perhaps just read() and write() to a pair of pipes that already exist). Then you could execute any native code you want, and if it tries to do something naughty, the CPU's built-in mechanisms will trigger a fault and the OS kills the process.

We only think this is exotic because popular OSes of today do not provide a lot of control over what resources a process can have. Typically access to files is set with access control bits, but any process can open TCP/IP connections. Or if the OS does provide capabilities, jails, masking out of system calls and so on, there isn't a single dominant API and model, and the necessary base of knowledgeable people to make good use of it.


(Log in to post comments)

Why do all this? Shouldn't the OS do it?

Posted Jun 4, 2009 10:32 UTC (Thu) by dgm (subscriber, #49227) [Link]

What is laking the the capability to let applications act as kernels by themselves. It would be much easier if the browser could have its own private filesystem, system calls and users exported to child processes.
AFAIK, Plan9 does some of this (at leask the filesystem part).
Not an easy task, but maybe worth some more thought.

Copyright © 2013, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds