Microcontrollers Deserve Protection Too



Similar documents
ZigBee Technology Overview

CS161: Operating Systems

Secure Internet of Things Project

Fachbereich Informatik und Elektrotechnik SunSPOT. Ubiquitous Computing. Ubiquitous Computing, Helmut Dispert

The new 32-bit MSP432 MCU platform from Texas

Last Class: OS and Computer Architecture. Last Class: OS and Computer Architecture

Embedded Software Development: Spottbillige Hardware + OSS = Zum Spielen zu Schade!

Lecture 25 Symbian OS

Bluetooth 4.0 Solutions for Apple ios Devices. Bluegiga Technologies

Reducing Configuration Complexity with Next Gen IoT Networks

Wireless Microcontrollers for Environment Management, Asset Tracking and Consumer. October 2009

Virtualization in the ARMv7 Architecture Lecture for the Embedded Systems Course CSD, University of Crete (May 20, 2014)

QUIRE: : Lightweight Provenance for Smart Phone Operating Systems

Memory Safety for Low-Level Software/Hardware Interactions

Cloud Computing. Up until now

Chapter 13. PIC Family Microcontroller

Real-Time Systems Prof. Dr. Rajib Mall Department of Computer Science and Engineering Indian Institute of Technology, Kharagpur

Building Blocks for PRU Development

STM32L. Ultra-low-power Cortex -M3 devices

Overview of the Cortex-M3

Complete Integrated Development Platform Copyright Atmel Corporation

Java Embedded Applications

Hardware Assisted Virtualization

How do Users and Processes interact with the Operating System? Services for Processes. OS Structure with Services. Services for the OS Itself

Review from last time. CS 537 Lecture 3 OS Structure. OS structure. What you should learn from this lecture

Gecko. Energy-friendly microcontrollers for the IoT. Gecko MCUs Complete portfolio of energyfriendly 32-bit microcontrollers PRODUCT SELECTOR GUIDE

Dr. Dimitar Valtchev. 24 June 2010, Stuttgart, Eclipse Embedded Day

Next Generation Now: Red Hat Enterprise Linux 6 Virtualization A Unique Cloud Approach. Jeff Ruby Channel Manager jruby@redhat.com

STM32 F-2 series High-performance Cortex-M3 MCUs

Republic Polytechnic School of Information and Communications Technology C226 Operating System Concepts. Module Curriculum

Internet of things (IOT) applications covering industrial domain. Dev Bhattacharya

Questions from The New SensorTag - IoT Made Easy Webinar

Multi-core Programming System Overview

CS5460: Operating Systems

Chapter 2: OS Overview

Data Management for Portable Media Players

Migrating Application Code from ARM Cortex-M4 to Cortex-M7 Processors

Implementation of Wireless Gateway for Smart Home

Architectures and Platforms

Chapter 5 Cloud Resource Virtualization

Restraining Execution Environments

Internet of Things. Opportunities for device differentiation

Mobile Operating Systems. Week I

Windows Server Virtualization & The Windows Hypervisor

Xeon+FPGA Platform for the Data Center

Technical Article. NFiC: a new, economical way to make a device NFC-compliant. Prashant Dekate

x64 Servers: Do you want 64 or 32 bit apps with that server?

Operating System Organization. Purpose of an OS

Outline. Outline. Why virtualization? Why not virtualize? Today s data center. Cloud computing. Virtual resource pool

PikeOS: Multi-Core RTOS for IMA. Dr. Sergey Tverdyshev SYSGO AG , Moscow

THE RTOS AS THE ENGINE POWERING THE INTERNET OF THINGS

TOP 3 STRATEGIES TO REDUCE RISK IN AUTOMOTIVE/IN-VEHICLE SOFTWARE DEVELOPMENT

Copyright 2014, Oracle and/or its affiliates. All rights reserved.

I Control Your Code Attack Vectors Through the Eyes of Software-based Fault Isolation. Mathias Payer, ETH Zurich

KVM: A Hypervisor for All Seasons. Avi Kivity avi@qumranet.com

High Performance or Cycle Accuracy?

AN EVOLVABLE OPERATING SYSTEM FOR WIRELESS SENSOR NETWORKS

Dell Wyse Cloud Connect discussion card

Programming Embedded Systems

Lab Experiment 1: The LPC 2148 Education Board

Memory Channel Storage ( M C S ) Demystified. Jerome McFarland

Last Class: OS and Computer Architecture. Last Class: OS and Computer Architecture

Exception and Interrupt Handling in ARM

Android Operating System:

Prototyping Connected-Devices for the Internet of Things. Angus Wong

Software based Finite State Machine (FSM) with general purpose processors

Embedded Systems on ARM Cortex-M3 (4weeks/45hrs)

Adding WiFi to Your Embedded System. WPG Americas & Gainspan Titus Wandinger (WPG) & Su Li (Gainspan) April 23, 2013

Microtronics technologies Mobile:

Atmel Power Line Communications. Solutions for the Smart Grid

Mobile Devices - An Introduction to the Android Operating Environment. Design, Architecture, and Performance Implications

System Design Issues in Embedded Processing

Implementing Software on Resource- Constrained Mobile Sensors Experience with Impala and ZebraNet

Reminders. Lab opens from today. Many students want to use the extra I/O pins on

Overview and History of Operating Systems

Changing the embedded development model with Microsoft.NET Micro Framework

NFC Near Field Communication

Intel Xeon +FPGA Platform for the Data Center

A benchmarking tool for Wireless Sensor Network embedded operating systems

Technical Properties. Mobile Operating Systems. Overview Concepts of Mobile. Functions Processes. Lecture 11. Memory Management.

Going Linux on Massive Multicore

Deeply Embedded Real-Time Hypervisors for the Automotive Domain Dr. Gary Morgan, ETAS/ESC

Operating Systems 4 th Class

How To Build An Ark Processor With An Nvidia Gpu And An African Processor

Mobile Devices - An Introduction to the Android Operating Environment. Design, Architecture, and Performance Implications

Seedling Internet of Things (IoT) and Wearables Platform

IoT Security Platform

The Virtualization Practice

Dynamic Resource Management in a Static Network Operating System

Real Time Programming: Concepts

On the Evaluation of the Performance Overhead of a Commercial Embedded Hypervisor

Thingsquare Technology

Network connectivity controllers

USB 3.0 Connectivity using the Cypress EZ-USB FX3 Controller

Guidelines for Designing Flash-Based Ultra Low Cost PCs for Windows XP. April 3, 2008

ARM Processors and the Internet of Things. Joseph Yiu Senior Embedded Technology Specialist, ARM

Microkernels, virtualization, exokernels. Tutorial 1 CSC469

How A V3 Appliance Employs Superior VDI Architecture to Reduce Latency and Increase Performance

IoT Conference Call December 18, :30 GMT

Transcription:

Microcontrollers Deserve Protection Too Amit Levy with: Michael Andersen, Tom Bauer, Sergio Benitez, Bradford Campbell, David Culler, Prabal Dutta, Philip Levis, Pat Pannuto, Laurynas Riliskis

Microcontrollers

Microcontrollers Tightly integrated hardware A single IC computer (memory, CPU, I/O peripherals) Typically: Small amount of code memory (<= 512KB flash) Small amount of RAM (1 128KB) Low speed CPU (<<< 80MHz) Low power consumption (μa sleep currents) Little/no hardware support for isolation

* Tock : An Operating System for Microcontrollers Designed for multi-programming microcontrollers Strict application/kernel boundary Written in Rust Safe but low-level programming language Allows compile guarantees on contributed kernel code Leverage new hardware features, e.g. Memory Protection Unit (MPU) Faster processor speeds DMA, many more I/O peripherals, etc... * Codename

Today's Microcontroller Operating Systems Operating System Hardware abstraction layer Libraries for complex/common tasks e.g. 6lowpan, Bluetooth, virtual timers etc' No isolation

Outline Why? New use cases New developers New hardware What? Untrusted application sandboxing Protection from drivers/kernel modules How? Hardware sandbox for apps Language-level sandbox for drivers Zero dynamic allocation in the kernel

Outline Why? New use cases New developers New hardware What? Untrusted application sandboxing Protection from drivers/kernel modules How? Hardware sandbox for apps Language-level sandbox for drivers Zero dynamic allocation in the kernel

New Use Cases Ubiquitous computing Fitness bands, medical devices, smart home Programmable platforms Smart watches Drones Undoubtedly more to come

New Developers Cost + tools make hardware development more accessible Small teams/startups Rapid deployment Hobbyists Iterative development process One off applications, modding Not necessarily embedded systems experts

Old Hardware - telosb Based on MSP430 16-bit 8Mhz, 10Kb RAM, 48Kb code 802.15.4 radio Power draw 5.1 μa idle 1.8mA idle

New Hardware Based on ARM Cortex-M 32-bit 40Mhz, 64Kb RAM, 128Kb code 802.15.4 and Bluetooth radios Power draw 2.3-13.0 μa idle 8 ma active < 25% on realistic workloads Many more peripherals: USB, several USARTS, SPIs and I2Cs,AES accelerator Memory Protection Unit (MPU)

Why a new Operating System? New Use Cases Software updates on my medical device Third-party apps New Developers Non expert developers building highly personal/sensitive products New Hardware Different power profile different tradeoffs Some hardware support for multi-programming

Why a new Operating System?

Outline Why? New use cases New developers New hardware What? Untrusted application sandboxing Protection from contributed drivers/kernel modules How? Hardware sandbox for apps Language-level sandbox for drivers Zero dynamic allocation in the kernel

Third-party apps Dynamically loadable May run concurrently Example: Pebble watch 3rd party app ecosystem E.g. pedometer, 2-factor auth, weather info Must protect sensor data as well as other app data Potentially malicious threat model Need to sandbox against arbitrary behavior

Contributed Drivers E.g. storage system, network stack, LCD screen, sensors Written by the product/platform developer or non-core kernel developers Need low-latency access to hardware Not modeled as malicious, but potentially buggy Bitbanging devices, latency sensitive network stacks etc Shouldn't bring down the system If I upgrade this flash driver, will my glucose monitor give me bad results? Compiled into the kernel Need compile-time guarantees

What Protections does Tock Provide? Applications: Isolated from each other and from the kernel A buggy application cannot bring down the rest of the system Drivers: Can reason about behavior at compile time (Relatively) easy to write non-buggy code with help from the compiler Buggy driver cannot interfere with other critical code Model ownership of hardware resources explicitly

Outline Why? New use cases New developers New hardware What? Untrusted application sandboxing Protection from drivers/kernel modules How? Hardware sandbox for apps Language-level sandbox for drivers Zero dynamic allocation in the kernel

Tock: Overview Hardware separation between apps and kernel (MPU) Kernel written in safe language (Rust), apps written in any language C, Lua, Rust, etc Helps balance safety with low-level access and ease of use. Drivers written in language-level sandbox Unique and exclusive access to underlying hardware

Tock: Architecture Hardware Sandbox App1.c App1.lua App1.rs Syscall Interface Rust Device Drivers (Rust language sandbox) Kernel Core

MPU: Hardware App Sandbox Enforce read/write/execute on applications for different portions of memory No virtual addressing but much finer grained than MMU On Cortex-M4: Up to 64 different regions Region size between 32B and 4KB Can isolate application memory from each other Can allocate sensitive kernel data structures in application space Can expose specific peripherals directly to applications

MPU: Hardware App Sandbox high address Memory Mapped I/O Peripheral Kernel Stack App specific Kernel memory low address Second App Memory First App Memory Code App code

Language-level Sanbox: Goals Device drivers cannot interfere with each other E.g. a network stack cannot muck with readings from a glucose sensor Single threaded execution model Simpler to write correct code Kernel/hardware does not have to worry about concurrent access bugs Much faster processing speeds make this feasible within time contraints

Language-level Sanbox: Why Rust? No runtime system Memory Safety Elimates a large class of bugs: dangling pointers, double-frees, pointer arithmetic errors, etc Type Safety Not garbage collected, zero-cost safety abstractions Can expose low-level hardware interfaces through safe interfaces Strict Aliasing Unique references and read/write references obviate many concurrency bugs

Zero Dynamic Kernel Allocation Embedded OSs generally avoid dynamic allocation for good reason Hard to determine in the lab if something will crash in the field No swapping, so no way to deal with memory overflows But problematic with dynamically loaded applications A new app may use drivers differently E.g. different number of timers, more buffer, etc

Tock: Dynamic Allocation Three ways kernel allocates memory: Statically Size determined at compile-time Kernel stack App-specific kernel heap Maximum size can be determined at compile-time via anlaysis Application memory Fined grained MPU allows dynamic sizing of app-specific kernel-heap. Application Heap Application Stack

Tock: Dynamic Allocation Example kernel allocations in application space: Linked list nodes Virtual timer structs Network stack buffers App-specific kernel heap Application Heap Application Stack

Summary Traditional embedded systems are outdated: New hardware New use cases New generation of developers Security should be a main goal of any new system Leverage hardware protection to isolate third-party applications Leverage advances in programming languages to make kernel more secure

Challenges & Questions Will this work? Maintain reliability and power constraints unique to embedded devices While making security accessible to non-expert developers Dynamically updating the kernel/drivers? How do we leverage multi-microcontroller platforms? MGC security - Applications that span embedded devices, gateways (e.g. smartphones) and the cloud