System Architectures and Techniques for Efficient, Secure, and Trusted Code Execution
Mario Werner May 7, 2020
Graz University of Technology
System Architectures and Techniques for Efficient, Secure, and - - PowerPoint PPT Presentation
System Architectures and Techniques for Efficient, Secure, and Trusted Code Execution Mario Werner May 7, 2020 Graz University of Technology Why do we care about code? www.tugraz.at 10:20 July 18 W i r e l e s s - G A D S L G
Graz University of Technology
www.tugraz.at
10:20
July 18 W i r e l e s s1 Mario Werner | Graz University of Technology
www.tugraz.at
2 Mario Werner | Graz University of Technology
www.tugraz.at
3 Mario Werner | Graz University of Technology
www.tugraz.at
4 Mario Werner | Graz University of Technology
www.tugraz.at
5 Mario Werner | Graz University of Technology
www.tugraz.at ✈♦✐❞ ♠❛✐♥✭✮ ④ ❢♦r ✭❀❀✮ ④ ✉♥s✐❣♥❡❞ ♣✐♥ ❂ r❡❛❞❴♣✐♥✭✮❀ ✐♥t ❛✉t❤ ❂ ❝❤❡❝❦❴♣✐♥✭♣✐♥✮❀ ✐❢✭ ❛✉t❤ ✮ ④ ♦♣❡♥❴❞♦♦r✭✮❀ ⑥ ❡❧s❡ ④ r❛✐s❡❴❛❧❛r♠✭✮❀ ⑥ ❧♦❣❴❡✈❡♥t✭✮❀ ⑥ ⑥ main check_pin read_pin
raise_alarm log_event 6 Mario Werner | Graz University of Technology
www.tugraz.at check_auth: // auth in x1 (0 if authentic) B N E x , x 1 , n
_ a u t h e n t i c a t e d authenticated: // open door // ... J next not_authenticated: // raise_alarm next: // log event 7 Mario Werner | Graz University of Technology
Mario Werner, Erich Wenger, and Stefan Mangard. “Protecting the Control Flow of Embedded Processors against Fault Attacks”. In: Smart Card Research and Advanced Applications – CARDIS. 2015, pp. 161–176. DOI: ✶✵✳✶✵✵✼✴✾✼✽✲✸✲✸✶✾✲✸✶✷✼✶✲✷❴✶✵ 8 Mario Werner | Graz University of Technology
www.tugraz.at
9 Mario Werner | Graz University of Technology
www.tugraz.at
Reset_Handler 0x00000000 0x0000b5b0 b5b0: push {r4, r5, r7, lr} 0x000164b2 af02: add r7, sp, #8 0x0001acbf 480d: ldr r0, [pc, #52] 0x0001f5cd 490e: ldr r1, [pc, #56] 0x00023855 4288: cmp r0, r1 0x00030a62 d20d: bhs #26 Reset_Handler:1 0x00030a62 0x0003546f 4a0d: ldr r2, [pc, #52] ... Reset_Handler:2 0x00030a62 0x00035668 4c06: ldr r4, [pc, #24] ... ? ? ?
10 Mario Werner | Graz University of Technology
www.tugraz.at
11 Mario Werner | Graz University of Technology
www.tugraz.at
11 Mario Werner | Graz University of Technology
www.tugraz.at
11 Mario Werner | Graz University of Technology
www.tugraz.at
11 Mario Werner | Graz University of Technology
www.tugraz.at
12 Mario Werner | Graz University of Technology
Mario Werner, Thomas Unterluggauer, David Schaffenrath, and Stefan Mangard. “Sponge-Based Control-Flow Protection for IoT Devices”. In: European Symposium on Security and Privacy – EuroS&P. Best Paper Award. 2018, pp. 214–226. DOI: ✶✵✳✶✶✵✾✴❊✉r♦❙P✳✷✵✶✽✳✵✵✵✷✸ 13 Mario Werner | Graz University of Technology
www.tugraz.at
F e t c h F e t c h D e c
e E x e c u t e Me mo r y Wr i t e B a c k Me mo r y ( R A M/ R O M) Mo n i t
14 Mario Werner | Graz University of Technology
www.tugraz.at
15 Mario Werner | Graz University of Technology
www.tugraz.at
16 Mario Werner | Graz University of Technology
www.tugraz.at
1
1
2
1
1
2
1
17 Mario Werner | Graz University of Technology
www.tugraz.at
18 Mario Werner | Graz University of Technology
www.tugraz.at
19 Mario Werner | Graz University of Technology
Mario Werner, Thomas Unterluggauer, Robert Schilling, David Schaffenrath, and Stefan Mangard. “Transparent memory encryption and authentication”. In: Field Programmable Logic and Applications – FPL. 2017, pp. 1–6.
DOI: ✶✵✳✷✸✾✶✾✴❋P▲✳✷✵✶✼✳✽✵✺✻✼✾✼
20 Mario Werner | Graz University of Technology
www.tugraz.at
L L C a c h e
S l i c e
S
S l i c e B
R O M B
S R A M D D R Me mo r y C
t r
l e r Me mo r y C h i p Me mo r y C h i p S C F P C
e S C F P C
e Me mo r y E n c r y p t i
21 Mario Werner | Graz University of Technology
www.tugraz.at
CPU Memory Request
Block 1 Block 2
CPU Memory Layout Physical Memory Physical Block 1 Split Request Block 3
Encrypted Block 3 Nonce Tag Encrypted Block 2 Nonce Tag Encrypted Block 1 Nonce Tag Encrypted Block 0 Nonce Tag
Physical Block 2 Physical Block 3 Block 0 Physical Block 0
22 Mario Werner | Graz University of Technology
www.tugraz.at Request Modifjer Memory Reader Decryption Wrap Burst Cache Read Responder Data Modifjer Encryption Memory Writer Data Filter Memory Write Port CPU Write Port Memory Read Port CPU Read Port CPU
23 Mario Werner | Graz University of Technology
www.tugraz.at Data Tag
Nonce
Tag Data Tag Data Tag Data Tag Secure Root (on chip) Memory Nonce
Nonce Nonce
Tag
Nonce Nonce
Tag
Nonce
24 Mario Werner | Graz University of Technology
www.tugraz.at
Request Modifjer Cache Fetcher Secure Root Memory Reader Nonce Injector Decryption Data Filter Wrap Burst Cache Read Responder Data Modifjer Encryption Memory Writer Nonce Cache Nonce Processing Cache Writer CPU
Memory Write Port CPU Write Port Memory Read Port CPU Read Port
25 Mario Werner | Graz University of Technology
www.tugraz.at
26 Mario Werner | Graz University of Technology
Mario Werner, Thomas Unterluggauer, Lukas Giner, Michael Schwarz, Daniel Gruss, and Stefan Mangard. “ScatterCache: Thwarting Cache Attacks via Cache Set Randomization”. In: USENIX Security Symposium. 2019, pp. 675–692. URL: ❤tt♣s✿✴✴✇✇✇✳✉s❡♥✐①✳♦r❣✴❝♦♥❢❡r❡♥❝❡✴✉s❡♥✐①s❡❝✉r✐t②✶✾✴♣r❡s❡♥t❛t✐♦♥✴✇❡r♥❡r 27 Mario Werner | Graz University of Technology
www.tugraz.at
L L C a c h e
S l i c e
S
S l i c e B
R O M B
S R A M D D R Me mo r y C
t r
l e r Me mo r y C h i p Me mo r y C h i p S C F P C
e S C F P C
e Me mo r y E n c r y p t i
28 Mario Werner | Graz University of Technology
www.tugraz.at
❣❡♥❡r❛t❡❞ ✉s✐♥❣ t❤❡ ❈❚❆ ❝❛❧✐❜r❛t✐♦♥ t♦♦❧ ❬●❙▼✶✺❪ ♦♥ ♠② ✐✺✲✹✷✵✵❯ ❧❛♣t♦♣ 29 Mario Werner | Graz University of Technology
www.tugraz.at
30 Mario Werner | Graz University of Technology
www.tugraz.at
set[idx+2] set[idx-2] set[idx-1] set[idx+1] way 0 way 1 way 2 way 3
index tag
idx0 way 3
index tag
cache line addr. key
idx1 idx2 idx3 way 1 way 2 way 0
SDID
31 Mario Werner | Graz University of Technology
www.tugraz.at
32 Mario Werner | Graz University of Technology
www.tugraz.at
33 Mario Werner | Graz University of Technology
www.tugraz.at
34 Mario Werner | Graz University of Technology
Graz University of Technology
www.tugraz.at [Gro+16] Hannes Gross, Manuel Jelinek, Stefan Mangard, Thomas Unterluggauer, and Mario Werner. “Concealing Secrets in Embedded Processors Designs”. In: Smart Card Research and Advanced Applications – CARDIS. 2016, pp. 89–104. DOI: ✶✵✳✶✵✵✼✴✾✼✽✲✸✲✸✶✾✲✺✹✻✻✾✲✽❴✻. [Kal+20] Daniel Kales, Sebastian Ramacher, Christian Rechberger, Roman Walch, and Mario Werner. “Efficient FPGA Implementations of LowMC and Picnic”. In: The Cryptographers’ Track at the RSA Conference – CT-RSA. 2020. URL: ❤tt♣s✿✴✴❡♣r✐♥t✳✐❛❝r✳♦r❣✴✷✵✶✾✴✶✸✻✽. [Sch+18] Robert Schilling, Mario Werner, Pascal Nasahl, and Stefan Mangard. “Pointing in the Right Direction - Securing Memory Accesses in a Faulty World”. In: Annual Computer Security Applications Conference – ACSAC. 2018, pp. 595–604. DOI: ✶✵✳✶✶✹✺✴✸✷✼✹✻✾✹✳✸✷✼✹✼✷✽. [SWM18] Robert Schilling, Mario Werner, and Stefan Mangard. “Securing conditional branches in the presence of fault attacks”. In: Design, Automation & Test in Europe – DATE. 2018,
www.tugraz.at [UWM17a] Thomas Unterluggauer, Mario Werner, and Stefan Mangard. “Securing Memory Encryption and Authentication Against Side-Channel Attacks Using Unprotected Primitives”. In: Conference on Computer and Communications Security – CCS. 2017, pp. 690–702. DOI: ✶✵✳✶✶✹✺✴✸✵✺✷✾✼✸✳✸✵✺✷✾✽✺. [UWM17b] Thomas Unterluggauer, Mario Werner, and Stefan Mangard. “Side-channel plaintext-recovery attacks on leakage-resilient encryption”. In: Design, Automation & Test in Europe – DATE. 2017, pp. 1318–1323. DOI: ✶✵✳✷✸✾✶✾✴❉❆❚❊✳✷✵✶✼✳✼✾✷✼✶✾✼. [UWM19] Thomas Unterluggauer, Mario Werner, and Stefan Mangard. “MEAS: memory encryption and authentication secure against side-channel attacks”. In: J. Cryptographic Engineering 9 (2019),
[Wei+19] Samuel Weiser, Mario Werner, Ferdinand Brasser, Maja Malenko, Stefan Mangard, and Ahmad-Reza Sadeghi. “TIMBER-V: Tag-Isolated Memory Bringing Fine-grained Enclaves to RISC-V”. In: Network and Distributed System Security Symposium – NDSS. 2019. URL: ❤tt♣s✿✴✴✇✇✇✳♥❞ss✲s②♠♣♦s✐✉♠✳♦r❣✴♥❞ss✲♣❛♣❡r✴t✐♠❜❡r✲✈✲t❛❣✲✐s♦❧❛t❡❞✲♠❡♠♦r②✲ ❜r✐♥❣✐♥❣✲❢✐♥❡✲❣r❛✐♥❡❞✲❡♥❝❧❛✈❡s✲t♦✲r✐s❝✲✈✴.
www.tugraz.at [Wer+17] Mario Werner, Thomas Unterluggauer, Robert Schilling, David Schaffenrath, and Stefan Mangard. “Transparent memory encryption and authentication”. In: Field Programmable Logic and Applications – FPL. 2017, pp. 1–6. DOI: ✶✵✳✷✸✾✶✾✴❋P▲✳✷✵✶✼✳✽✵✺✻✼✾✼. [Wer+18] Mario Werner, Thomas Unterluggauer, David Schaffenrath, and Stefan Mangard. “Sponge-Based Control-Flow Protection for IoT Devices”. In: European Symposium on Security and Privacy – EuroS&P. Best Paper Award. 2018, pp. 214–226. DOI: ✶✵✳✶✶✵✾✴❊✉r♦❙P✳✷✵✶✽✳✵✵✵✷✸. [Wer+19a] Mario Werner, Robert Schilling, Thomas Unterluggauer, and Stefan Mangard. “Protecting RISC-V Processors against Physical Attacks”. In: Design, Automation & Test in Europe – DATE. 2019, pp. 1136–1141. DOI: ✶✵✳✷✸✾✶✾✴❉❆❚❊✳✷✵✶✾✳✽✼✶✹✽✶✶. [Wer+19b] Mario Werner, Thomas Unterluggauer, Lukas Giner, Michael Schwarz, Daniel Gruss, and Stefan Mangard. “ScatterCache: Thwarting Cache Attacks via Cache Set Randomization”. In: USENIX Security Symposium. 2019, pp. 675–692. URL: ❤tt♣s✿✴✴✇✇✇✳✉s❡♥✐①✳♦r❣✴❝♦♥❢❡r❡♥❝❡✴✉s❡♥✐①s❡❝✉r✐t②✶✾✴♣r❡s❡♥t❛t✐♦♥✴✇❡r♥❡r.
www.tugraz.at [WUW13] Erich Wenger, Thomas Unterluggauer, and Mario Werner. “8/16/32 Shades of Elliptic Curve Cryptography on Embedded Processors”. In: Progress in Cryptology – INDOCRYPT. 2013,
[WW11] Erich Wenger and Mario Werner. “Evaluating 16-Bit Processors for Elliptic Curve Cryptography”. In: Smart Card Research and Advanced Applications – CARDIS. 2011,
[WW17] Samuel Weiser and Mario Werner. “SGXIO: Generic Trusted I/O Path for Intel SGX”. In: Conference on Data and Application Security and Privacy – CODASPY. 2017, pp. 261–268.
DOI: ✶✵✳✶✶✹✺✴✸✵✷✾✽✵✻✳✸✵✷✾✽✷✷.
[WWM15] Mario Werner, Erich Wenger, and Stefan Mangard. “Protecting the Control Flow of Embedded Processors against Fault Attacks”. In: Smart Card Research and Advanced Applications –
www.tugraz.at [And+14] Elena Andreeva, Begül Bilgin, Andrey Bogdanov, Atul Luykx, Bart Mennink, Nicky Mouha, and Kan Yasuda. “APE: Authenticated Permutation-Based Encryption for Lightweight Cryptography”. In: Fast Software Encryption – FSE. 2014, pp. 168–186. DOI: ✶✵✳✶✵✵✼✴✾✼✽✲✸✲✻✻✷✲✹✻✼✵✻✲✵❴✾. [GSM15] Daniel Gruss, Raphael Spreitzer, and Stefan Mangard. Cache Template Attacks Repository.
[Kim+14] Yoongu Kim, Ross Daly, Jeremie Kim, Chris Fallin, Ji-Hye Lee, Donghyuk Lee, Chris Wilkerson, Konrad Lai, and Onur Mutlu. “Flipping bits in memory without accessing them: An experimental study of DRAM disturbance errors”. In: International Symposium on Computer Architecture –
[KSV13] Dusko Karaklajic, Jörn-Marc Schmidt, and Ingrid Verbauwhede. “Hardware Designer’s Guide to Fault Attacks”. In: IEEE Trans. Very Large Scale Integr. Syst. 21 (2013), pp. 2295–2306. DOI: ✶✵✳✶✶✵✾✴❚❱▲❙■✳✷✵✶✷✳✷✷✸✶✼✵✼. [MM88] Aamer Mahmood and Edward J. McCluskey. “Concurrent Error Detection Using Watchdog Processors - A Survey”. In: IEEE Trans. Computers 37 (1988), pp. 160–174. DOI: ✶✵✳✶✶✵✾✴✶✷✳✷✶✹✺.
www.tugraz.at [MOP07] Stefan Mangard, Elisabeth Oswald, and Thomas Popp. Power analysis attacks - revealing the secrets of smart cards. Springer, 2007. ISBN: 978-0-387-30857-9. [Mur+20] Kit Murdock, David Oswald, Flavio D. Garcia, Jo Van Bulck, Daniel Gruss, and Frank Piessens. “Plundervolt: Software-based Fault Injection Attacks against Intel SGX”. In: IEEE Symposium
❤tt♣s✿✴✴✇✇✇✳♣❧✉♥❞❡r✈♦❧t✳❝♦♠✴❞♦❝✴♣❧✉♥❞❡r✈♦❧t✳♣❞❢. [Qur18] Moinuddin K. Qureshi. “CEASER: Mitigating Conflict-Based Cache Attacks via Encrypted-Address and Remapping”. In: IEEE/ACM International Symposium on Microarchitecture – MICRO. 2018, pp. 775–787. DOI: ✶✵✳✶✶✵✾✴▼■❈❘❖✳✷✵✶✽✳✵✵✵✻✽. [Tri+18] David Trilla, Carles Hernández, Jaume Abella, and Francisco J. Cazorla. “Cache side-channel attacks and time-predictability in high-performance critical real-time systems”. In: Design Automation Conference – DAC. 2018, 98:1–98:6. DOI: ✶✵✳✶✶✹✺✴✸✶✾✺✾✼✵✳✸✶✾✻✵✵✸. [WS88] Kent D. Wilken and John Paul Shen. “Continuous Signature Monitoring: Efficient Concurrent-Detection of Processor Control Errors”. In: International Test Conference – ITC. 1988, pp. 914–925. DOI: ✶✵✳✶✶✵✾✴❚❊❙❚✳✶✾✽✽✳✷✵✼✽✽✵.
www.tugraz.at