NaCl--An Open-Source Project

By Larry Seltzer  |  Posted 2008-12-16 Print this article Print


Or you can read the code. I didn't mention yet that NaCl is an open-source project. One interesting aspect of this is that it includes a compiler for building NaCl modules and this compiler is a variant of the gcc compiler. I'll be interested in seeing whether support for other languages follows, although some languages are of dubious value in an environment such as this. You'd only want languages that are meant to create high-performance native code.

Google says in the white paper that it has tested the inner sandbox heavily and believes it to be reliable and robust. The design of it makes this credible to me. I was struck by how, even though NaCl is x86-specific, NaCl modules themselves are very RISC-like. For instance, all data and instructions have to be word-aligned. This is probably for the convenience and performance of NaCl.

There is also an "outer-sandbox" in NaCl. It checks all system calls made from NaCl against a short whitelist of allowed ones and blocks everything else. Currently, only the Linux outer-sandbox is up and running; Mac and Windows are "works in progress."

Calls into and out of the run-time are performed through structures called springboards (calling into NaCl module code) and trampolines (calling out from modules). These interfaces are dangerous ones from a security standpoint and likely attack targets. Google included them in a list of NaCl components that needed extra scrutiny.

Google reports that, as a general matter, legacy Linux libraries port over with little trouble to NaCl. The company reports on some tests it did porting an H.264 decoder, a physics simulation and Quake. Performance tests on Quake showed it on par with a stand-alone Linux executable.

Google decided to make NaCl x86-specific so that it could optimize the sandbox better, both for security and for performance. Certainly it's true that almost every desktop and notebook computer runs x86, but not all browsing devices do, and I'm specifically thinking of mobiles. NaCl is also 32-bit only. These restrictions could turn out to be disappointing in the future.

Speaking as a programmer, I think NaCl is cool. Will people find a need for it? Is it a solution in search of a problem? Even though I like the idea of sandboxing, I'm not sure that the trade-offs NaCl makes are the right ones for the market. Perhaps a richer non-native code environment, such as Java or .NET, is a better answer for most of the potential programmers for NaCl. Surely there are programs that need native code performance; do they need to run in a browser, or even in a sandbox?

I applaud Google for all this research work. Whether it ends up as part of Google OS or just educating programmers on the best ways to secure code, the company is asking questions that need to be asked.

Security Center Editor Larry Seltzer has worked in and written about the computer industry since 1983.

For insights on security coverage around the Web, take a look at Security Center Editor Larry Seltzer's blog Cheap Hack.


Larry Seltzer has been writing software for and English about computers ever since—,much to his own amazement—,he graduated from the University of Pennsylvania in 1983.

He was one of the authors of NPL and NPL-R, fourth-generation languages for microcomputers by the now-defunct DeskTop Software Corporation. (Larry is sad to find absolutely no hits on any of these +products on Google.) His work at Desktop Software included programming the UCSD p-System, a virtual machine-based operating system with portable binaries that pre-dated Java by more than 10 years.

For several years, he wrote corporate software for Mathematica Policy Research (they're still in business!) and Chase Econometrics (not so lucky) before being forcibly thrown into the consulting market. He bummed around the Philadelphia consulting and contract-programming scenes for a year or two before taking a job at NSTL (National Software Testing Labs) developing product tests and managing contract testing for the computer industry, governments and publication.

In 1991 Larry moved to Massachusetts to become Technical Director of PC Week Labs (now eWeek Labs). He moved within Ziff Davis to New York in 1994 to run testing at Windows Sources. In 1995, he became Technical Director for Internet product testing at PC Magazine and stayed there till 1998.

Since then, he has been writing for numerous other publications, including Fortune Small Business, Windows 2000 Magazine (now Windows and .NET Magazine), ZDNet and Sam Whitmore's Media Survey.

Submit a Comment

Loading Comments...
Manage your Newsletters: Login   Register My Newsletters

Rocket Fuel