March 10, Linux Live Patching. Adrien schischi Schildknecht. Why? Who? How? When? (consistency model) Conclusion

Size: px
Start display at page:

Download "March 10, Linux Live Patching. Adrien schischi Schildknecht. Why? Who? How? When? (consistency model) Conclusion"

Transcription

1 March 10, 2015

2 Section 1

3 Why Goal: apply a binary patch to kernel on-line. is done without shutdown quick response to a small but critical issue the goal is not to avoid downtime Limitations: simple changes changes in data structure layout

4 Section 2

5 Similar projects kexec CRIU

6 Live patching project (Suse) kpatch (Red Hat) ksplice (Oracle)

7 Section 3

8 Ftrace Insert a jmp at the beginning of all the functions gcc -pg -mfentry (add 5 bytes, that call mcount) mcount = 13% overhead Store each trampoline location in a section " mcount_loc" scripts/recordmcount use the linker to merge them all into vmlinux At boot: foreach entries in " mcount_loc", replace jmp with 5 NOP Set the call to mcount only if needed insert INT3 and its handler at NOP[0] insert addr at NOP[1-4] insert jmp at NOP[0] send NMI IPI to flush the instruction decoders ftrace_calller invokes the hooks

9 Ftrace Insert a jmp at the beginning of all the functions gcc -pg -mfentry (add 5 bytes, that call mcount) mcount = 13% overhead Store each trampoline location in a section " mcount_loc" scripts/recordmcount use the linker to merge them all into vmlinux At boot: foreach entries in " mcount_loc", replace jmp with 5 NOP Set the call to mcount only if needed insert INT3 and its handler at NOP[0] insert addr at NOP[1-4] insert jmp at NOP[0] send NMI IPI to flush the instruction decoders ftrace_calller invokes the hooks

10 Ftrace Insert a jmp at the beginning of all the functions gcc -pg -mfentry (add 5 bytes, that call mcount) mcount = 13% overhead Store each trampoline location in a section " mcount_loc" scripts/recordmcount use the linker to merge them all into vmlinux At boot: foreach entries in " mcount_loc", replace jmp with 5 NOP Set the call to mcount only if needed insert INT3 and its handler at NOP[0] insert addr at NOP[1-4] insert jmp at NOP[0] send NMI IPI to flush the instruction decoders ftrace_calller invokes the hooks

11 Ftrace Insert a jmp at the beginning of all the functions gcc -pg -mfentry (add 5 bytes, that call mcount) mcount = 13% overhead Store each trampoline location in a section " mcount_loc" scripts/recordmcount use the linker to merge them all into vmlinux At boot: foreach entries in " mcount_loc", replace jmp with 5 NOP Set the call to mcount only if needed insert INT3 and its handler at NOP[0] insert addr at NOP[1-4] insert jmp at NOP[0] send NMI IPI to flush the instruction decoders ftrace_calller invokes the hooks

12 Section 4

13 Subsection 1

14 new functions must be applied at once old function must not be executed after switching to the new one no threads runs on old functions no threads sleeps on them

15 Subsection 2

16 ksplice and kpatch_v1 add ftrace entry stop_machine() stop running processes disable interrupts Safeness check walk through the threads and check the stack enable the hook

17 ksplice and kpatch_v1 + safe + simple - stop_machine() stops all processes a while ( 40ms) - fail to upgrade non-quiescient kernel function (schedule)

18 Subsection 3

19 Functions can be called while patching. atomic reference counter inc at function entry dec_if_pos at function exit Active safeness check at context switch check stack entries safely sleeping tasks can be checked safely

20 + get rid of stop_machine() - kretprobe has no error notification - not incremental (big patch has many functions)

21 Why relying on the stack may be hazardous How Linux retrieve the stack entries (return addresses): get an address on the stack (local variable) while (valid_stack_ptr(addr)) ++addr check if pointer is in.text section use frame pointer if available ret address lies just above a frame pointer the frame pointer chain broke in some rarely used assembler code

22 Subsection 4

23 Reality check trampoline: a per-thread flag is set on each kernel entry/exit set a trampoline which monitor kernel entry/exit and redirect to the old/new function remove the trampoline and set the new function when all the processes have changed their universe at least once

24 - all processes must wake up or execute a syscall - sometimes requires a signal to be sent - kernel thread never leave the kernel + does not rely on the stack entries

25 Section 5

26 Dazed and confused Questions?

Live Patching: The long road from Kernel to User Space. João Moreira Toolchain Engineer - SUSE Labs

Live Patching: The long road from Kernel to User Space. João Moreira Toolchain Engineer - SUSE Labs Live Patching: The long road from Kernel to User Space João Moreira Toolchain Engineer - SUSE Labs jmoreira@suse.de Software has bugs, and bugs have to be fixed + security issues + execution degradation

More information

Obstacles & Solutions for Livepatch Support on ARM64 Architecture

Obstacles & Solutions for Livepatch Support on ARM64 Architecture Obstacles & Solutions for Livepatch Support on ARM64 Architecture Li Bin ( 李彬 ) / huawei.libin@huawei.com 2017/06/20 HUAWEI TECHNOLOGIES CO., LTD. Agenda Livepatch overview Livepatch on x86 Obstacle for

More information

Rebootless Kernel Updates

Rebootless Kernel Updates Rebootless Kernel Updates Srivatsa S. Bhat VMware srivatsa@csail.mit.edu University of Washington 3 Dec 2018 Why are reboots undesirable? Why are reboots undesirable? Remember this? J Why are reboots undesirable?

More information

Elivepatch Flexible distributed Linux Kernel live patching. Alice Ferrazzi

Elivepatch Flexible distributed Linux Kernel live patching. Alice Ferrazzi Elivepatch Flexible distributed Linux Kernel live patching Alice Ferrazzi 1 Summary Live patch explanation Current live patch services Motivation for elivepatch Elivepatch solution Implementation Challenge

More information

Reboot adieu! Online Linux kernel patching. Udo Seidel

Reboot adieu! Online Linux kernel patching. Udo Seidel Reboot adieu! Online Linux kernel patching Udo Seidel Agenda Who & Why? How? Players & Show! And? Me :-) Teacher of mathematics and physics PhD in experimental physics Started with Linux in 1996 Linux/UNIX

More information

Live Kernel Patching status update. Jiri Kosina SUSE Labs

Live Kernel Patching status update. Jiri Kosina SUSE Labs Live Kernel Patching status update Jiri Kosina SUSE Labs Outline Why? History + current state Missing features / further development 2 Why live patching? Huge cost of downtime: Hourly

More information

Elivepatch Flexible distributed Linux Kernel live patching. Alice Ferrazzi Takanori Suzuki

Elivepatch Flexible distributed Linux Kernel live patching. Alice Ferrazzi Takanori Suzuki Elivepatch Flexible distributed Linux Kernel live patching Alice Ferrazzi Takanori Suzuki 1 kernel :~ $ whoami Alice Ferrazzi Gentoo Gentoo Kernel Project Leader Gentoo Google Summer of Code administrator

More information

kpatch Have your security and eat it too!

kpatch Have your security and eat it too! kpatch Have your security and eat it too! Josh Poimboeuf Senior Software Engineer, Red Hat LinuxCon North America August 22, 2014 Agenda What is kpatch? Why use kpatch? Demo How it works Features & Limitations

More information

Reboot Reloaded. Patching the Linux Kernel Online. Vojtěch Pavlík. Dr. Udo Seidel. Director SUSE Labs SUSE

Reboot Reloaded. Patching the Linux Kernel Online. Vojtěch Pavlík. Dr. Udo Seidel. Director SUSE Labs SUSE Reboot Reloaded Patching the Linux Kernel Online Vojtěch Pavlík Director SUSE Labs SUSE vojech@suse.com Dr. Udo Seidel Head of Linux Strategy and Server Automation Amadeus useidel@amadeus.com Agenda What

More information

Kernels and Locking. Luca Abeni

Kernels and Locking. Luca Abeni Kernels and Locking Luca Abeni luca.abeni@santannapisa.it Critical Sections in Kernel Code Old Linux kernels used to be non-preemptable... Kernel Big critical section Mutual exclusion was not a problem...

More information

Rebootless kernel updates

Rebootless kernel updates Rebootless kernel updates Jeff Arnold jbarnold@ksplice.com http://www.ksplice.com What is Ksplice? What is Ksplice? Running kernel with bug What is Ksplice? Running kernel with bug Ksplice Running kernel

More information

Scalability Efforts for Kprobes

Scalability Efforts for Kprobes LinuxCon Japan 2014 (2014/5/22) Scalability Efforts for Kprobes or: How I Learned to Stop Worrying and Love a Massive Number of Kprobes Masami Hiramatsu Linux Technology

More information

Kprobes Presentation Overview

Kprobes Presentation Overview Kprobes Presentation Overview This talk is about how using the Linux kprobe kernel debugging API, may be used to subvert the kernels integrity by manipulating jprobes and kretprobes to patch the kernel.

More information

SOEN228, Winter Revision 1.2 Date: October 25,

SOEN228, Winter Revision 1.2 Date: October 25, SOEN228, Winter 2003 Revision 1.2 Date: October 25, 2003 1 Contents Flags Mnemonics Basic I/O Exercises Overview of sample programs 2 Flag Register The flag register stores the condition flags that retain

More information

Overhead Evaluation about Kprobes and Djprobe (Direct Jump Probe)

Overhead Evaluation about Kprobes and Djprobe (Direct Jump Probe) Overhead Evaluation about Kprobes and Djprobe (Direct Jump Probe) Masami Hiramatsu Hitachi, Ltd., SDL Jul. 13. 25 1. Abstract To implement flight recorder system, the overhead

More information

Syscalls, exceptions, and interrupts, oh my!

Syscalls, exceptions, and interrupts, oh my! Syscalls, exceptions, and interrupts, oh my! Hakim Weatherspoon CS 3410 Computer Science Cornell University [Altinbuken, Weatherspoon, Bala, Bracy, McKee, and Sirer] Announcements P4-Buffer Overflow is

More information

Kernel Critical Sections

Kernel Critical Sections Kernel Critical Sections Real Time Operating Systems and Middleware Luca Abeni luca.abeni@unitn.it Critical Sections in Kernel Code Old Linux kernels used to be non-preemptable... Kernel Big critical section

More information

The Kernel Abstraction

The Kernel Abstraction The Kernel Abstraction Debugging as Engineering Much of your time in this course will be spent debugging In industry, 50% of software dev is debugging Even more for kernel development How do you reduce

More information

12. Interrupts and Programmable Multilevel Interrupt Controller

12. Interrupts and Programmable Multilevel Interrupt Controller 12. Interrupts and Programmable Multilevel Interrupt Controller 12.1 Features Short and predictable interrupt response time Separate interrupt configuration and vector address for each interrupt Programmable

More information

Assembly Language. Assembly language for x86 compatible processors using GNU/Linux operating system

Assembly Language. Assembly language for x86 compatible processors using GNU/Linux operating system Assembly Language Assembly language for x86 compatible processors using GNU/Linux operating system x86 refers to the instruction set architecture in most personal computers Derives from model numbers ending

More information

Università Ca Foscari Venezia

Università Ca Foscari Venezia Stack Overflow Security 1 2018-19 Università Ca Foscari Venezia www.dais.unive.it/~focardi secgroup.dais.unive.it Introduction Buffer overflow is due to careless programming in unsafe languages like C

More information

Control-flow Enforcement Technology H.J. Lu. Intel November, 2018

Control-flow Enforcement Technology H.J. Lu. Intel November, 2018 Control-flow Enforcement Technology H.J. Lu Intel November, 2018 Introduction Control-flow Enforcement Technology (CET) An upcoming Intel processor family feature that blocks return/jumporiented programming

More information

FUT92715 Solve the Paradox SUSE Linux Enterprise Live Patching Roadmap

FUT92715 Solve the Paradox SUSE Linux Enterprise Live Patching Roadmap FUT92715 Solve the Paradox SUSE Linux Enterprise Live Patching Roadmap Tuesday, Nov 8, 11:30 AM - 12:30 PM Friday, Nov 11, 9:00 AM - 10:00 AM Hannes Kühnemund SUSE Product Management Vojtěch Pavlík Director

More information

Using kgdb and the kgdb Internals

Using kgdb and the kgdb Internals Using kgdb and the kgdb Internals Jason Wessel jason.wessel@windriver.com Tom Rini trini@kernel.crashing.org Amit S. Kale amitkale@linsyssoft.com Using kgdb and the kgdb Internals by Jason Wessel by Tom

More information

Porting Linux to x86-64

Porting Linux to x86-64 Porting Linux to x86-64 Andi Kleen SuSE Labs ak@suse.de Abstract... Some implementation details with changes over the existing i386 port are discussed. 1 Introduction x86-64 is a new architecture developed

More information

Anne Bracy CS 3410 Computer Science Cornell University

Anne Bracy CS 3410 Computer Science Cornell University Anne Bracy CS 3410 Computer Science Cornell University The slides were originally created by Deniz ALTINBUKEN. P&H Chapter 4.9, pages 445 452, appendix A.7 Manages all of the software and hardware on the

More information

An Implementation Of Multiprocessor Linux

An Implementation Of Multiprocessor Linux An Implementation Of Multiprocessor Linux This document describes the implementation of a simple SMP Linux kernel extension and how to use this to develop SMP Linux kernels for architectures other than

More information

2006/7/22. NTT Data Intellilink Corporation Fernando Luis Vázquez Cao. Copyright(C)2006 NTT Data Intellilink Corporation

2006/7/22. NTT Data Intellilink Corporation Fernando Luis Vázquez Cao. Copyright(C)2006 NTT Data Intellilink Corporation Evaluating Linux Kernel Crash Dumping Mechanisms 2006/7/22 NTT Data Intellilink Corporation Fernando Luis Vázquez Cao 1 Who am I? LKDTT (Linux Kernel Dump Test Tool) maintainer MKDump (Mini Kernel Dump)

More information

ECE 598 Advanced Operating Systems Lecture 11

ECE 598 Advanced Operating Systems Lecture 11 ECE 598 Advanced Operating Systems Lecture 11 Vince Weaver http://www.eece.maine.edu/~vweaver vincent.weaver@maine.edu 23 February 2016 Announcements Homework #5 Posted Some notes, discovered the hard

More information

Ftrace Kernel Hooks: More than just tracing. Presenter: Steven Rostedt Red Hat

Ftrace Kernel Hooks: More than just tracing. Presenter: Steven Rostedt Red Hat Ftrace Kernel Hooks: More than just tracing Presenter: Steven Rostedt rostedt@goodmis.org Red Hat Ftrace Function Hooks Function Tracer Function Graph Tracer Function Profiler Stack Tracer Kprobes Uprobes

More information

Lecture 4: Mechanism of process execution. Mythili Vutukuru IIT Bombay

Lecture 4: Mechanism of process execution. Mythili Vutukuru IIT Bombay Lecture 4: Mechanism of process execution Mythili Vutukuru IIT Bombay Low-level mechanisms How does the OS run a process? How does it handle a system call? How does it context switch from one process to

More information

CS 550 Operating Systems Spring System Call

CS 550 Operating Systems Spring System Call CS 550 Operating Systems Spring 2018 System Call 1 Recap: The need for protection When running user processes, the OS needs to protect itself and other system components For reliability: buggy programs

More information

Hakim Weatherspoon CS 3410 Computer Science Cornell University

Hakim Weatherspoon CS 3410 Computer Science Cornell University Hakim Weatherspoon CS 3410 Computer Science Cornell University The slides are the product of many rounds of teaching CS 3410 by Deniz Altinbuken, Professors Weatherspoon, Bala, Bracy, and Sirer. C practice

More information

CSE 509: Computer Security

CSE 509: Computer Security CSE 509: Computer Security Date: 2.16.2009 BUFFER OVERFLOWS: input data Server running a daemon Attacker Code The attacker sends data to the daemon process running at the server side and could thus trigger

More information

Bypassing SEHOP. Stéfan Le Berre Damien Cauquil

Bypassing SEHOP. Stéfan Le Berre Damien Cauquil Bypassing SEHOP Stéfan Le Berre s.leberre@sysdream.com Damien Cauquil d.cauquil@sysdream.com Table of contents 0. Introduction...3 1. SEHOP specifications (short version)...3 2. Dealing with SEHOP when

More information

Interrupts, Fork, I/O Basics

Interrupts, Fork, I/O Basics Interrupts, Fork, I/O Basics 12 November 2017 Lecture 4 Slides adapted from John Kubiatowicz (UC Berkeley) 12 Nov 2017 SE 317: Operating Systems 1 Topics for Today Interrupts Native control of Process

More information

Keeping customer data safe in EC2 a deep dive. Martin Pohlack Amazon Web Services

Keeping customer data safe in EC2 a deep dive. Martin Pohlack Amazon Web Services Keeping customer data safe in EC2 a deep dive Martin Pohlack Amazon Web Services 1 Bio... Principal Engineer with Amazon Web Services I like to play with Low-level stuff Synchronization, hardware transactional

More information

CSCE Operating Systems Interrupts, Exceptions, and Signals. Qiang Zeng, Ph.D. Fall 2018

CSCE Operating Systems Interrupts, Exceptions, and Signals. Qiang Zeng, Ph.D. Fall 2018 CSCE 311 - Operating Systems Interrupts, Exceptions, and Signals Qiang Zeng, Ph.D. Fall 2018 Previous Class Process state transition Ready, blocked, running Call Stack Execution Context Process switch

More information

Low-Level Essentials for Understanding Security Problems Aurélien Francillon

Low-Level Essentials for Understanding Security Problems Aurélien Francillon Low-Level Essentials for Understanding Security Problems Aurélien Francillon francill@eurecom.fr Computer Architecture The modern computer architecture is based on Von Neumann Two main parts: CPU (Central

More information

Computer architecture. A simplified model

Computer architecture. A simplified model Computer architecture A simplified model Computers architecture One (or several) CPU(s) Main memory A set of devices (peripherals) Interrupts Direct memory access Computers architecture Memory Keyboard

More information

200 points total. Start early! Update March 27: Problem 2 updated, Problem 8 is now a study problem.

200 points total. Start early! Update March 27: Problem 2 updated, Problem 8 is now a study problem. CS3410 Spring 2014 Problem Set 2, due Saturday, April 19, 11:59 PM NetID: Name: 200 points total. Start early! Update March 27: Problem 2 updated, Problem 8 is now a study problem. Problem 1 Data Hazards

More information

Breaking Kernel Address Space Layout Randomization (KASLR) with Intel TSX. Yeongjin Jang, Sangho Lee, and Taesoo Kim Georgia Institute of Technology

Breaking Kernel Address Space Layout Randomization (KASLR) with Intel TSX. Yeongjin Jang, Sangho Lee, and Taesoo Kim Georgia Institute of Technology Breaking Kernel Address Space Layout Randomization (KASLR) with Intel TSX Yeongjin Jang, Sangho Lee, and Taesoo Kim Georgia Institute of Technology Kernel Address Space Layout Randomization (KASLR) A statistical

More information

Processes. Dr. Yingwu Zhu

Processes. Dr. Yingwu Zhu Processes Dr. Yingwu Zhu Process Growing Memory Stack expands automatically Data area (heap) can grow via a system call that requests more memory - malloc() in c/c++ Entering the kernel (mode) Hardware

More information

Assembly basics CS 2XA3. Term I, 2017/18

Assembly basics CS 2XA3. Term I, 2017/18 Assembly basics CS 2XA3 Term I, 2017/18 Outline What is Assembly Language? Assemblers NASM Program structure I/O First program Compiling Linking What is Assembly Language? In a high level language (HLL),

More information

Newbie s Guide to AVR Interrupts

Newbie s Guide to AVR Interrupts Newbie s Guide to AVR Interrupts Dean Camera March 15, 2015 ********** Text Dean Camera, 2013. All rights reserved. This document may be freely distributed without payment to the author, provided that

More information

ARM Cortex core microcontrollers

ARM Cortex core microcontrollers ARM Cortex core microcontrollers 2 nd Cortex-M3 core Balázs Scherer Budapest University of Technology and Economics Department of Measurement and Information Systems BME-MIT 2016 The Cortex-M3 core BME-MIT

More information

W4118: PC Hardware and x86. Junfeng Yang

W4118: PC Hardware and x86. Junfeng Yang W4118: PC Hardware and x86 Junfeng Yang A PC How to make it do something useful? 2 Outline PC organization x86 instruction set gcc calling conventions PC emulation 3 PC board 4 PC organization One or more

More information

Subverting the Linux Kernel Linux Kernel Rootkits 101

Subverting the Linux Kernel Linux Kernel Rootkits 101 Subverting the Linux Kernel Linux Kernel Rootkits 101 Kernel Rootkits? A collection of program(s) that hide an attacker's presence and activities on a compromised system Typically allows an attacker to

More information

The Kernel Abstraction. Chapter 2 OSPP Part I

The Kernel Abstraction. Chapter 2 OSPP Part I The Kernel Abstraction Chapter 2 OSPP Part I Kernel The software component that controls the hardware directly, and implements the core privileged OS functions. Modern hardware has features that allow

More information

Mechanisms for entering the system

Mechanisms for entering the system Mechanisms for entering the system Yolanda Becerra Fontal Juan José Costa Prats Facultat d'informàtica de Barcelona (FIB) Universitat Politècnica de Catalunya (UPC) BarcelonaTech 2017-2018 QP Content Introduction

More information

Operating Systems Synchronization and Signals

Operating Systems Synchronization and Signals OS162: Assignment 2 Operating Systems Synchronization and Signals TAs in charge Vadim Levit levitv@post.bgu.ac.il Benny Lutati bennyl@post.bgu.ac.il Due Date: 30.04.2016 1 Introduction The assignment main

More information

Timers 1 / 46. Jiffies. Potent and Evil Magic

Timers 1 / 46. Jiffies. Potent and Evil Magic Timers 1 / 46 Jiffies Each timer tick, a variable called jiffies is incremented It is thus (roughly) the number of HZ since system boot A 32-bit counter incremented at 1000 Hz wraps around in about 50

More information

Buffer overflow is still one of the most common vulnerabilities being discovered and exploited in commodity software.

Buffer overflow is still one of the most common vulnerabilities being discovered and exploited in commodity software. Outline Morris Worm (1998) Infamous attacks Secure Programming Lecture 4: Memory Corruption II (Stack Overflows) David Aspinall, Informatics @ Edinburgh 23rd January 2014 Recap Simple overflow exploit

More information

Operating Systems: Virtual Machines & Exceptions

Operating Systems: Virtual Machines & Exceptions Operating Systems: Machines & Exceptions Daniel Sanchez Computer Science & Artificial Intelligence Lab M.I.T. L19-1 6.004 So Far: Single-User Machines Program Hardware ISA (e.g., RISC-V) Processor Memory

More information

Traps and Faults. Review: Mode and Space

Traps and Faults. Review: Mode and Space Traps and Faults Review: Mode and Space A B C user mode data data kernel mode kernel space 1 Review: the Role of Events ACPUevent is an unnatural change in control flow. Like a procedure call, an event

More information

Our Simulation Equivalent: -- readmemb( "os.bin" ) -- PC <== x0200

Our Simulation Equivalent: -- readmemb( os.bin ) -- PC <== x0200 LC3 OS basics LC3 System Start-Up Assumptions We will write an OS for the LC3. What would a real LC3 do at start up? 1. BIOS execution --- PC points to BIOS (Basic IO System). --- POST: Test and initialize

More information

x86 architecture et similia

x86 architecture et similia x86 architecture et similia 1 FREELY INSPIRED FROM CLASS 6.828, MIT A full PC has: PC architecture 2 an x86 CPU with registers, execution unit, and memory management CPU chip pins include address and data

More information

CSC369 Lecture 2. Larry Zhang

CSC369 Lecture 2. Larry Zhang CSC369 Lecture 2 Larry Zhang 1 Announcements Lecture slides Midterm timing issue Assignment 1 will be out soon! Start early, and ask questions. We will have bonus for groups that finish early. 2 Assignment

More information

CSC369 Lecture 2. Larry Zhang, September 21, 2015

CSC369 Lecture 2. Larry Zhang, September 21, 2015 CSC369 Lecture 2 Larry Zhang, September 21, 2015 1 Volunteer note-taker needed by accessibility service see announcement on Piazza for details 2 Change to office hour to resolve conflict with CSC373 lecture

More information

System Wide Tracing User Need

System Wide Tracing User Need System Wide Tracing User Need dominique toupin ericsson com April 2010 About me Developer Tool Manager at Ericsson, helping Ericsson sites to develop better software efficiently Background

More information

Function Calls COS 217. Reading: Chapter 4 of Programming From the Ground Up (available online from the course Web site)

Function Calls COS 217. Reading: Chapter 4 of Programming From the Ground Up (available online from the course Web site) Function Calls COS 217 Reading: Chapter 4 of Programming From the Ground Up (available online from the course Web site) 1 Goals of Today s Lecture Finishing introduction to assembly language o EFLAGS register

More information

Lec 22: Interrupts. Kavita Bala CS 3410, Fall 2008 Computer Science Cornell University. Announcements

Lec 22: Interrupts. Kavita Bala CS 3410, Fall 2008 Computer Science Cornell University. Announcements Lec 22: Interrupts Kavita Bala CS 3410, Fall 2008 Computer Science Cornell University HW 3 HW4: due this Friday Announcements PA 3 out Nov 14 th Due Nov 25 th (feel free to turn it in early) Demos and

More information

Review: Program Execution. Memory program code program data program stack containing procedure activation records

Review: Program Execution. Memory program code program data program stack containing procedure activation records Threads and Concurrency 1 Review: Program Execution Registers program counter, stack pointer,... Memory program code program data program stack containing procedure activation records CPU fetches and executes

More information

Review: Program Execution. Memory program code program data program stack containing procedure activiation records

Review: Program Execution. Memory program code program data program stack containing procedure activiation records Threads and Concurrency 1 Review: Program Execution Registers program counter, stack pointer,... Memory program code program data program stack containing procedure activiation records CPU fetches and

More information

Mechanic v. Surgeon (photos from istockphoto.com)

Mechanic v. Surgeon (photos from istockphoto.com) 0 Mechanic v. Surgeon (photos from istockphoto.com) 1 2007: AIX Kernel hotpatch support available with AIX 6.1 2008: Ksplice Linux hotpatch support (based on MIT student s master s thesis) Stops all running

More information

Page 1. Last Time. Today. Embedded Compilers. Compiler Requirements. What We Get. What We Want

Page 1. Last Time. Today. Embedded Compilers. Compiler Requirements. What We Get. What We Want Last Time Today Low-level parts of the toolchain for embedded systems Linkers Programmers Booting an embedded CPU Debuggers JTAG Any weak link in the toolchain will hinder development Compilers: Expectations

More information

Smashing the Buffer. Miroslav Štampar

Smashing the Buffer. Miroslav Štampar Smashing the Buffer Miroslav Štampar (mstampar@zsis.hr) Summary BSidesVienna 2014, Vienna (Austria) November 22nd, 2014 2 Buffer overflow (a.k.a.) Buffer overrun An anomaly where a program, while writing

More information

19: I/O Devices: Clocks, Power Management

19: I/O Devices: Clocks, Power Management 19: I/O Devices: Clocks, Power Management Mark Handley Clock Hardware: A Programmable Clock Pulses Counter, decremented on each pulse Crystal Oscillator On zero, generate interrupt and reload from holding

More information

kguard++: Improving the Performance of kguard with Low-latency Code Inflation

kguard++: Improving the Performance of kguard with Low-latency Code Inflation kguard++: Improving the Performance of kguard with Low-latency Code Inflation Jordan P. Hendricks Brown University Abstract In this paper, we introduce low-latency code inflation for kguard, a GCC plugin

More information

Is stack overflow still a problem?

Is stack overflow still a problem? Morris Worm (1998) Code Red (2001) Secure Programming Lecture 4: Memory Corruption II (Stack Overflows) David Aspinall, Informatics @ Edinburgh 31st January 2017 Memory corruption Buffer overflow remains

More information

Hardware OS & OS- Application interface

Hardware OS & OS- Application interface CS 4410 Operating Systems Hardware OS & OS- Application interface Summer 2013 Cornell University 1 Today How my device becomes useful for the user? HW-OS interface Device controller Device driver Interrupts

More information

[537] Virtual Machines. Tyler Harter

[537] Virtual Machines. Tyler Harter [537] Virtual Machines Tyler Harter Outline Machine Virtualization Overview CPU Virtualization (Trap-and-Emulate) CPU Virtualization (Modern x86) Memory Virtualization Performance Challenges Outline Machine

More information

Threads and Concurrency

Threads and Concurrency Threads and Concurrency 1 Threads and Concurrency key concepts threads, concurrent execution, timesharing, context switch, interrupts, preemption reading Three Easy Pieces: Chapter 26 (Concurrency and

More information

CPU Structure and Function

CPU Structure and Function CPU Structure and Function Chapter 12 Lesson 17 Slide 1/36 Processor Organization CPU must: Fetch instructions Interpret instructions Fetch data Process data Write data Lesson 17 Slide 2/36 CPU With Systems

More information

Return-orientated Programming

Return-orientated Programming Return-orientated Programming or The Geometry of Innocent Flesh on the Bone: Return-into-libc without Function Calls (on the x86) Hovav Shacham, CCS '07 Return-Oriented oriented Programming programming

More information

Anne Bracy CS 3410 Computer Science Cornell University

Anne Bracy CS 3410 Computer Science Cornell University Anne Bracy CS 3410 Computer Science Cornell University The slides are the product of many rounds of teaching CS 3410 by Professors Weatherspoon, Bala, Bracy, McKee, and Sirer. See P&H 2.8 and 2.12, and

More information

CMSC 313 COMPUTER ORGANIZATION & ASSEMBLY LANGUAGE PROGRAMMING LECTURE 09, SPRING 2013

CMSC 313 COMPUTER ORGANIZATION & ASSEMBLY LANGUAGE PROGRAMMING LECTURE 09, SPRING 2013 CMSC 313 COMPUTER ORGANIZATION & ASSEMBLY LANGUAGE PROGRAMMING LECTURE 09, SPRING 2013 TOPICS TODAY I/O Architectures Interrupts Exceptions FETCH EXECUTE CYCLE 1.7 The von Neumann Model This is a general

More information

Review: Program Execution. Memory program code program data program stack containing procedure activation records

Review: Program Execution. Memory program code program data program stack containing procedure activation records Threads and Concurrency 1 Review: Program Execution Registers program counter, stack pointer,... Memory program code program data program stack containing procedure activation records CPU fetches and executes

More information

Threads and Concurrency

Threads and Concurrency Threads and Concurrency 1 Threads and Concurrency key concepts threads, concurrent execution, timesharing, context switch, interrupts, preemption reading Three Easy Pieces: Chapter 26 (Concurrency and

More information

RAS Enhancement Activities for Mission-Critical Linux Systems

RAS Enhancement Activities for Mission-Critical Linux Systems RAS Enhancement Activities for MissionCritical Linux Systems Hitachi Ltd. Yoshihiro YUNOMAE 01 MissionCritical Systems We apply Linux to missioncritical systems. Banking systems/carrier backend systems/train

More information

ECE 598 Advanced Operating Systems Lecture 10

ECE 598 Advanced Operating Systems Lecture 10 ECE 598 Advanced Operating Systems Lecture 10 Vince Weaver http://web.eece.maine.edu/~vweaver vincent.weaver@maine.edu 22 February 2018 Announcements Homework #5 will be posted 1 Blocking vs Nonblocking

More information

Processes (Intro) Yannis Smaragdakis, U. Athens

Processes (Intro) Yannis Smaragdakis, U. Athens Processes (Intro) Yannis Smaragdakis, U. Athens Process: CPU Virtualization Process = Program, instantiated has memory, code, current state What kind of memory do we have? registers + address space Let's

More information

by Marina Cholakyan, Hyduke Noshadi, Sepehr Sahba and Young Cha

by Marina Cholakyan, Hyduke Noshadi, Sepehr Sahba and Young Cha CS 111 Scribe Notes for 4/11/05 by Marina Cholakyan, Hyduke Noshadi, Sepehr Sahba and Young Cha Processes What is a process? A process is a running instance of a program. The Web browser you're using to

More information

CS 31: Intro to Systems Processes. Kevin Webb Swarthmore College March 31, 2016

CS 31: Intro to Systems Processes. Kevin Webb Swarthmore College March 31, 2016 CS 31: Intro to Systems Processes Kevin Webb Swarthmore College March 31, 2016 Reading Quiz Anatomy of a Process Abstraction of a running program a dynamic program in execution OS keeps track of process

More information

Overview. This Lecture. Interrupts and exceptions Source: ULK ch 4, ELDD ch1, ch2 & ch4. COSC440 Lecture 3: Interrupts 1

Overview. This Lecture. Interrupts and exceptions Source: ULK ch 4, ELDD ch1, ch2 & ch4. COSC440 Lecture 3: Interrupts 1 This Lecture Overview Interrupts and exceptions Source: ULK ch 4, ELDD ch1, ch2 & ch4 COSC440 Lecture 3: Interrupts 1 Three reasons for interrupts System calls Program/hardware faults External device interrupts

More information

Anne Bracy CS 3410 Computer Science Cornell University

Anne Bracy CS 3410 Computer Science Cornell University Anne Bracy CS 3410 Computer Science Cornell University The slides were originally created by Deniz ALTINBUKEN. P&H Chapter 4.9, pages 445 452, appendix A.7 Manages all of the software and hardware on the

More information

CNIT 127: Exploit Development. Ch 3: Shellcode. Updated

CNIT 127: Exploit Development. Ch 3: Shellcode. Updated CNIT 127: Exploit Development Ch 3: Shellcode Updated 1-30-17 Topics Protection rings Syscalls Shellcode nasm Assembler ld GNU Linker objdump to see contents of object files strace System Call Tracer Removing

More information

Virtual Memory Paging

Virtual Memory Paging Virtual Memory Paging An important task of a virtual-memory system is to relocate pages from physical memory out to disk Early UNIX systems swapped out the entire process at once Modern UNIX systems relay

More information

The OS and Multitasking: An Example

The OS and Multitasking: An Example The OS and Multitasking: An Example ENEE 446: Digital Computer Design, Spring 2006 Prof. Bruce Jacob The diagram to the right illustrates the simplistic view of what goes on in a typical UTIL UTIL system.

More information

Anne Bracy CS 3410 Computer Science Cornell University

Anne Bracy CS 3410 Computer Science Cornell University Anne Bracy CS 3410 Computer Science Cornell University The slides are the product of many rounds of teaching CS 3410 by Professors Weatherspoon, Bala, Bracy, McKee, and Sirer. compute jump/branch targets

More information

Protection. OS central role. Fundamental to other OS goals. OS kernel. isolation of misbehaving applications. Relaibility Security Privacy fairness

Protection. OS central role. Fundamental to other OS goals. OS kernel. isolation of misbehaving applications. Relaibility Security Privacy fairness Protection OS central role isolation of misbehaving applications Fundamental to other OS goals Relaibility Security Privacy fairness OS kernel implements protection lowest level SW runnig on the syste

More information

Operating Systems Engineering Recitation #3 (part 2): Interrupt and Exception Handling on the x86. (heavily) based on MIT 6.

Operating Systems Engineering Recitation #3 (part 2): Interrupt and Exception Handling on the x86. (heavily) based on MIT 6. 236366 Operating Systems Engineering Recitation #3 (part 2): Interrupt and Exception Handling on the x86 (heavily) based on MIT 6.828 (2005, lec8) x86 Interrupt Nomenclature Hardware Interrupt (external)

More information

CS 550 Operating Systems Spring Interrupt

CS 550 Operating Systems Spring Interrupt CS 550 Operating Systems Spring 2019 Interrupt 1 Revisit -- Process MAX Stack Function Call Arguments, Return Address, Return Values Kernel data segment Kernel text segment Stack fork() exec() Heap Data

More information

How to hold onto things in a multiprocessor world

How to hold onto things in a multiprocessor world How to hold onto things in a multiprocessor world Taylor Riastradh Campbell campbell@mumble.net riastradh@netbsd.org AsiaBSDcon 2017 Tokyo, Japan March 12, 2017 Slides n code Full of code! Please browse

More information

CS333 Project 1 Test Report Your Name Here

CS333 Project 1 Test Report Your Name Here To obtain the L A TEX source for this document, change the file extension to.tex in the url. Testing Aside: Each student will need to provide their own screen shots or other test output as well as the

More information

ECE 471 Embedded Systems Lecture 8

ECE 471 Embedded Systems Lecture 8 ECE 471 Embedded Systems Lecture 8 Vince Weaver http://web.eece.maine.edu/~vweaver vincent.weaver@maine.edu 21 September 2018 Announcements HW#2 was due HW#3 will be posted today. Work in groups? Note

More information

CS 5460/6460 Operating Systems

CS 5460/6460 Operating Systems CS 5460/6460 Operating Systems Fall 2009 Instructor: Matthew Flatt Lecturer: Kevin Tew TAs: Bigyan Mukherjee, Amrish Kapoor 1 Join the Mailing List! Reminders Make sure you can log into the CADE machines

More information

Chapter 8: Main Memory

Chapter 8: Main Memory Chapter 8: Main Memory Chapter 8: Memory Management Background Swapping Contiguous Memory Allocation Segmentation Paging Structure of the Page Table Example: The Intel 32 and 64-bit Architectures Example:

More information

CMSC 412 Project #3 Threads & Synchronization Due March 17 th, 2017, at 5:00pm

CMSC 412 Project #3 Threads & Synchronization Due March 17 th, 2017, at 5:00pm CMSC 412 Project #3 Threads & Synchronization Due March 17 th, 2017, at 5:00pm Overview User level threads. You will implement user level threads where each thread has it s own stack, but shares the program,

More information

CSE 451 Autumn Final Solutions mean 77.53, median 79, stdev 12.03

CSE 451 Autumn Final Solutions mean 77.53, median 79, stdev 12.03 CSE 451 Autumn 2016 Final Solutions 15 10 5 0 0 10 20 30 40 50 60 70 80 90 100 mean 77.53, median 79, stdev 12.03 I. Warm-up (a) (15 points) Circle true or false for each statement (no need to justify

More information