Time to retire Linux (and C) in IoT
Lin Zhong http://www.recg.org
Time to retire Linux (and C) in IoT Lin Zhong http://www.recg.org - - PowerPoint PPT Presentation
Time to retire Linux (and C) in IoT Lin Zhong http://www.recg.org By analyzing the problems of Linux, create a software systems research agenda for secure, efficient IoT devices. 2 Our mission better computers http://www.recg.org BIG World
Lin Zhong http://www.recg.org
2
http://www.recg.org
4
World first massive MIMO system prototype
5
Mobile & embedded software systems & hardware
6
7
8
9
10
April 2014
13
14
15
16
Four botnets generated 10 DDoS attacks exceeding 300 Gbps between July 2014 and December
July 14 321 July 14 312
309
337 June 16 363
623
555 517
300
306 Mirai BillGates Kaiten XOR Spike
Security Spotlight: Internet of Things and the Rise of 300 Gbps DDoS Attacks
Source: akamai
Security Spotlight: Internet of Things and the Rise of 300 Gbps DDoS Attacks
Source: akamai
A rapid increase in scans of port 23 and 2323 began on May 13, 2016 as the Mirai botnet attempted to log into unsecure IoT devices.
Feb. Mar. Apr. May June July Aug. Sep. Oct. Nov. 1M 1.5M 2M 2.5M 500K Source IP Count Kaiten botnet discovered First major Mirai attack DYN DNS attack
19
safety
20
for concurrency
Chen et al APSys 2011
Vulnerability
Policy violation DoS
Misc. Missing pointer check 6 1 2 Missing permission check 15 3 1 Buffer overflow 13 1 1 2 Integer overflow 12 5 3 Uninitialized data 1 28 Null dereference 20 Divide by zero 4 Infinite loop 3 Data race / deadlock 1 7 Memory mismanagement 10 Miscellaneous 5 2 1 Total 32 16 60 37 2
22
Linus Towalds, 2007
Introduced by Robin Seggelmann in 2011, code reviewed by Stephen Henson, into OpenSSL source code, 12/31/2011 Bug reported 04/01/2014
25
System-on-a-chip for IoT devices teeming with non-CPU devices
Drivers are the most buggy part of kernel
Christopher Biggs, “The Internet of Scary Things - tips to deploy and manage IoT safely”, 2017
Top ten attack origins on monitored IoT honeypot in 2016, by count of unique attackers (Source: Symantec)
31
XOR.DDos)
Bashlite)
LizardStresser)
Linux.Pinscan.B (aka PNScan)
(aka Tsunami)
Remainten, KTN-Remastered, KTN-RM)
Source: Symantec 2016 https://www.symantec.com/connect/blogs/iot-devices-being-increasingly-used-ddos-attacks
https://www.theregister.co.uk/2017/01/19/iot_will_get_worse_before_it_gets_better_dev_tells_linux_conference/
34
35
requires more complicated hardware
Figure 1. Architecture of the MT7687 Wi-Fi-enabled Microcontroller. With MediaTek’s assistance we modified and extended the MT7687. We made three changes to the MediaTek’s
Microcontroller Die
WiFi Subsystem CPU GPIO, etc. SRAM GPU MMU GPU MMU GPU MMU Flash Controller Flash Memory SHA, MD & AES Cryptographic Engines Hardware RNG Boot ROM PMU GPU MMU Interconnect Fabric
With MediaTek’s assistance we modified and extended the MT7687. We made three changes to the Figure 2. Architecture of the Experimental Sopris Highly Secure WiFi-enabled Microcontroller. MediaTek’s
The Seven Properties of Highly Secure Devices Galen Hunt, George Letey, and Edmund B. Nightingale Microsoft Research NExT Operating Systems Technologies Group
Unprivileged process accessing privileged data Failure of privilege levels Process accessing address out of bound Failure of MMU isolation
37
38
39
40
41
Design time Implmtn. time Compile time Install time Load time Run time Post mortem
Time of enforcement
Inspired by Hunt & Larus (2004)
42
2000 4000 6000 8000 10000 12000 14000 16000
0.3 0.5 0.7 0.9 1.1 1.3 1.5
Syscall impact on user-mode IPC Time (in cycles) User-mode IPC (higher is faster) Syscall exception Lost performance (cycles)
2000 4000 6000 8000 10000 12000 14000 16000
0.3 0.5 0.7 0.9 1.1 1.3 1.5
Syscall impact on user-mode IPC Time (in cycles) User-mode IPC (higher is faster) Syscall exception Lost performance (cycles)
Soares & Stumm, OSDI 2010
43
44
45
46
Lines of code (Million) 0.1 1 10 100 1991 1994 1997 2000 2003 2006 2009 2012 2015 2018
Linux Kernel
47
task mgmt
nano-core
kern el cons
input event mux key boar d indir ecti
laye r s c h e d u l e r CFQ policy FCFS policy RR policy mouse indirection layer VGA indirection layer graphics mux filesystem PIC IRQ PIT clock IRQ event dispatcher syscall dispatcher sysc all indir ecti
laye r heap allocator frame allocator stack allocator
userspace processes
PIC IRQ s c h e d u l e r filesystem PIC IRQ PIC IRQ filesyst em fil e s y st e m
(a) Monolithic Kernel (b) Microkernel OS (c) Theseus Kernel
module submodule entanglement via state spill
s c h e d u l e r filesyst em s c h e d ul er
Modules contain submodules Modules hold states for each other Fate sharing Live update almost impossible
48
as a result of handling an interaction with another entity.
fault tolerance, live update, hot-swapping, maintainability…..
Kevin Boos, et al. A Characterization of State Spill in Modern Operating Systems. EuroSys, 2017.
49
50
Vice President Body man
Leverage redundancy Add layers of indirection
51
52
53
54
55
https://blog.bitergia.com/2013/02/01/demographics-of-linux-kernel-developers-how-old-are-they/
58
59
60
61
62
63
Ken Thompson and Dennis Ritchie DEC PDP-11, 16 bit, 1970-ish
64
USA $ 0.0001 0.001 0.01 0.1 1 10 1965 1975 1985 1995 2005
USA Federal minimum wage in 2003 dollar Average transistor price for Intel processors in contemporary dollar
Designed at a time when computer was simpler and more expensive by orders of magnitude
65
PDP11 <
USA $ 0.0001 0.001 0.01 0.1 1 10 1965 1975 1985 1995 2005
USA Federal minimum wage in 2003 dollar Average transistor price for Intel processors in contemporary dollar
Humans were relatively cheap; Let developers manage memory and concurrency
66
USA $ 0.0001 0.001 0.01 0.1 1 10 1965 1975 1985 1995 2005
USA Federal minimum wage in 2003 dollar Average transistor price for Intel processors in contemporary dollar
Computing is relative cheap; Let machine manage memory and concurrency
67
Richard Gabriel in The Rise of ``Worse is Better’'
68
https://blog.bitergia.com/2013/02/01/demographics-of-linux-kernel-developers-how-old-are-they/
“A new scientific truth does not triumph by convincing its
its opponents eventually die, and a new generation grows up that is familiar with it.” ——— Max Planck
70
71
72
73
The ship wherein Theseus and the youth of Athens returned from Crete had thirty oars, and was preserved by the Athenians down even to the time of Demetrius Phalereus, for they took away the old planks as they decayed, putting in new and stronger timber in their places, in so much that this ship became a standing example among the philosophers, for the logical question
remained the same, and the other contending that it was not the same. — Plutarch (Theseus)
74
75
None took off due to underlying runtime or garbage collection requirement
born 2010 at Mozilla Research to develop a new web engine
correctness
76
verify, incurs runtime overhead
Saltzer, Reed & Clark 1984
78
efficiency
Tock (SOSP’17) shows software isolation is achievable on low-cost micro controller WITHOUT MMU
80
Design time Implmtn. time Compile time Install time Load time Run time Post mortem
Time of enforcement
Strong, novel type systems
81
Design time Implmtn. time Compile time Install time Load time Run time Post mortem
Time of enforcement
Inspired by Hunt & Larus (2004)
83
task mgmt
nano-core
kern el cons
input event mux key boar d indir ecti
laye r s c h e d u l e r CFQ policy FCFS policy RR policy mouse indirection layer VGA indirection layer graphics mux filesystem PIC IRQ PIT clock IRQ event dispatcher syscall dispatcher sysc all indir ecti
laye r heap allocator frame allocator stack allocator
userspace processes
PIC IRQ s c h e d u l e r filesystem PIC IRQ PIC IRQ filesyst em fil e s y st e m
(a) Monolithic Kernel (b) Microkernel OS (c) Theseus Kernel
module submodule entanglement via state spill
s c h e d u l e r filesyst em s c h e d ul er
“namespaces”
84
Compiler
Compiler/Linker
Theseus Easy to extricate a single crate due to clear boundaries Standard OS No true distinction between modules, or blurry lines
nano-core
kern el consuserspace processes
PIC IRQ s c h e d u l e r filesystem PIC IRQ PIC IRQ filesyst em fil e s y st e m(a) Monolithic Kernel (b) Microkernel OS (c) Theseus Kernel
module submodule entanglement via state spill
s c h e d u l e r filesyst em s c h e d ul erImplementing the OS like a distributed system
Theseus is “a bag of modules”
session types)
86
87
89
90
20% 6% 14%
91
5% 3%