CS5204 Fall 20051Oct. 26, 2005 Mondrix: Memory Isolation for Linux using Mondriaan Memory Protection Emmett Witchel Junghwan Rhee Krste Asanovic Sreeram.

Slides:



Advertisements
Similar presentations
More on Processes Chapter 3. Process image _the physical representation of a process in the OS _an address space consisting of code, data and stack segments.
Advertisements

Memory Management Paging &Segmentation CS311, CS350 & CS550.
1 A Real Problem  What if you wanted to run a program that needs more memory than you have?
Lightweight Remote Procedure Call Brian N. Bershad, Thomas E. Anderson, Edward D. Lazowska, and Henry M. Levy Presented by Alana Sweat.
Considerations for Mondriaan-like Systems 2009 Workshop on Duplicating, Deconstructing, and Debunking Emmett Witchel University of Texas at Austin.
Operating System Support Focus on Architecture
OS Fall ’ 02 Introduction Operating Systems Fall 2002.
Dawson R. Engler, M. Frans Kaashoek, and James O'Tool Jr.
Introduction to Kernel
Home: Phones OFF Please Unix Kernel Parminder Singh Kang Home:
OS Spring’03 Introduction Operating Systems Spring 2003.
Advanced OS Chapter 3p2 Sections 3.4 / 3.5. Interrupts These enable software to respond to signals from hardware. The set of instructions to be executed.
1 Last Class: Introduction Operating system = interface between user & architecture Importance of OS OS history: Change is only constant User-level Applications.
Computer Organization and Architecture
CS533 Concepts of OS Class 16 ExoKernel by Constantia Tryman.
CS364 CH08 Operating System Support TECH Computer Science Operating System Overview Scheduling Memory Management Pentium II and PowerPC Memory Management.
Layers and Views of a Computer System Operating System Services Program creation Program execution Access to I/O devices Controlled access to files System.
Windows 2000 Memory Management Computing Department, Lancaster University, UK.
Memory Management in Windows and Linux &. Windows Memory Management Virtual memory manager (VMM) –Executive component responsible for managing memory.
1 CS503: Operating Systems Part 1: OS Interface Dongyan Xu Department of Computer Science Purdue University.
CS533 Concepts of Operating Systems Jonathan Walpole.
G53SEC 1 Reference Monitors Enforcement of Access Control.
CSE 451: Operating Systems Section 10 Project 3 wrap-up, final exam review.
Emmett Witchel Krste Asanovic MIT Lab for Computer Science Mondriaan Memory Protection.
Memory Management 3 Tanenbaum Ch. 3 Silberschatz Ch. 8,9.
Chapter 8 – Main Memory (Pgs ). Overview  Everything to do with memory is complicated by the fact that more than 1 program can be in memory.
Hardware process When the computer is powered up, it begins to execute fetch-execute cycle for the program that is stored in memory at the boot strap entry.
Computers Operating System Essentials. Operating Systems PROGRAM HARDWARE OPERATING SYSTEM.
Chapter 4 Memory Management Virtual Memory.
G53SEC 1 Reference Monitors Enforcement of Access Control.
By Teacher Asma Aleisa Year 1433 H.   Goals of memory management  To provide a convenient abstraction for programming.  To allocate scarce memory.
Operating Systems Security
Operating Systems Engineering Based on MIT (2012, lec3) Recitation 2: OS Organization.
Processes and Virtual Memory
Efficient Software Based Fault Isolation Author: Robert Wahobe,Steven Lucco,Thomas E Anderson, Susan L Graham Presenter: Maitree kanungo Date:02/17/2010.
Hardware process When the computer is powered up, it begins to execute fetch-execute cycle for the program that is stored in memory at the boot strap entry.
Protection of Processes Security and privacy of data is challenging currently. Protecting information – Not limited to hardware. – Depends on innovation.
Lecture 5 Rootkits Hoglund/Butler (Chapters 1-3).
Introduction Contain two or more CPU share common memory and peripherals. Provide greater system throughput. Multiple processor executing simultaneous.
Lecture 4 Page 1 CS 111 Online Modularity and Memory Clearly, programs must have access to memory We need abstractions that give them the required access.
Emmett Witchel Josh Cates Krste Asanovic MIT Lab for Computer Science Mondrian Memory Protection.
1 Chapter 2: Operating-System Structures Services Interface provided to users & programmers –System calls (programmer access) –User level access to system.
Introduction to Operating Systems Concepts
Translation Lookaside Buffer
CS 3214 Computer Systems Lecture 9 Godmar Back.
Introduction to Kernel
Introduction to Operating Systems
Memory Management Paging (continued) Segmentation
Mondrix: Memory Isolation for Linux using Mondriaan Memory Protection
CS510 Operating System Foundations
Introduction to Operating Systems
Page Replacement.
Memory Management Paging (continued) Segmentation
Module IV Memory Organization.
Translation Lookaside Buffer
Hardware Works, Software Doesn’t: Enforcing Modularity with Mondriaan Memory Protection Emmett Witchel Krste Asanović MIT Lab for Computer Science.
CSE 451: Operating Systems Autumn 2005 Memory Management
Virtual Memory Overcoming main memory size limitation
Operating Systems Lecture 3.
CSE 451: Operating Systems Autumn 2003 Lecture 10 Paging & TLBs
CSE 451: Operating Systems Autumn 2003 Lecture 9 Memory Management
Operating Systems: A Modern Perspective, Chapter 3
CSE 451: Operating Systems Autumn 2003 Lecture 10 Paging & TLBs
CSE 451: Operating Systems Autumn 2003 Lecture 9 Memory Management
System Calls System calls are the user API to the OS
CS703 - Advanced Operating Systems
Memory Management Paging (continued) Segmentation
Lecture Topics: 11/20 HW 7 What happens on a memory reference Traps
In Today’s Class.. General Kernel Responsibilities Kernel Organization
Presentation transcript:

CS5204 Fall 20051Oct. 26, 2005 Mondrix: Memory Isolation for Linux using Mondriaan Memory Protection Emmett Witchel Junghwan Rhee Krste Asanovic Sreeram Ramalingam 10/26/2005

CS5204 Fall 20052Oct. 26, 2005 Roadmap Introduction Mondria(a)n Memory Protection – Overview Kernel Partitioning MMP Structure and Features Memory Supervisor Experimental Evaluation Conclusion and Comments

CS5204 Fall 20053Oct. 26, 2005 Introduction Motivation Memory Protection prevents one process from corrupting the memory of another process Involves hardware and software Methods: − Segmentation − Paging − Protection Keys Fine-grained vs. Coarse-grained

CS5204 Fall 20054Oct. 26, 2005 Mondrian Memory Protection Pieter Cornelis Mondriaan, Jr. (1872 – 1944) – the first modern painter None Read-only Read-write Execute-read Memory Addresses 0xFFF Protection Domains Each column represents a protection domain (PD) Each row represents a range of memory addresses Every thread associated with only one PD Allows arbitrary sized memory regions

CS5204 Fall 20055Oct. 26, 2005 Linux Kernel Partitioning Mondrix isolates each kernel module in its own domain Each module in Disk and Network Device drivers has its own domain Basic Domains in Mondrix PD 0 – Memory Supervisor (Bottom) PD 1 – Memory Supervisor (Top) PD 2 – Kernel PD 3 – String Functions Domain creation occurs when modules are loaded in the kernel

CS5204 Fall 20056Oct. 26, 2005 Module Loading / Domain Creation insmod program is called by user to load a new kernel module Kernel then calls memory supervisor to set memory permissions Length of program sections Start address of every function Address of the return instruction

CS5204 Fall 20057Oct. 26, 2005 Domain Creation PD1 owns entire address space PD2 owns its static code and data PD1 owns the rest of the address space

CS5204 Fall 20058Oct. 26, 2005 Device Drivers Partitioning Disk Driver Device dependent bottom half Device independent top half Mondrix detects improper programming of device registers Network Driver Chip-specific portion (coordinates reception and transmission) Board-specific portion (moves data on and off n/w card)

CS5204 Fall 20059Oct. 26, 2005 Other Domain Partitions Device Interrupts Jumps to interrupt stubs marked executable in the global group protection domain Inlined Functions Export permissions on data Uninline the function Slab Allocator

CS5204 Fall Oct. 26, 2005 Memory Supervisor Split into two layers – ‘top’ and ‘bottom’ Bottom layer’s functionality is to just write the permissions table in memory Top layer functionalities Permissions and Memory allocation (uses API calls perm_alloc and perm_free) Thread-local stack permissions Permissions policy Group Protection domains − Used in management of inodes

CS5204 Fall Oct. 26, 2005 Permissions Policy

CS5204 Fall Oct. 26, 2005 MMP System Structure

CS5204 Fall Oct. 26, 2005 MMP Features in Mondrix(1) Memory Protection Address space is the kernel virtual address space Permissions information stored in permissions table in main memory Protection Lookaside Buffer (PLB) is used as a cache by the MMP hardware and is similar to the TLB Preserves the user/kernel mode distinction (uses high bit of PD-ID register)

CS5204 Fall Oct. 26, 2005 MMP Features (2) Cross Domain Calling Provides two way guarantee Thread enters a callee’s domain at specified points called Switch Gates. Thread returns from a cross-domain call at specified points called Return Gates. Information about Gates are stored in a separate Gate Table and is cached with a Gate Lookaside Buffer (GLB) Format of Gate Table Entries Address (32b) Switch/Return (1b)Switch/Return (1b)Unused (15b) Destination PD-ID (16b)Destination PD-ID (16b)

CS5204 Fall Oct. 26, 2005 Experimental Evaluations Functional Evaluation Expose a Linux Error! Fault Injection experiments (used in Nooks) Performance Evaluation Used SimICS and Bochs system emulators CPU and Memory overheads were less than 15% Four benchmarks were chosen − config-xemacs − thttpd − find − MySQL

CS5204 Fall Oct. 26, 2005 Linux Error! free_task_struct() used to free the task structure if the task structure reference count is zero Proc_pid_lookup() and proc_pid_delete_inode() call free_task_struct() During kernel initialization task structure count is zero causing kernel stack memory to be freed

CS5204 Fall Oct. 26, 2005 Fault Injection Experiments Fault Types Bit flips Low-level software faults High-level software faults Corruption Detection Indirect Corruption Direct Corruption − Checksum − memTest − File copies Source: The Rio File Cache: Surviving Operating System Crashes

CS5204 Fall Oct. 26, 2005 Performance Evaluation - thttpd

CS5204 Fall Oct. 26, 2005 Performance Evaluation Cross Domain Calling Cross domain calls accounted for less than 1% of total execution time Cross domain call stack never grew deeper than 64 entries Memory Use Sum of Active and Inactive memory in kernel was within 1% for Mondrix and Linux PLB Refill Traffic Less than 4% execution time spent in PLB refilling

CS5204 Fall Oct. 26, 2005 Related Work Nooks uses conventional hardware to isolate modules in different addressing contexts. Language-based protection Use safe languages for OS implementation Hardware-based protection Use of NX bit OS structure-based

CS5204 Fall Oct. 26, 2005 Conclusion Provides Fine-grained memory protection Backward compatibility for operating systems, ISAs and programming models Additional hardware not on processor’s critical path Fits naturally with how modern software is designed and written

CS5204 Fall Oct. 26, 2005 Questions/Comments?

CS5204 Fall Oct. 26, 2005 MMP Features (3) Stack Permissions Registers designate stack frames in the current domain as readable or writable Earlier frames are designated as read only Stack write permissions table is used to decide whether a given stack address is writable by the thread (This is also cached in the PLB)