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
PPTX
Making a Process (Virtualizing Memory)
PPTX
Microkernels and Beyond
PPTX
Flash! (Modern File Systems)
PPTX
The Internet
PPTX
Segmentation Faults, Page Faults, Processes, Threads, and Tasks
PPTX
Once Upon a Process
PPTX
Scheduling in Linux and Web Servers
Storage
Making a Process (Virtualizing Memory)
Microkernels and Beyond
Flash! (Modern File Systems)
The Internet
Segmentation Faults, Page Faults, Processes, Threads, and Tasks
Once Upon a Process
Scheduling in Linux and Web Servers

What's hot (20)

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

Similar to Gash Has No Privileges (20)

PPSX
Cpu 64x architecture
PPTX
Linux internals v4
PPTX
Lect 1_Embedded Linux Embedded RTOS ppt
PPTX
10. compute-part-1
PDF
The Quest for the Perfect API
PDF
Linux Locking Mechanisms
PDF
XPDDS17: Reworking the ARM GIC Emulation & Xen Challenges in the ARM ITS Emu...
PPTX
Protection mode
PPTX
CO&AL-lecture-04 about the procedures in c language (1).pptx
PDF
Virtualization Basics
PDF
Exploiting Modern Microarchitectures: Meltdown, Spectre, and other Attacks
PPT
Windows 3.1 (WFW) on vintage and modern hardware
PPTX
Io sy.stemppt
PDF
Buiding a better Userspace - The current and future state of QEMU and KVM int...
PPTX
gpu1 - Modern Systems GPU Introduction.pptx
PPS
Sioux Hot-or-Not: The future of Linux (Alan Cox)
PDF
Windows internals Essentials
PPTX
Operating systems (For CBSE School Students)
PDF
Embedded Linux Evolution | Turing Techtalk
Cpu 64x architecture
Linux internals v4
Lect 1_Embedded Linux Embedded RTOS ppt
10. compute-part-1
The Quest for the Perfect API
Linux Locking Mechanisms
XPDDS17: Reworking the ARM GIC Emulation & Xen Challenges in the ARM ITS Emu...
Protection mode
CO&AL-lecture-04 about the procedures in c language (1).pptx
Virtualization Basics
Exploiting Modern Microarchitectures: Meltdown, Spectre, and other Attacks
Windows 3.1 (WFW) on vintage and modern hardware
Io sy.stemppt
Buiding a better Userspace - The current and future state of QEMU and KVM int...
gpu1 - Modern Systems GPU Introduction.pptx
Sioux Hot-or-Not: The future of Linux (Alan Cox)
Windows internals Essentials
Operating systems (For CBSE School Students)
Embedded Linux Evolution | Turing Techtalk
Ad

More from David Evans (20)

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

Recently uploaded (20)

PDF
Τίμαιος είναι φιλοσοφικός διάλογος του Πλάτωνα
PDF
Paper A Mock Exam 9_ Attempt review.pdf.
PDF
Chinmaya Tiranga quiz Grand Finale.pdf
PDF
1.3 FINAL REVISED K-10 PE and Health CG 2023 Grades 4-10 (1).pdf
PDF
Empowerment Technology for Senior High School Guide
PDF
A GUIDE TO GENETICS FOR UNDERGRADUATE MEDICAL STUDENTS
PPTX
B.Sc. DS Unit 2 Software Engineering.pptx
PDF
FOISHS ANNUAL IMPLEMENTATION PLAN 2025.pdf
PPTX
History, Philosophy and sociology of education (1).pptx
PDF
Hazard Identification & Risk Assessment .pdf
PDF
IGGE1 Understanding the Self1234567891011
PPTX
Onco Emergencies - Spinal cord compression Superior vena cava syndrome Febr...
PDF
What if we spent less time fighting change, and more time building what’s rig...
PPTX
TNA_Presentation-1-Final(SAVE)) (1).pptx
PDF
AI-driven educational solutions for real-life interventions in the Philippine...
PDF
advance database management system book.pdf
PDF
RTP_AR_KS1_Tutor's Guide_English [FOR REPRODUCTION].pdf
PPTX
Chinmaya Tiranga Azadi Quiz (Class 7-8 )
PDF
Indian roads congress 037 - 2012 Flexible pavement
PDF
Weekly quiz Compilation Jan -July 25.pdf
Τίμαιος είναι φιλοσοφικός διάλογος του Πλάτωνα
Paper A Mock Exam 9_ Attempt review.pdf.
Chinmaya Tiranga quiz Grand Finale.pdf
1.3 FINAL REVISED K-10 PE and Health CG 2023 Grades 4-10 (1).pdf
Empowerment Technology for Senior High School Guide
A GUIDE TO GENETICS FOR UNDERGRADUATE MEDICAL STUDENTS
B.Sc. DS Unit 2 Software Engineering.pptx
FOISHS ANNUAL IMPLEMENTATION PLAN 2025.pdf
History, Philosophy and sociology of education (1).pptx
Hazard Identification & Risk Assessment .pdf
IGGE1 Understanding the Self1234567891011
Onco Emergencies - Spinal cord compression Superior vena cava syndrome Febr...
What if we spent less time fighting change, and more time building what’s rig...
TNA_Presentation-1-Final(SAVE)) (1).pptx
AI-driven educational solutions for real-life interventions in the Philippine...
advance database management system book.pdf
RTP_AR_KS1_Tutor's Guide_English [FOR REPRODUCTION].pdf
Chinmaya Tiranga Azadi Quiz (Class 7-8 )
Indian roads congress 037 - 2012 Flexible pavement
Weekly quiz Compilation Jan -July 25.pdf

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