SlideShare a Scribd company logo
Native Client Native Client Evgeny Eltsin
Overview Why Native Client? What is it? How it works? Ecosystem Developer stuff
Why Native Client? Close the gap between desktop and web apps Performance Choice of programming language Leverage legacy code
Why Native Client? Close the gap between desktop and web apps Safety Portability
Web Apps Interpreted languages (JavaScript) Safe but often slow
How to Improve? Just-In-Time compiler Faster (fast enough?) and often complex (more vulnerable ?)
Web Apps Native code "as is" (ActiveX) Fast but not safe
How to Improve? Make native code "manageable"? OS gives few options
What is Native Client? NaCl — system for safe execution of untrusted native code In a web browser … Open-source http://code.google.com/p/nativeclient
What is it Good for? Port desktop apps to web Zero install Performance close to native
What is it Good for? Enhance web apps with C/C++/... libraries (libcrypt, CGAL, ...) New high-performance code (threads, hand-coded asm, ...)
What is it Good for? Sandbox existing plugins Stop asking users to trust your code
Lunch isn't Free Must recompile from source and do some porting Part of system interfaces are unavailable Still work in progress
What is Safe? No side effects except via explicit secure interfaces
Runtime Sandbox No side effects ... No read, write or execute outside of the sandbox ... except via explicit secure interfaces "system calls"
How it Works? Runtime sandbox is created via an agreement between Code generator (untrusted) Validator and loader (trusted) Trusted part is simple
What Code Validation is? First, disassemble all executable code No overlapping instructions Run-time code generation needs special support
Control Flow Integrity Do we jump to code we know? Direct jumps are easy to validate but indirect ?
Instruction Bundles Every bundle-aligned code address is a potential jump target No instructions cross bundle boundaries Code generator pads with NOPs Bundle is 32-bytes (chosen from experiment)
Instruction Bundles Indirect jump always go to a bundle-aligned address Code generator makes code to enforce Validator checks enforcement
i386 Example call 0x1280(%eax) lea 0x1280(%eax), %eax and 0xffffffe0, %eax call *%eax
Checking Read, Write and Jump i386 Example Validator checks instructions use correct segment registers Loader sets segment registers correctly Loader protects memory accordingly
System Calls Trampoline to outer stuff Valid jump target inside the sandbox Does "context switch" and jump out of the sandbox Generated by trusted loader
Ecosystem Availability i386, x86_64, ARM Linux, Windows, MacOS chrome —enable-nacl Firefox plugin (fewer features than in Chrome, unfortunately)
Portability PNaCl - work in progress Portable representation (LLVM bitcode) Final translation on the client or translation/cache server
Deployment HTML <EMBED> Binary picked by client architecture Scripting interface
What works? Gallery at http://code.google.com/p/nativeclient And much more stuff Quake Video decoder Python
Developer Stuff ILP32 data model for all architectures Linux-like programming environment ELF binaries Netscape Plugin API/Pepper Plugin API
Native Client SDK http://code.google.com/p/nativeclient-sdk Ported Gnu toolchain gcc 4.4.3 (4.5 coming) newlib (glibc coming)
Native Client Ports http://code.google.com/p/naclports zlib cairo mesa theora expat
Developers Welcome! Lot of fun projects GTK SDL and your choice of cool stuff!
Thank You! Questions?

More Related Content

PPTX
Native client
PPTX
Introduce native client
PDF
Chromium: NaCl and Pepper API
PDF
Hidden Dragons of CGO
PDF
Salt and pepper — native code in the browser Browser using Google native Client
PPTX
.Net Core
PDF
Everything as code - Johan Siebens STS presentation 14-01-2020
PPTX
Alberto Maria Angelo Paro - Isomorphic programming in Scala and WebDevelopmen...
Native client
Introduce native client
Chromium: NaCl and Pepper API
Hidden Dragons of CGO
Salt and pepper — native code in the browser Browser using Google native Client
.Net Core
Everything as code - Johan Siebens STS presentation 14-01-2020
Alberto Maria Angelo Paro - Isomorphic programming in Scala and WebDevelopmen...

What's hot (20)

PDF
Import golang; struct microservice
PPTX
Migrating .NET Application to .NET Core
PDF
WebRTC - Brings Real-Time to the Web
PPTX
Asynkron programmering i Visual Studio 11
PDF
Open Source and Secure Coding Practices
PDF
Phalcon Framework: San Antonio Web Developers Group
PDF
PHP - Programming language war, does it matter
PPTX
Short introduction - .net core and .net standard 2.0
PPTX
Getting started with Emscripten – Transpiling C / C++ to JavaScript / HTML5
PDF
Minko - Build WebGL applications with C++ and asm.js
PDF
Dot Net Core
PPTX
Whats new in .net core 3
PPTX
C++ on the Web: Run your big 3D game in the browser
PPTX
A Whirldwind Tour of ASP.NET 5
PPTX
Microsoft 2014 Dev Plataform - Roslyn -& ASP.NET vNext
PPTX
Developing Rich Internet Applications with Perl and JavaScript
PPTX
Node.js Web Apps @ ebay scale
PPTX
Orchard 2... and why you should care
PDF
API Design in the Modern Era - Architecture Next 2020
PDF
Play Framework
Import golang; struct microservice
Migrating .NET Application to .NET Core
WebRTC - Brings Real-Time to the Web
Asynkron programmering i Visual Studio 11
Open Source and Secure Coding Practices
Phalcon Framework: San Antonio Web Developers Group
PHP - Programming language war, does it matter
Short introduction - .net core and .net standard 2.0
Getting started with Emscripten – Transpiling C / C++ to JavaScript / HTML5
Minko - Build WebGL applications with C++ and asm.js
Dot Net Core
Whats new in .net core 3
C++ on the Web: Run your big 3D game in the browser
A Whirldwind Tour of ASP.NET 5
Microsoft 2014 Dev Plataform - Roslyn -& ASP.NET vNext
Developing Rich Internet Applications with Perl and JavaScript
Node.js Web Apps @ ebay scale
Orchard 2... and why you should care
API Design in the Modern Era - Architecture Next 2020
Play Framework
Ad

Similar to Native client (Евгений Эльцин) (20)

PPT
Zerovm backgroud
PDF
Native code in Android applications
PDF
Cldc Hotspot Architecture
PDF
Web (dis)assembly
PDF
How do I - Create a Native Interface - Transcript.pdf
PDF
NativeBoost
PDF
Beyond JVM - YOW! Brisbane 2013
PDF
CONFidence 2017: Escaping the (sand)box: The promises and pitfalls of modern ...
PPTX
Advance Android Application Development
PDF
NDK Primer (AnDevCon Boston 2014)
PPT
Sandboxing (Distributed computing)
PPTX
Keep Your Arms and Legs Inside the Many Platforms: Native Code Everywhere
PPT
Writing Metasploit Plugins
PPTX
Ruby in the Browser - RubyConf 2011
PPTX
PDF
Developing and-benchmarking-native-linux-applications-on-android
PPTX
CNCF Live Webinar: Low Footprint Java Containers with GraalVM
PPTX
PDF
109842496 jni
PDF
WebAssembly. Neither Web Nor Assembly, All Revolutionary
Zerovm backgroud
Native code in Android applications
Cldc Hotspot Architecture
Web (dis)assembly
How do I - Create a Native Interface - Transcript.pdf
NativeBoost
Beyond JVM - YOW! Brisbane 2013
CONFidence 2017: Escaping the (sand)box: The promises and pitfalls of modern ...
Advance Android Application Development
NDK Primer (AnDevCon Boston 2014)
Sandboxing (Distributed computing)
Keep Your Arms and Legs Inside the Many Platforms: Native Code Everywhere
Writing Metasploit Plugins
Ruby in the Browser - RubyConf 2011
Developing and-benchmarking-native-linux-applications-on-android
CNCF Live Webinar: Low Footprint Java Containers with GraalVM
109842496 jni
WebAssembly. Neither Web Nor Assembly, All Revolutionary
Ad

More from Ontico (20)

PDF
One-cloud — система управления дата-центром в Одноклассниках / Олег Анастасье...
PDF
Масштабируя DNS / Артем Гавриченков (Qrator Labs)
PPTX
Создание BigData-платформы для ФГУП Почта России / Андрей Бащенко (Luxoft)
PDF
Готовим тестовое окружение, или сколько тестовых инстансов вам нужно / Алекса...
PDF
Новые технологии репликации данных в PostgreSQL / Александр Алексеев (Postgre...
PDF
PostgreSQL Configuration for Humans / Alvaro Hernandez (OnGres)
PDF
Inexpensive Datamasking for MySQL with ProxySQL — Data Anonymization for Deve...
PDF
Опыт разработки модуля межсетевого экранирования для MySQL / Олег Брославский...
PPTX
ProxySQL Use Case Scenarios / Alkin Tezuysal (Percona)
PPTX
MySQL Replication — Advanced Features / Петр Зайцев (Percona)
PDF
Внутренний open-source. Как разрабатывать мобильное приложение большим количе...
PPTX
Подробно о том, как Causal Consistency реализовано в MongoDB / Михаил Тюленев...
PPTX
Балансировка на скорости проводов. Без ASIC, без ограничений. Решения NFWare ...
PDF
Перехват трафика — мифы и реальность / Евгений Усков (Qrator Labs)
PPT
И тогда наверняка вдруг запляшут облака! / Алексей Сушков (ПЕТЕР-СЕРВИС)
PPTX
Как мы заставили Druid работать в Одноклассниках / Юрий Невиницин (OK.RU)
PPTX
Разгоняем ASP.NET Core / Илья Вербицкий (WebStoating s.r.o.)
PPTX
100500 способов кэширования в Oracle Database или как достичь максимальной ск...
PPTX
Apache Ignite Persistence: зачем Persistence для In-Memory, и как он работает...
PDF
Механизмы мониторинга баз данных: взгляд изнутри / Дмитрий Еманов (Firebird P...
One-cloud — система управления дата-центром в Одноклассниках / Олег Анастасье...
Масштабируя DNS / Артем Гавриченков (Qrator Labs)
Создание BigData-платформы для ФГУП Почта России / Андрей Бащенко (Luxoft)
Готовим тестовое окружение, или сколько тестовых инстансов вам нужно / Алекса...
Новые технологии репликации данных в PostgreSQL / Александр Алексеев (Postgre...
PostgreSQL Configuration for Humans / Alvaro Hernandez (OnGres)
Inexpensive Datamasking for MySQL with ProxySQL — Data Anonymization for Deve...
Опыт разработки модуля межсетевого экранирования для MySQL / Олег Брославский...
ProxySQL Use Case Scenarios / Alkin Tezuysal (Percona)
MySQL Replication — Advanced Features / Петр Зайцев (Percona)
Внутренний open-source. Как разрабатывать мобильное приложение большим количе...
Подробно о том, как Causal Consistency реализовано в MongoDB / Михаил Тюленев...
Балансировка на скорости проводов. Без ASIC, без ограничений. Решения NFWare ...
Перехват трафика — мифы и реальность / Евгений Усков (Qrator Labs)
И тогда наверняка вдруг запляшут облака! / Алексей Сушков (ПЕТЕР-СЕРВИС)
Как мы заставили Druid работать в Одноклассниках / Юрий Невиницин (OK.RU)
Разгоняем ASP.NET Core / Илья Вербицкий (WebStoating s.r.o.)
100500 способов кэширования в Oracle Database или как достичь максимальной ск...
Apache Ignite Persistence: зачем Persistence для In-Memory, и как он работает...
Механизмы мониторинга баз данных: взгляд изнутри / Дмитрий Еманов (Firebird P...

Recently uploaded (20)

PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
Heart disease approach using modified random forest and particle swarm optimi...
PPTX
Machine Learning_overview_presentation.pptx
PDF
Univ-Connecticut-ChatGPT-Presentaion.pdf
PPTX
Programs and apps: productivity, graphics, security and other tools
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PPTX
A Presentation on Artificial Intelligence
PPTX
Spectroscopy.pptx food analysis technology
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PPTX
SOPHOS-XG Firewall Administrator PPT.pptx
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
MIND Revenue Release Quarter 2 2025 Press Release
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
Empathic Computing: Creating Shared Understanding
PDF
NewMind AI Weekly Chronicles - August'25-Week II
PDF
August Patch Tuesday
PPTX
Group 1 Presentation -Planning and Decision Making .pptx
PDF
Spectral efficient network and resource selection model in 5G networks
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Heart disease approach using modified random forest and particle swarm optimi...
Machine Learning_overview_presentation.pptx
Univ-Connecticut-ChatGPT-Presentaion.pdf
Programs and apps: productivity, graphics, security and other tools
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Reach Out and Touch Someone: Haptics and Empathic Computing
A Presentation on Artificial Intelligence
Spectroscopy.pptx food analysis technology
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
SOPHOS-XG Firewall Administrator PPT.pptx
Per capita expenditure prediction using model stacking based on satellite ima...
MIND Revenue Release Quarter 2 2025 Press Release
Digital-Transformation-Roadmap-for-Companies.pptx
Empathic Computing: Creating Shared Understanding
NewMind AI Weekly Chronicles - August'25-Week II
August Patch Tuesday
Group 1 Presentation -Planning and Decision Making .pptx
Spectral efficient network and resource selection model in 5G networks
Advanced methodologies resolving dimensionality complications for autism neur...

Native client (Евгений Эльцин)

  • 1. Native Client Native Client Evgeny Eltsin
  • 2. Overview Why Native Client? What is it? How it works? Ecosystem Developer stuff
  • 3. Why Native Client? Close the gap between desktop and web apps Performance Choice of programming language Leverage legacy code
  • 4. Why Native Client? Close the gap between desktop and web apps Safety Portability
  • 5. Web Apps Interpreted languages (JavaScript) Safe but often slow
  • 6. How to Improve? Just-In-Time compiler Faster (fast enough?) and often complex (more vulnerable ?)
  • 7. Web Apps Native code &quot;as is&quot; (ActiveX) Fast but not safe
  • 8. How to Improve? Make native code &quot;manageable&quot;? OS gives few options
  • 9. What is Native Client? NaCl — system for safe execution of untrusted native code In a web browser … Open-source http://code.google.com/p/nativeclient
  • 10. What is it Good for? Port desktop apps to web Zero install Performance close to native
  • 11. What is it Good for? Enhance web apps with C/C++/... libraries (libcrypt, CGAL, ...) New high-performance code (threads, hand-coded asm, ...)
  • 12. What is it Good for? Sandbox existing plugins Stop asking users to trust your code
  • 13. Lunch isn't Free Must recompile from source and do some porting Part of system interfaces are unavailable Still work in progress
  • 14. What is Safe? No side effects except via explicit secure interfaces
  • 15. Runtime Sandbox No side effects ... No read, write or execute outside of the sandbox ... except via explicit secure interfaces &quot;system calls&quot;
  • 16. How it Works? Runtime sandbox is created via an agreement between Code generator (untrusted) Validator and loader (trusted) Trusted part is simple
  • 17. What Code Validation is? First, disassemble all executable code No overlapping instructions Run-time code generation needs special support
  • 18. Control Flow Integrity Do we jump to code we know? Direct jumps are easy to validate but indirect ?
  • 19. Instruction Bundles Every bundle-aligned code address is a potential jump target No instructions cross bundle boundaries Code generator pads with NOPs Bundle is 32-bytes (chosen from experiment)
  • 20. Instruction Bundles Indirect jump always go to a bundle-aligned address Code generator makes code to enforce Validator checks enforcement
  • 21. i386 Example call 0x1280(%eax) lea 0x1280(%eax), %eax and 0xffffffe0, %eax call *%eax
  • 22. Checking Read, Write and Jump i386 Example Validator checks instructions use correct segment registers Loader sets segment registers correctly Loader protects memory accordingly
  • 23. System Calls Trampoline to outer stuff Valid jump target inside the sandbox Does &quot;context switch&quot; and jump out of the sandbox Generated by trusted loader
  • 24. Ecosystem Availability i386, x86_64, ARM Linux, Windows, MacOS chrome —enable-nacl Firefox plugin (fewer features than in Chrome, unfortunately)
  • 25. Portability PNaCl - work in progress Portable representation (LLVM bitcode) Final translation on the client or translation/cache server
  • 26. Deployment HTML <EMBED> Binary picked by client architecture Scripting interface
  • 27. What works? Gallery at http://code.google.com/p/nativeclient And much more stuff Quake Video decoder Python
  • 28. Developer Stuff ILP32 data model for all architectures Linux-like programming environment ELF binaries Netscape Plugin API/Pepper Plugin API
  • 29. Native Client SDK http://code.google.com/p/nativeclient-sdk Ported Gnu toolchain gcc 4.4.3 (4.5 coming) newlib (glibc coming)
  • 30. Native Client Ports http://code.google.com/p/naclports zlib cairo mesa theora expat
  • 31. Developers Welcome! Lot of fun projects GTK SDL and your choice of cool stuff!