Google Native Client

From Wikipedia, the free encyclopedia
Jump to: navigation, search
Google Native Client
Developer(s) Google, others
Preview release 1.0 / October 12, 2011; 3 months ago (2011-10-12)
Development status Research
Written in C++
Operating system Cross-platform: Microsoft Windows, Linux, Mac OS, Chrome OS
Type Sandbox in web browsers for native code
License New BSD license
Website code.google.com/p/nativeclient

Google Native Client (NaCl) is a sandboxing technology for running a subset of Intel x86 or ARM native code using software-based fault isolation.[1] It is proposed for safely running native code from a web browser, allowing web-based applications to run at near-native speeds,[2] which aligns well with Google's plans with Chrome OS. It may also be used for securing browser plugins, and in the future parts of other applications or full applications.[3]

To demonstrate the readiness of the technology, on December 9, 2011, Google announced the availability of several new Chrome-only versions of games known for their rich and processor-intensive graphics, including Bastion. NaCl runs hardware-accelerated 3D graphics (via OpenGL ES 2.0), sandboxed local file storage, dynamic loading, full screen mode, and mouse capture. There are also plans to make NaCl available on handheld devices.[4][5]

Contents

[edit] Overview

Native Client is an open source project being developed by Google.[6] To date, Quake, XaoS and MAME have been ported to Google Native Client Platform. Native Client was formerly available as an experimental disabled-by-default feature in the Google Chrome web browser.[2] The feature is enabled from version 14 of Chrome; at the same time, native applications can be uploaded to the Chrome Web Store, and with more recent Chrome versions (if enabled in chrome://flags), native client applications can run under Chrome from any web site. [7]

An ARM implementation was released in March 2010. [8] x86-64 and IA-32 are also supported. As of March 2011, however, all three implementations could only use code compiled to the host's native instruction set. PNaCl (Portable Native Client, pronounced: pinnacle) is being developed to address this issue. To run an application portably under PNaCl, it must be compiled to an architecture-agnostic version of the LLVM intermediate representation bytecode.[9]

NaCl uses Software Fault Isolation for sandboxing on x86-64 and ARM.[10] The x86-32 implementation of Native Client is notable for its novel sandboxing method which makes use of the x86 architecture's rarely-used segmentation facility.[11] Native Client sets up x86 segments to restrict the memory range that the sandboxed code can access. It uses a code verifier to prevent use of unsafe instructions such as those that perform system calls. To prevent the code from jumping to an unsafe instruction hidden in the middle of a safe instruction, Native Client requires that all indirect jumps be jumps to the start of 32-byte-aligned blocks, and instructions are not allowed to straddle these blocks.[11] Because of these constraints, C code must be recompiled to run under Native Client, which provides customised versions of the GNU toolchain, specifically gcc and binutils.

Native Client is licensed under a BSD-style license.

Native Client uses Newlib as its C library, but a port of GNU libc is also available.[12]

Since release 0.5, Native Client has a stable ABI.[13] This roughly means that code compiled and running in the NaCl implementation of Google Chrome 14, will work in all future versions of Google Chrome.

[edit] Pepper

Pepper API is a cross-platform, open-source API for creating Native Client modules.[14] Pepper Plugin API, or PPAPI[15][16] is a cross-platform API for Native Client-secured web browser plugins, first based on Netscape's NPAPI, then rewritten from scratch. It is currently an experimental feature of Chromium and Google Chrome (there is a Chrome experiment in chrome://flags to enable the PPAPI version of Flash), though the built-in PDF-viewer already uses it[17].

[edit] PPAPI

On August 12, 2009 a page on Google Code introduced a new project, Pepper with associated Pepper Plugin API (PPAPI)[18], "a set of modifications to NPAPI to make plugins more portable and more secure"[19]. This extension is designed specifically to ease the implementation of out-of-process plugin execution. Further, the goals of the project are to provide a framework for making plugins fully cross-platform. Topics considered include:

  • Uniform semantics for NPAPI across browsers.
  • Execution in a separate process from the renderer/browser itself.
  • Standardize rendering using the browser's compositing process.
  • Defining standardized events, and 2D rasterization functions.
  • Initial attempt at providing 3D graphics access.
  • Plugin registry.

As of May 13, 2010, Google's open source browser, Chromium, is the only web browser that utilizes the new browser plug-in model [20]. Mozilla has announced that they are "not interested in or working on Pepper at this time."[21]

[edit] Criticism and Controversies

Some groups of browser developers support the Native Client technology, but others do not. This technology is controversial with x86 browser developers.

Supporters: Chad Austin (of IMVU) are praising the way Native Client can bring high-performance applications to the web (with about 5% penalty compared to native code) in a secure way, while also accelerating the evolution of client-side applications by giving a choice of the programming language used (beside JavaScript).[22]

Detractors: Other IT professionals are more critical of this sandboxing technology as it has substantial or substantive interoperability issues.

Mozilla's vice president of products, Jay Sullivan said it has no intention to run native code inside the browser, as

"These native apps are just little black boxes in a webpage. [...] We really believe in HTML, and this is where we want to focus."[23]

Håkon Wium Lie, Opera's CTO believes that

"NaCl seems to be 'yearning for the bad old days, before the web'", and that "Native Client is about building a new platform – or porting an old platform into the web [...] it will bring in complexity and security issues, and it will take away focus from the web platform."[3]

Christopher Blizzard, Mozilla's Open Source evangelist fears that without the source code, the pace of innovation will slow, and compares NaCl to Microsoft's ActiveX technology, plagued with DLL hell. In his views, even if it's secure, Native Client isn't a good thing.[3]

[edit] References

  1. ^ Efficient software-based fault isolation, Robert Wahbe, Steven Lucco, Thomas E. Anderson, Susan L. Graham, 1993
  2. ^ a b Native Client: A Technology for Running Native Code on the Web
  3. ^ a b c Cade Metz (2011-09-12). "Google Native Client: The web of the future – or the past?". The Register. http://www.theregister.co.uk/2011/09/12/google_native_client_from_all_sides/. Retrieved 2011-09-17. 
  4. ^ Seth Rosenblatt (2011-12-09). "Native Client turns Chrome into high-end gaming platform". CNET. http://download.cnet.com/8301-2007_4-57340015-12/native-client-turns-chrome-into-high-end-gaming-platform/. Retrieved 2011-12-09. 
  5. ^ Google Code Blog: Games, apps and runtimes come to Native Client
  6. ^ Google Native Client on Google Code
  7. ^ The Chromium Blog: Native Client Brings Sandboxed Native Code to Chrome Web Store Apps
  8. ^ "Google's Native Client goes ARM and beyond". The H. 18 March 2010. http://www.h-online.com/open/news/item/Google-s-Native-Client-goes-ARM-and-beyond-957478.html. Retrieved 2010-05-19. 
  9. ^ PNaCl: Portable Native Client Executables
  10. ^ David Sehr, Robert Muth, Cliff L. Biffle, Victor Khimenko, Egor Pasko, Bennet Yee, Karl Schimpf, Brad Chen (2010). "Adapting Software Fault Isolation to Contemporary CPU Architectures". 19th USENIX Security Symposium. http://research.google.com/pubs/pub35649.html. Retrieved July 31, 2011. 
  11. ^ a b Bennet Yee, David Sehr, Greg Dardyk, Brad Chen, Robert Muth, Tavis Ormandy, Shiki Okasaka, Neha Narula, Nicholas Fullagar (2009). "Native Client: A Sandbox for Portable, Untrusted x86 Native Code". IEEE Symposium on Security and Privacy (Oakland'09). http://research.google.com/pubs/pub34913.html. Retrieved July 31, 2011. 
  12. ^ NativeClient: Plash Wiki
  13. ^ Official NaCl Release Notes
  14. ^ Native Client SDK: Pepper C API
  15. ^ Pepper Plugin API project at code.google.com
  16. ^ Chrome Source: Index of /trunk/src/ppapi
  17. ^ The Register: Google hugs Adobe harder with Chrome-PDF merge
  18. ^ [1]
  19. ^ Pepper.wiki
  20. ^ Google heats up native code for Chrome OS
  21. ^ NPAPI:Pepper - MozillaWiki
  22. ^ Chad Austin: In Defense of Language Democracy (Or: Why the Browser Needs a Virtual Machine)
  23. ^ The Register: Mozilla: Our browser will not run native code

[edit] External links

[edit] Examples

Personal tools
Namespaces
Variants
Actions
Navigation
Interaction
Toolbox
Print/export
Languages