SlideShare a Scribd company logo
Gash Has No Privileges
Plan for Today
Kernel Privileges
How VirtualBox Really Works
Browser Processes
Demo PS2
Shell, Pipes, Redirects
1
Kernel Privileges
What can the kernel
(supervisor) do that
user-level programs
cannot?

2
Kernel Privileges
What can the kernel
(supervisor) do that
user-level programs
cannot?

1. Handle interrupts
2. Execute privileged
instructions

What instructions are privileged?
3
4
5
GDT: Global Descriptor Table
LDT: Local Descriptor Table
Control memory segments

MOV (control registers)
What is in control registers (CR0)?

6
7
8
9
x86
Protection
Rings

Ring 3
Rings 1 and 2:
device drivers

Ring 0
There’s nothing magic here:
just 2 bits in a register that
determine what instructions
can execute!
10
Kernel Privileges
What can the kernel
(supervisor) do that
user-level programs
cannot?

1. Handle interrupts
2. Execute privileged
instructions

What happens when a user-level program attempts a privileged instruction?
11
12
Ubuntu

Windows

Windows
Mac OS X
13
“Trap-and-Emulate”
Early Virtual Machines (1960-2005)
1. Guest OS (running at user-level) attempts
privileged instruction
2. Traps to host OS
3. Host OS trap handler switches to
virtualization program (VMM)
4. VMM emulates privileged instruction in
virtual environment
SOSP 1973
14
Hardware-Assisted Virtualization
VT-x (Intel) and AMD-V (2005/2006)

vmrun
Enter “Guest mode”
Hardware-support for data structures for VM
exit
Return to “Host mode”
Saves guest state in hardware data structures

15
How many processes should a
browser create?

Challenge for PS2 Exercise 1: what is the fewest number
of processes you can have running on your machine?
16
1990’s answer: 1
processes waste
memory and CPU
which are expensive
and limited
17
2000s answer:

http://www.google.com/googlebooks/chrome/
18
19
20
21
What should the
2010s answer be?

22
Apple iPhone 5C

Five colors, 2 cores!

Samsung Galaxy S4
Only two colors, but 4-8 cores!
(+ loads of GPU cores)
Note: the colors vs. cores tradeoff can probably be overcome by good
engineering, but addressing the energy vs. cores tradeoffs require some theoretical
advances also.

23
Humans should not
be getting bored and
grumpy waiting for
their browser to
render a page while
cores are sitting idle!

24
“Start from Scratch” but
constrained by using
programming tools
developed in the 1960s
25
2010s answer:
A modern browser should have enough
threads to efficiently use all the machine
resources available to provide human users
with a good browsing experience!

26
Unfortunately, it is not
(humanly) possible to build
such a browser (in a way
that will also be secure,
robust, and reliable) using
languages whose primary
design goal was to fit on a
4K machine.

27
Why do Rust
stickers have
gears on them?
Servo: the main reason
Rust is being developed is
so Mozilla can build a
better browser!
28
Really starting from
scratch is really hard…
this is why getting
Servo to the point
where it can render a
static page is cakeworthy!

29
PS2: The Good Auld SHell
gash>
gash>
gash>
gash>
gash>
gash>

echo ‘Wha-hoo-wa!’
!!
traceroute 128.143.22.36
id -p ray
!!
fsck; !mount -u VA!
30
31
Charge
Get started on PS2
You must work with one
other person

If you don’t have a
teammate, stay after
class and find one!

Examine the processes running on your
computer, have fun killing them (but backup your
work first!)
32

More Related Content

PPTX
Storage
David Evans
 
PPTX
Making a Process (Virtualizing Memory)
David Evans
 
PPTX
Microkernels and Beyond
David Evans
 
PPTX
Flash! (Modern File Systems)
David Evans
 
PPTX
The Internet
David Evans
 
PPTX
Segmentation Faults, Page Faults, Processes, Threads, and Tasks
David Evans
 
PPTX
Once Upon a Process
David Evans
 
PPTX
Scheduling in Linux and Web Servers
David Evans
 
Storage
David Evans
 
Making a Process (Virtualizing Memory)
David Evans
 
Microkernels and Beyond
David Evans
 
Flash! (Modern File Systems)
David Evans
 
The Internet
David Evans
 
Segmentation Faults, Page Faults, Processes, Threads, and Tasks
David Evans
 
Once Upon a Process
David Evans
 
Scheduling in Linux and Web Servers
David Evans
 

What's hot (20)

PDF
USENIX ATC 2017 Performance Superpowers with Enhanced BPF
Brendan Gregg
 
PPTX
Mutual Exclusion
David Evans
 
PDF
Kernel Recipes 2017: Performance Analysis with BPF
Brendan Gregg
 
PDF
Performance Wins with BPF: Getting Started
Brendan Gregg
 
PDF
Kernel Recipes 2015 - Porting Linux to a new processor architecture
Anne Nicolas
 
PDF
Systems@Scale 2021 BPF Performance Getting Started
Brendan Gregg
 
PDF
bcc/BPF tools - Strategy, current tools, future challenges
IO Visor Project
 
PDF
Linux kernel-rootkit-dev - Wonokaerun
idsecconf
 
PDF
Linux Tracing Superpowers by Eugene Pirogov
Pivorak MeetUp
 
PDF
LSFMM 2019 BPF Observability
Brendan Gregg
 
PDF
Introduction to eBPF and XDP
lcplcp1
 
PDF
Security Monitoring with eBPF
Alex Maestretti
 
PDF
OSSNA 2017 Performance Analysis Superpowers with Linux BPF
Brendan Gregg
 
PDF
Blazing Performance with Flame Graphs
Brendan Gregg
 
PPTX
Virtual Memory (Making a Process)
David Evans
 
PDF
Kernel Recipes 2019 - Formal modeling made easy
Anne Nicolas
 
PDF
ZFSperftools2012
Brendan Gregg
 
PDF
NetConf 2018 BPF Observability
Brendan Gregg
 
PDF
Spying on the Linux kernel for fun and profit
Andrea Righi
 
PDF
BPF: Tracing and more
Brendan Gregg
 
USENIX ATC 2017 Performance Superpowers with Enhanced BPF
Brendan Gregg
 
Mutual Exclusion
David Evans
 
Kernel Recipes 2017: Performance Analysis with BPF
Brendan Gregg
 
Performance Wins with BPF: Getting Started
Brendan Gregg
 
Kernel Recipes 2015 - Porting Linux to a new processor architecture
Anne Nicolas
 
Systems@Scale 2021 BPF Performance Getting Started
Brendan Gregg
 
bcc/BPF tools - Strategy, current tools, future challenges
IO Visor Project
 
Linux kernel-rootkit-dev - Wonokaerun
idsecconf
 
Linux Tracing Superpowers by Eugene Pirogov
Pivorak MeetUp
 
LSFMM 2019 BPF Observability
Brendan Gregg
 
Introduction to eBPF and XDP
lcplcp1
 
Security Monitoring with eBPF
Alex Maestretti
 
OSSNA 2017 Performance Analysis Superpowers with Linux BPF
Brendan Gregg
 
Blazing Performance with Flame Graphs
Brendan Gregg
 
Virtual Memory (Making a Process)
David Evans
 
Kernel Recipes 2019 - Formal modeling made easy
Anne Nicolas
 
ZFSperftools2012
Brendan Gregg
 
NetConf 2018 BPF Observability
Brendan Gregg
 
Spying on the Linux kernel for fun and profit
Andrea Righi
 
BPF: Tracing and more
Brendan Gregg
 
Ad

Similar to Gash Has No Privileges (20)

PPSX
Cpu 64x architecture
AmmAr mobark
 
PPTX
Linux internals v4
Liran Ben Haim
 
PPTX
Lect 1_Embedded Linux Embedded RTOS ppt
Varsha506533
 
PPTX
10. compute-part-1
Muhammad Ahad
 
PDF
The Quest for the Perfect API
microkerneldude
 
PDF
Linux Locking Mechanisms
Kernel TLV
 
PDF
XPDDS17: Reworking the ARM GIC Emulation & Xen Challenges in the ARM ITS Emu...
The Linux Foundation
 
PPTX
Protection mode
Deepak Kumar
 
PPTX
CO&AL-lecture-04 about the procedures in c language (1).pptx
gagarwazir7
 
PDF
Virtualization Basics
SrikantMishra12
 
PDF
Exploiting Modern Microarchitectures: Meltdown, Spectre, and other Attacks
inside-BigData.com
 
PPT
Windows 3.1 (WFW) on vintage and modern hardware
yeokm1
 
PPTX
Io sy.stemppt
muthumani mahesh
 
PDF
Buiding a better Userspace - The current and future state of QEMU and KVM int...
aliguori
 
PPTX
gpu1 - Modern Systems GPU Introduction.pptx
s1401121
 
PPS
Sioux Hot-or-Not: The future of Linux (Alan Cox)
siouxhotornot
 
PDF
Windows internals Essentials
John Ombagi
 
PPTX
Operating systems (For CBSE School Students)
Gaurav Aggarwal
 
PDF
Embedded Linux Evolution | Turing Techtalk
Persistent Systems Ltd.
 
Cpu 64x architecture
AmmAr mobark
 
Linux internals v4
Liran Ben Haim
 
Lect 1_Embedded Linux Embedded RTOS ppt
Varsha506533
 
10. compute-part-1
Muhammad Ahad
 
The Quest for the Perfect API
microkerneldude
 
Linux Locking Mechanisms
Kernel TLV
 
XPDDS17: Reworking the ARM GIC Emulation & Xen Challenges in the ARM ITS Emu...
The Linux Foundation
 
Protection mode
Deepak Kumar
 
CO&AL-lecture-04 about the procedures in c language (1).pptx
gagarwazir7
 
Virtualization Basics
SrikantMishra12
 
Exploiting Modern Microarchitectures: Meltdown, Spectre, and other Attacks
inside-BigData.com
 
Windows 3.1 (WFW) on vintage and modern hardware
yeokm1
 
Io sy.stemppt
muthumani mahesh
 
Buiding a better Userspace - The current and future state of QEMU and KVM int...
aliguori
 
gpu1 - Modern Systems GPU Introduction.pptx
s1401121
 
Sioux Hot-or-Not: The future of Linux (Alan Cox)
siouxhotornot
 
Windows internals Essentials
John Ombagi
 
Operating systems (For CBSE School Students)
Gaurav Aggarwal
 
Embedded Linux Evolution | Turing Techtalk
Persistent Systems Ltd.
 
Ad

More from David Evans (20)

PPTX
Cryptocurrency Jeopardy!
David Evans
 
PPTX
Trick or Treat?: Bitcoin for Non-Believers, Cryptocurrencies for Cypherpunks
David Evans
 
PPTX
Hidden Services, Zero Knowledge
David Evans
 
PPTX
Anonymity in Bitcoin
David Evans
 
PPTX
Midterm Confirmations
David Evans
 
PPTX
Scripting Transactions
David Evans
 
PPTX
How to Live in Paradise
David Evans
 
PPTX
Bitcoin Script
David Evans
 
PPTX
Mining Economics
David Evans
 
PPTX
Mining
David Evans
 
PPTX
The Blockchain
David Evans
 
PPTX
Becoming More Paranoid
David Evans
 
PPTX
Asymmetric Key Signatures
David Evans
 
PPTX
Introduction to Cryptography
David Evans
 
PPTX
Class 1: What is Money?
David Evans
 
PPTX
Multi-Party Computation for the Masses
David Evans
 
PPTX
Proof of Reserve
David Evans
 
PPTX
Silk Road
David Evans
 
PPTX
Blooming Sidechains!
David Evans
 
PPTX
Useful Proofs of Work, Permacoin
David Evans
 
Cryptocurrency Jeopardy!
David Evans
 
Trick or Treat?: Bitcoin for Non-Believers, Cryptocurrencies for Cypherpunks
David Evans
 
Hidden Services, Zero Knowledge
David Evans
 
Anonymity in Bitcoin
David Evans
 
Midterm Confirmations
David Evans
 
Scripting Transactions
David Evans
 
How to Live in Paradise
David Evans
 
Bitcoin Script
David Evans
 
Mining Economics
David Evans
 
Mining
David Evans
 
The Blockchain
David Evans
 
Becoming More Paranoid
David Evans
 
Asymmetric Key Signatures
David Evans
 
Introduction to Cryptography
David Evans
 
Class 1: What is Money?
David Evans
 
Multi-Party Computation for the Masses
David Evans
 
Proof of Reserve
David Evans
 
Silk Road
David Evans
 
Blooming Sidechains!
David Evans
 
Useful Proofs of Work, Permacoin
David Evans
 

Recently uploaded (20)

PPTX
Introduction to pediatric nursing in 5th Sem..pptx
AneetaSharma15
 
PPTX
Command Palatte in Odoo 18.1 Spreadsheet - Odoo Slides
Celine George
 
DOCX
Unit 5: Speech-language and swallowing disorders
JELLA VISHNU DURGA PRASAD
 
PPTX
How to Track Skills & Contracts Using Odoo 18 Employee
Celine George
 
PPTX
Cleaning Validation Ppt Pharmaceutical validation
Ms. Ashatai Patil
 
PDF
BÀI TẬP TEST BỔ TRỢ THEO TỪNG CHỦ ĐỀ CỦA TỪNG UNIT KÈM BÀI TẬP NGHE - TIẾNG A...
Nguyen Thanh Tu Collection
 
PPTX
Tips Management in Odoo 18 POS - Odoo Slides
Celine George
 
PPTX
How to Apply for a Job From Odoo 18 Website
Celine George
 
PPTX
Artificial Intelligence in Gastroentrology: Advancements and Future Presprec...
AyanHossain
 
PPTX
Kanban Cards _ Mass Action in Odoo 18.2 - Odoo Slides
Celine George
 
PDF
Antianginal agents, Definition, Classification, MOA.pdf
Prerana Jadhav
 
PPTX
Information Texts_Infographic on Forgetting Curve.pptx
Tata Sevilla
 
DOCX
Modul Ajar Deep Learning Bahasa Inggris Kelas 11 Terbaru 2025
wahyurestu63
 
PPTX
BASICS IN COMPUTER APPLICATIONS - UNIT I
suganthim28
 
PDF
The-Invisible-Living-World-Beyond-Our-Naked-Eye chapter 2.pdf/8th science cur...
Sandeep Swamy
 
PPTX
Care of patients with elImination deviation.pptx
AneetaSharma15
 
PPTX
A Smarter Way to Think About Choosing a College
Cyndy McDonald
 
PPTX
Continental Accounting in Odoo 18 - Odoo Slides
Celine George
 
PPTX
How to Close Subscription in Odoo 18 - Odoo Slides
Celine George
 
PPTX
20250924 Navigating the Future: How to tell the difference between an emergen...
McGuinness Institute
 
Introduction to pediatric nursing in 5th Sem..pptx
AneetaSharma15
 
Command Palatte in Odoo 18.1 Spreadsheet - Odoo Slides
Celine George
 
Unit 5: Speech-language and swallowing disorders
JELLA VISHNU DURGA PRASAD
 
How to Track Skills & Contracts Using Odoo 18 Employee
Celine George
 
Cleaning Validation Ppt Pharmaceutical validation
Ms. Ashatai Patil
 
BÀI TẬP TEST BỔ TRỢ THEO TỪNG CHỦ ĐỀ CỦA TỪNG UNIT KÈM BÀI TẬP NGHE - TIẾNG A...
Nguyen Thanh Tu Collection
 
Tips Management in Odoo 18 POS - Odoo Slides
Celine George
 
How to Apply for a Job From Odoo 18 Website
Celine George
 
Artificial Intelligence in Gastroentrology: Advancements and Future Presprec...
AyanHossain
 
Kanban Cards _ Mass Action in Odoo 18.2 - Odoo Slides
Celine George
 
Antianginal agents, Definition, Classification, MOA.pdf
Prerana Jadhav
 
Information Texts_Infographic on Forgetting Curve.pptx
Tata Sevilla
 
Modul Ajar Deep Learning Bahasa Inggris Kelas 11 Terbaru 2025
wahyurestu63
 
BASICS IN COMPUTER APPLICATIONS - UNIT I
suganthim28
 
The-Invisible-Living-World-Beyond-Our-Naked-Eye chapter 2.pdf/8th science cur...
Sandeep Swamy
 
Care of patients with elImination deviation.pptx
AneetaSharma15
 
A Smarter Way to Think About Choosing a College
Cyndy McDonald
 
Continental Accounting in Odoo 18 - Odoo Slides
Celine George
 
How to Close Subscription in Odoo 18 - Odoo Slides
Celine George
 
20250924 Navigating the Future: How to tell the difference between an emergen...
McGuinness Institute
 

Gash Has No Privileges

  • 2. Plan for Today Kernel Privileges How VirtualBox Really Works Browser Processes Demo PS2 Shell, Pipes, Redirects 1
  • 3. Kernel Privileges What can the kernel (supervisor) do that user-level programs cannot? 2
  • 4. Kernel Privileges What can the kernel (supervisor) do that user-level programs cannot? 1. Handle interrupts 2. Execute privileged instructions What instructions are privileged? 3
  • 5. 4
  • 6. 5
  • 7. GDT: Global Descriptor Table LDT: Local Descriptor Table Control memory segments MOV (control registers) What is in control registers (CR0)? 6
  • 8. 7
  • 9. 8
  • 10. 9
  • 11. x86 Protection Rings Ring 3 Rings 1 and 2: device drivers Ring 0 There’s nothing magic here: just 2 bits in a register that determine what instructions can execute! 10
  • 12. Kernel Privileges What can the kernel (supervisor) do that user-level programs cannot? 1. Handle interrupts 2. Execute privileged instructions What happens when a user-level program attempts a privileged instruction? 11
  • 13. 12
  • 15. “Trap-and-Emulate” Early Virtual Machines (1960-2005) 1. Guest OS (running at user-level) attempts privileged instruction 2. Traps to host OS 3. Host OS trap handler switches to virtualization program (VMM) 4. VMM emulates privileged instruction in virtual environment SOSP 1973 14
  • 16. Hardware-Assisted Virtualization VT-x (Intel) and AMD-V (2005/2006) vmrun Enter “Guest mode” Hardware-support for data structures for VM exit Return to “Host mode” Saves guest state in hardware data structures 15
  • 17. How many processes should a browser create? Challenge for PS2 Exercise 1: what is the fewest number of processes you can have running on your machine? 16
  • 18. 1990’s answer: 1 processes waste memory and CPU which are expensive and limited 17
  • 20. 19
  • 21. 20
  • 22. 21
  • 23. What should the 2010s answer be? 22
  • 24. Apple iPhone 5C Five colors, 2 cores! Samsung Galaxy S4 Only two colors, but 4-8 cores! (+ loads of GPU cores) Note: the colors vs. cores tradeoff can probably be overcome by good engineering, but addressing the energy vs. cores tradeoffs require some theoretical advances also. 23
  • 25. Humans should not be getting bored and grumpy waiting for their browser to render a page while cores are sitting idle! 24
  • 26. “Start from Scratch” but constrained by using programming tools developed in the 1960s 25
  • 27. 2010s answer: A modern browser should have enough threads to efficiently use all the machine resources available to provide human users with a good browsing experience! 26
  • 28. Unfortunately, it is not (humanly) possible to build such a browser (in a way that will also be secure, robust, and reliable) using languages whose primary design goal was to fit on a 4K machine. 27
  • 29. Why do Rust stickers have gears on them? Servo: the main reason Rust is being developed is so Mozilla can build a better browser! 28
  • 30. Really starting from scratch is really hard… this is why getting Servo to the point where it can render a static page is cakeworthy! 29
  • 31. PS2: The Good Auld SHell gash> gash> gash> gash> gash> gash> echo ‘Wha-hoo-wa!’ !! traceroute 128.143.22.36 id -p ray !! fsck; !mount -u VA! 30
  • 32. 31
  • 33. Charge Get started on PS2 You must work with one other person If you don’t have a teammate, stay after class and find one! Examine the processes running on your computer, have fun killing them (but backup your work first!) 32