Rump Kernel Based QEMU Stubdomain

Total Page:16

File Type:pdf, Size:1020Kb

Rump Kernel Based QEMU Stubdomain Rump kernel based QEMU stubdomain Wei Liu Seattle { August 17-18, 2015 Agenda Xen 4.6 timeline Development update Xen 4.6 Retrospective Agenda I Background I Introduction to rump kernel I Why rump kernel I What are required for QEMU stubdomain I Status of upstream QEMU stubdomain Seattle { August 17-18, 2015 Rump kernel based QEMU stubdomain 2 / 19 Agenda Xen 4.6 timeline Development update Xen 4.6 Retrospective Background I Feature parity with QEMU traditional I so that we can eventually use QEMU upstream for everything I Most secure option for sandboxing QEMU I But be aware of the downside: extra resources required Seattle { August 17-18, 2015 Rump kernel based QEMU stubdomain 3 / 19 Agenda Xen 4.6 timeline Development update Xen 4.6 Retrospective Introduction to rump kernel Seattle { August 17-18, 2015 Rump kernel based QEMU stubdomain 4 / 19 Agenda Xen 4.6 timeline Development update Xen 4.6 Retrospective Why rump kernel Options we considered: I Roll our own I Linux based I OSv based I Rump kernel based Seattle { August 17-18, 2015 Rump kernel based QEMU stubdomain 5 / 19 Agenda Xen 4.6 timeline Development update Xen 4.6 Retrospective Why rump kernel Roll our own: I Like QEMU traditional stubdom I Require much work to maintain I QEMU upstream changes a lot Seattle { August 17-18, 2015 Rump kernel based QEMU stubdomain 6 / 19 Agenda Xen 4.6 timeline Development update Xen 4.6 Retrospective Why rump kernel Linux based: I Anthony Perard built a prototype I Hard to build I Hard to distribute Seattle { August 17-18, 2015 Rump kernel based QEMU stubdomain 7 / 19 Agenda Xen 4.6 timeline Development update Xen 4.6 Retrospective Why rump kernel OSv based: I Provides toolchain to turn application to VM I No C++ expertise I No PV support (yet) Seattle { August 17-18, 2015 Rump kernel based QEMU stubdomain 8 / 19 Agenda Xen 4.6 timeline Development update Xen 4.6 Retrospective Why rump kernel Rump kernel based: I Provides toolchain to turn application to VM I NetBSD code base I POSIX-y interface I Many NetBSD infrastructures available I Lots of utilities for debugging (with the help of syscall proxy) I PV support Seattle { August 17-18, 2015 Rump kernel based QEMU stubdomain 9 / 19 Agenda Xen 4.6 timeline Development update Xen 4.6 Retrospective What are required To build a QEMU stubdomain: I Xenbus driver I Privcmd driver I Grant table driver I Tap (and bridge) device I Communication channel between toolstack domain and QEMU Seattle { August 17-18, 2015 Rump kernel based QEMU stubdomain 10 / 19 Agenda Xen 4.6 timeline Development update Xen 4.6 Retrospective What are required How are they done in QEMU traditional stubdomain I Various drivers: libxc hooked up to mini-os I Tap device: hacked together, dump traffic to vif I Communication: via special consoles Seattle { August 17-18, 2015 Rump kernel based QEMU stubdomain 11 / 19 Agenda Xen 4.6 timeline Development update Xen 4.6 Retrospective What are required How are they (going to be) done in QEMU upstream stubdomain I Various drivers: rump kernel hooked up to mini-os I Tap (and bridge) device: provided by NetBSD I Communication: libvchan or TCP network Seattle { August 17-18, 2015 Rump kernel based QEMU stubdomain 12 / 19 Agenda Xen 4.6 timeline Development update Xen 4.6 Retrospective Things done so far I All required Xen drivers upstreamed in rump kernel I Bridge and tap drivers enabled I QEMU built as unikernel I Build a bunch of prerequisite libraries I Build QEMU with prerequisite libraries I Able to run with {help and exits Seattle { August 17-18, 2015 Rump kernel based QEMU stubdomain 13 / 19 Agenda Xen 4.6 timeline Development update Xen 4.6 Retrospective Problems need to be solved I Bootstrap rump kernel to certain state I Network topology setup etc I Currently use a simple program to do that I Stabilise toolchain and utilities I Wish to use rumprun directly from libxl I Currently not sure if it meets every requirement we have I How to build QEMU stubdomain I Currently done with a hacked-up script I Building should be done with Raisin, don't want to put into Xen tree Seattle { August 17-18, 2015 Rump kernel based QEMU stubdomain 14 / 19 Thank you! Seattle { August 17-18, 2015 Rump kernel based QEMU stubdomain 15 / 19.
Recommended publications
  • Assessing Unikernel Security April 2, 2019 – Version 1.0
    NCC Group Whitepaper Assessing Unikernel Security April 2, 2019 – Version 1.0 Prepared by Spencer Michaels Jeff Dileo Abstract Unikernels are small, specialized, single-address-space machine images constructed by treating component applications and drivers like libraries and compiling them, along with a kernel and a thin OS layer, into a single binary blob. Proponents of unikernels claim that their smaller codebase and lack of excess services make them more efficient and secure than full-OS virtual machines and containers. We surveyed two major unikernels, Rumprun and IncludeOS, and found that this was decidedly not the case: unikernels, which in many ways resemble embedded systems, appear to have a similarly minimal level of security. Features like ASLR, W^X, stack canaries, heap integrity checks and more are either completely absent or seriously flawed. If an application running on such a system contains a memory corruption vulnerability, it is often possible for attackers to gain code execution, even in cases where the applica- tion’s source and binary are unknown. Furthermore, because the application and the kernel run together as a single process, an attacker who compromises a unikernel can immediately exploit functionality that would require privilege escalation on a regular OS, e.g. arbitrary packet I/O. We demonstrate such attacks on both Rumprun and IncludeOS unikernels, and recommend measures to mitigate them. Table of Contents 1 Introduction to Unikernels . 4 2 Threat Model Considerations . 5 2.1 Unikernel Capabilities ................................................................ 5 2.2 Unikernels Versus Containers .......................................................... 5 3 Hypothesis . 6 4 Testing Methodology . 7 4.1 ASLR ................................................................................ 7 4.2 Page Protections ....................................................................
    [Show full text]
  • Efficient Cache Attacks on AES, and Countermeasures
    J. Cryptol. (2010) 23: 37–71 DOI: 10.1007/s00145-009-9049-y Efficient Cache Attacks on AES, and Countermeasures Eran Tromer Computer Science and Artificial Intelligence Laboratory, Massachusetts Institute of Technology, 32 Vassar Street, G682, Cambridge, MA 02139, USA [email protected] and Department of Computer Science and Applied Mathematics, Weizmann Institute of Science, Rehovot 76100, Israel Dag Arne Osvik Laboratory for Cryptologic Algorithms, Station 14, École Polytechnique Fédérale de Lausanne, 1015 Lausanne, Switzerland dagarne.osvik@epfl.ch Adi Shamir Department of Computer Science and Applied Mathematics, Weizmann Institute of Science, Rehovot 76100, Israel [email protected] Communicated by Lars R. Knudsen Received 20 July 2007 and revised 25 June 2009 Online publication 23 July 2009 Abstract. We describe several software side-channel attacks based on inter-process leakage through the state of the CPU’s memory cache. This leakage reveals memory access patterns, which can be used for cryptanalysis of cryptographic primitives that employ data-dependent table lookups. The attacks allow an unprivileged process to attack other processes running in parallel on the same processor, despite partitioning methods such as memory protection, sandboxing, and virtualization. Some of our meth- ods require only the ability to trigger services that perform encryption or MAC using the unknown key, such as encrypted disk partitions or secure network links. Moreover, we demonstrate an extremely strong type of attack, which requires knowledge of nei- ther the specific plaintexts nor ciphertexts and works by merely monitoring the effect of the cryptographic process on the cache. We discuss in detail several attacks on AES and experimentally demonstrate their applicability to real systems, such as OpenSSL and Linux’s dm-crypt encrypted partitions (in the latter case, the full key was recov- ered after just 800 writes to the partition, taking 65 milliseconds).
    [Show full text]
  • Rump File Systems Kernel Code Reborn
    Rump File Systems Kernel Code Reborn Antti Kantee [email protected] Helsinki University of Technology USENIX Annual Technical Conference, San Diego, USA June 2009 Introduction ● kernel / userspace dichotomy – interfaces dictate environment ● make kernel file systems run in userspace in a complete and maintainable way – full stack, no code forks or #ifdef ● file system is a protocol translator – read(off,size,n) => blocks 001,476,711,999 Implementation status ● NetBSD kernel file system code runs unmodified in a userspace process ● total of 13 kernel file systems – cd9660, efs, ext2fs, fat, ffs, hfs+, lfs, nfs, ntfs, puffs, sysvbfs, tmpfs, udf – disk, memory, network, ”other” ● implementation shipped as source and binary with NetBSD 5.0 and later Terminology rump: runnable userspace meta program 1) userspace program using kernel code 2) framework which enables above rump kernel: part of rump with kernel code host (OS): system running the rump(1) Talk outline motivation use cases implementation evaluation Motivation ● original motivation: kernel development ● additional benefits: – security – code reuse in userspace tools – kernel code reuse on other systems Contrasts 1)usermode OS, emulator, virtual machine, second machine, turing machine, etc. – acknowledge that we already have an OS – vm simplifications, abstraction shortcuts, etc. – direct host service (no additional userland) 2)userspace file systems (e.g. FUSE) – reuse existing code, not write new code against another interface Talk outline motivation use cases implementation evaluation
    [Show full text]
  • Unikernels: the Next Stage of Linux's Dominance
    Unikernels: The Next Stage of Linux’s Dominance Ali Raza Parul Sohal James Cadden Boston University Boston University Boston University [email protected] [email protected] [email protected] Jonathan Appavoo Ulrich Drepper Richard Jones Boston University Red Hat Red Hat [email protected] [email protected] [email protected] Orran Krieger Renato Mancuso Larry Woodman Boston University Boston University Red Hat [email protected] [email protected] [email protected] Abstract 1 Introduction Unikernels have demonstrated enormous advantages over Linux is the dominant OS across nearly every imaginable Linux in many important domains, causing some to propose type of computer system today. Linux is running in billions of that the days of Linux’s dominance may be coming to an people’s pockets, in millions of our homes, in cars, in planes, end. On the contrary, we believe that unikernels’ advantages in spaceships [15], embedded throughout our networks, and represent the next natural evolution for Linux, as it can adopt on each of the top 500 supercomputers [2]. To accomplish the best ideas from the unikernel approach and, along with this, the Linux kernel has been continuously expanded to its battle-tested codebase and large open source community, support a wide range of functionality; it is a hypervisor, a real- continue to dominate. In this paper, we posit that an up- time OS, an SDN router, a container runtime, a BPF virtual streamable unikernel target is achievable from the Linux machine, and a support layer for Emacs. When considering kernel, and, through an early Linux unikernel prototype, this ever-growing set of requirements, and the complexity demonstrate that some simple changes can bring dramatic creep which ensues [26], it leads to the question: Can a single performance advantages.
    [Show full text]
  • A Survey of Microarchitectural Timing Attacks and Countermeasures on Contemporary Hardware
    A Survey of Microarchitectural Timing Attacks and Countermeasures on Contemporary Hardware Qian Ge1, Yuval Yarom2, David Cock1,3, and Gernot Heiser1 1Data61, CSIRO and UNSW, Australia, qian.ge, [email protected] 2Data61, CSIRO and the University of Adelaide, Australia, [email protected] 3Present address: Systems Group, Department of Computer Science, ETH Zurich,¨ [email protected] Abstract Microarchitectural timing channels expose hidden hardware state though timing. We survey recent attacks that exploit microarchitectural features in shared hardware, especially as they are relevant for cloud computing. We classify types of attacks according to a taxonomy of the shared resources leveraged for such attacks. Moreover, we take a detailed look at attacks used against shared caches. We survey existing countermeasures. We finally discuss trends in the attacks, challenges to combating them, and future directions, especially with respect to hardware support. 1 Introduction Computers are increasingly handling sensitive data (banking, voting), while at the same time we consolidate more services, sensitive or not, on a single hardware platform. This trend is driven both by cost savings and convenience. The most visible example is the cloud computing—infrastructure-as-a-service (IaaS) cloud computing supports multiple virtual machines (VM) on a hardware platform managed by a virtual machine monitor (VMM) or hypervisor. These co-resident VMs are mutually distrusting: high-performance computing software may run alongside a data centre for financial markets, requiring the platform to ensure confidentiality and integrity of VMs. The cloud computing platform also has availability requirements: service providers have service-level agreements (SLAs) which specify availability targets, and malicious VMs being able to deny service to a co-resident VM could be costly to the service provider.
    [Show full text]
  • Operating Systems
    OPERATING SYSTEMS Rump Kernels No OS? No Problem! ANTTI KANTEE, JUSTIN CORMACK Antti Kantee got bitten by the n the modern world, both virtualization and plentiful hardware have OS bug when he was young, created situations where an OS is used for running a single application. and is still searching for a But some questions arise: Do we need the OS at all? And by including an patch. He has held a NetBSD I OS, are we only gaining an increased memory footprint and attack surface? commit bit for fifteen years and This article introduces rump kernels, which provide NetBSD kernel drivers for the previous seven of them he has been working on rump kernels. As a so-called day as portable components, allowing you to run applications without an operat- job, Antti runs a one-man “systems design and ing system. implementation consulting” show. There is still a reason to run an OS: Operating systems provide unparalleled driver support, [email protected] e.g., TCP/IP, SCSI, and USB stacks, file systems, POSIX system call handlers, and hardware device drivers. As the name rump kernel suggests, most of the OS functionality not related to Justin Cormack accidentally drivers is absent, thereby reducing a rump kernel’s footprint and attack surface. wandered into a room full of UNIX workstations at MIT in For example, a rump kernel does not provide support for executing binaries, scheduling the early 1990s and has been threads, or managing hardware privilege levels. Yet rump kernels can offer a complete using various flavors ever since. enough environment to support unmodified POSIXy applications on top of them (Figure He started working with rump kernels last year 1).
    [Show full text]
  • Rumprun for Rump Kernels: Instant Unikernels for POSIX Applications
    Rumprun for Rump Kernels: Instant Unikernels for POSIX applications Martin Lucina, @matolucina 1 / 8 So many Kernels, what are they? Monolithic kernel, Microkernel: standard stuff. Rump kernel: an existing monolithic kernel componentized into an anykernel. Mix and match kernel components any way you want. Unikernel: turns the OS into a “library” for a single application. Normally requires writing your application from the ground up for the Unikernel. Mirage OS, for example. Rump kernels Today's talk by @anttikantee has all the details, won't repeat them here. Many different use cases: Use Rump Kernels to bootstrap a new OS quickly. Use Rump Kernel components directly in a userspace application. Use Rump Kernels as Unikernels for unmodified POSIX applications. The last point is what will be demonstrated in this talk. 2 / 8 Rump kernels as Unikernels for POSIX applications Rump kernels already provide most of the components we need: Core system calls. File systems, network stack, device drivers, ... What else do we need? 1. Threads, scheduling, memory management, locking, event handling (interrupts): Provided by the hypervisor and “firmware”. 2. A C library: We re-use the NetBSD libc with minimal modifications. 3. A magic* build system: app-tools. 4. A magic* deployment system: rumprun. * One that just works. No fiddling. 3 / 8 Rumprun We need an easy way to provision and deploy the application on the various different stacks: Configure network devices. Configure block devices and mount filesystems. Platform-specific launching (Xen, KVM, ...). The rumprun tool and rumpconfig module which I have been working on is the beginning of this: rumprun xen -di -n inet,static,10.10.10.10/16 \ -b images/stubetc.iso,/etc \ -b images/data.iso,data \ .../mathopd -n -f /data/mathopd.conf The Xen version uses Xenstore to communicate configuration to the application.
    [Show full text]
  • RUMP KERNELS and {Why,How} We Got Here
    RUMP KERNELS and {why,how} we got here New Directions in Operating Systems November 2014, London Antti Kantee, Fixup Software Ltd. [email protected] @anttikantee Motivations ● want to run an application, not an OS ● want a better operating system ● “operating system gets in the way” FIRST HALF what is an operating system Summary of OS's ● drivers – for enabling applications to run – n*106 LoC ● optional goop defining relation between drivers and applications – for protection, resource sharing, ... – 103 – 105 LoC application application driver kernel driver driver driver driver application application driver driver Server (“OS”) driver kernel driver driver application application server server driver driver server kernel driver application application application driver driver driver cpu core cpu core cpu core application driver driver driver driver kernel application application driver kernel driver driver driver driver SECOND HALF what is a rump kernel hypercall implementation kernel rump callers (i.e. “clients”) hypercall interface platform file systems TCP/IP device drvs syscalls ... rump (n): small or inferior remnant or offshoot; especially: a group (as a parliament) carrying on in the name of the original body after the departure or expulsion of a large number of its members rump kernel (n): small or inferior remnant or offshoot; specifically: a monolithic OS kernel carrying on in the name of the original body after the departure or expulsion of a large number of its subsystems A rump kernel does not provide threads, a scheduler, exec, or virtual memory, nor does it require privileged mode (or emulation of it) or interrupts > runs anywhere > integrates into other systems Wait, that doesn't explain where the drivers come from < anykernel (NetBSD) AN EXAMPLE! same thread throughout entire stack application(s) unmodified POSIX userspace code (10n lines) userspace libraries libc rump kernel calls syscall traps unmodified NetBSD code 6 s s (~10 lines) v m s r l P l e I d t / a s ..
    [Show full text]
  • A Split TCP/IP Stack Implementation for GNU/Linux
    Diplomarbeit A Split TCP/IP Stack Implementation for GNU/Linux Martin Unzner [email protected] 29. April 2014 Technische Universität Dresden Fakultät Informatik Institut für Systemarchitektur Professur Betriebssysteme Betreuender Hochschullehrer: Prof. Dr. rer. nat. Hermann Härtig Betreuender Mitarbeiter: Dipl.-Inf. Julian Stecklina Erklärung Hiermit erkläre ich, dass ich diese Arbeit selbstständig erstellt und keine anderen als die angegebenen Hilfsmittel benutzt habe. Dresden, den 29. April 2014 Martin Unzner Danksagung Mein Dank geht an Professor Hermann Härtig und Julian Stecklina, die es mir ermöglicht haben, diese gleichermaßen herausfordernde und dankbare Aufgabe anzunehmen. Mit seiner geduldigen und gründlichen Art und richtungsweisenden Ratschlägen hat Julian diese Arbeit entscheidend geprägt. Björn Döbel gebührt Dank für die Weiterbetreuung der Arbeit in ihrer Endphase und viele hilfreiche Anmerkungen zu Stil und Inhalt. Meinen Kommilitonen im Studentenlabor möchte ich für die ausgezeichnete Atmosphäre und die teils unbequemen, aber stets tiefschürfenden und ehrlichen Hinweise danken. Meine Eltern haben mich während der Entstehungsphase dieser Arbeit auf vielerlei Arten unterstützt, ein großes Dankeschön dafür. Zuletzt danke ich meiner Schwester Grit fürs Korrekturlesen. Abstract The TCP/IP protocol suite is the foundation of the worldwide internet, which is the world’s most widespread computer network. Today, in most systems, TCP/IP protocols are still handled in the kernel. Faulty packets and attacks like SYN flooding can affect the whole operating system, even if they are just targeted towards one single network process. A userspace TCP/IP stack, on the other hand, exposes only networking applications to those threats. Most userspace TCP/IP stacks are designed as independent application libraries that send and receive fully-fledged Ethernet frames.
    [Show full text]
  • WAMOS 2015 Second Wiesbaden Workshop on Advanced Microkernel Operating Systems
    WAMOS 2015 Second Wiesbaden Workshop on Advanced Microkernel Operating Systems Editor / Program Chair: Robert Kaiser RheinMain University of Applied Sciences Information Science Unter den Eichen 5 65195 Wiesbaden Germany Technical Report August 2015 Contents Foreword 3 Program Committee 3 Keynote Talk 5 Session 1: Kernel Design Principles7 Unikernels Kevin Sapper ...........................................7 Shared libraries for the seL4 Kernel Andreas Werner .......................................... 13 Session 2: IPC Performance and Security 19 Improvement of IPC responsiveness in microkernel-based operating systems Steffen Reichmann ......................................... 19 Side Channel and Covert Channel Attacks on Microkernel Architectures Florian Schneider and Alexander Baumgartner¨ ......................... 23 Session 3: Microkernel Scheduling 29 Towards policy-free Microkernels Olga Dedi ............................................. 29 User-level CPU Inheritance Scheduling Sergej Bomke ........................................... 33 Session 4: Device Drivers and I/O 37 USB in a microkernel based operating system Daniel Mierswa and Daniel Tkocz ................................ 37 User-mode device driver development Annalena Gutheil and Benjamin Weißer ............................. 43 Program 50 © Copyright 2015 RheinMain University of Applies Sciences (HSRM). All rights reserved. The copyright of this collection is with HSRM. The copyright of the individual articles remains with their authors. Foreword Welcome to HSRM and to WAMOS
    [Show full text]
  • Lowrisc Summer of Code TCP/IP Offload to Minion Cores Using Rump Kernels
    lowRISC Summer of Code TCP/IP Offload to Minion Cores using Rump Kernels Sebastian Wicki Mentored by: Justin Cormack, Antti Kantee Or ani!er: Ale" Bradbury, lowRISC 1 %e want an open com&utin eco-system: comprehensible, le!ible and reusable Operating System Processor Peripherals $ )ardware platform I+O shims 1 &ins lo"RISC minion cores RISC#$ RISC#$ a&&lication a&&lication ● small, dedicated RISC#$ RISC#$ RISC#$ cores cores minion minion % minion RISC'V cores coherent network I+O network ● s&ecialized for I+O &rocessin 0$ cache ● &rotocols in so,ware ‒e- . SPI, I2C, SDIO off-chip memory ( so,ware platform rump kernels ● dri3er container ‒ file systems, network, audio ● run anywhere ‒ users&ace, )y&er3isors, bare-metal ‒ inte rate into own system ● based on Net#SD 2 project proposal I+O shims 1 &ins ● rump kernels on RISC#$ minion cores a&&lication RISC#$ RISC#$ cores minion % minion ● process I/O using rump drivers coherent network I+O network ‒ e- . TCP+I. 0$ cache ● traditional OS on application cores off-chip memory 5 rump &ernels 7 rump kernels: not an operating system ● no processes or application user s&ace threading ● no virtual memory system calls interrupts management net vfs dev paging signals bt tcp smb ext2 cgd usb vm processes ● no privilege levels ip blk ums scheduling ● no interrupt handling if kernel hardware 8 rump kernels: not an operating system ● hypercall interface application ‒ t)read sc)edulin host process ‒ memory allocation system calls net vfs dev ‒ console output bt tcp smb ext2 cgd usb ‒ I/O hypercalls ip blk
    [Show full text]
  • Lxds: Towards Isolation of Kernel Subsystems
    LXDs: Towards Isolation of Kernel Subsystems Vikram Narayanan Abhiram Balasubramanian∗ Charlie Jacobsen∗ University of California, Irvine University of Utah University of Utah Sarah Spall† Scott Bauer‡ Michael Quigley§ Aftab Hussain University of Utah University of Utah University of Utah University of California, Irvine Abdullah Younis¶ Junjie Shen University of California, Irvine University of California, Irvine Moinak Bhattacharyya Anton Burtsev University of California, Irvine University of California, Irvine Abstract and inherent complexity (typical kernel code adheres to mul- Modern operating systems are monolithic. Today, however, tiple allocation, synchronization, access control, and object lack of isolation is one of the main factors undermining se- lifetime conventions) bugs and vulnerabilities are routinely curity of the kernel. Inherent complexity of the kernel code introduced into the kernel code. In 2018, the Common Vul- and rapid development pace combined with the use of unsafe, nerabilities and Exposures database lists 176 Linux kernel low-level programming language results in a steady stream vulnerabilities that allow for privilege escalation, denial-of- of errors. Even after decades of efforts to make commodity service, and other exploits [20]. This number is the lowest kernels more secure, i.e., development of numerous static and across several years [19]. dynamic approaches aimed to prevent exploitation of most Even though a number of static and dynamic mechanisms common errors, several hundreds of serious kernel vulnerabil- have been invented to protect execution of the low-level kernel ities are reported every year. Unfortunately, in a monolithic code, e.g., modern kernels deploy stack guards [18], address kernel a single exploitable vulnerability potentially provides space layout randomization (ASLR) [45], and data execution an attacker with access to the entire kernel.
    [Show full text]