Design and Implementatjon of a Dynamic Informatjon Flow Tracking Architecture to Secure a RISC-V Core for IoT Applicatjons
Christjan Palmiero†, Giuseppe Di Guglielmo•, Luciano Lavagno†, Luca P. Carloni•
† Politecnico Di Torino
- Columbia University
Design and Implementatjon of a Dynamic Informatjon Flow Tracking - - PowerPoint PPT Presentation
Design and Implementatjon of a Dynamic Informatjon Flow Tracking Architecture to Secure a RISC-V Core for IoT Applicatjons Christjan Palmiero , Giuseppe Di Guglielmo , Luciano Lavagno , Luca P. Carloni Politecnico Di Torino
† Politecnico Di Torino
Giuseppe Di Guglielmo HPEC 2018 2
Giuseppe Di Guglielmo HPEC 2018 3
1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2000 4000 6000 8000 10000 12000 14000 16000
# of Vulnerabilitjes Memory Corruptjon
Giuseppe Di Guglielmo HPEC 2018 4
Giuseppe Di Guglielmo HPEC 2018 5
args
Higher addresses Lower addresses
Functjon Arguments Functjon Local Variables *input Return Address buffer Base Pointer
Main Memory Vulnerable functjon
void vfunc(char *input) { char buffer[64]; ... strcpy(buffer, input); ... }
Privileged Applicatjon “…non- malicious- string…”
Non-secure Channel
vfunc Stack Frame
Giuseppe Di Guglielmo HPEC 2018 6
Vulnerable functjon
void vfunc(char *input) { char buffer[64]; ... strcpy(buffer, input); ... }
Privileged Applicatjon
Non-secure Channel
args Functjon Arguments Functjon Local Variables *input Return Address buffer Base Pointer
Main Memory
“…malicious- string…”
Malevolent transfer of control
Higher addresses Lower addresses
vfunc Stack Frame
Giuseppe Di Guglielmo HPEC 2018 7
Vulnerable functjon
void vfunc(char *input) { char buffer[64]; ... strcpy(buffer, input); ... }
Privileged Applicatjon
Non-secure Channel
args Functjon Arguments Functjon Local Variables *input Return Address buffer Base Pointer
Main Memory
“…malicious- string…”
Malevolent transfer of control
Tag Initjalizatjon
Tag Propagatjon
Tag Check
Higher addresses Lower addresses
Tag Memory
vfunc Stack Frame
Giuseppe Di Guglielmo HPEC 2018 8
IF ID ID EX EX WB Data Memory Decoder ALU Load Store Unit MULT DIV FPU PC Register File Instructjon Memory Instructjon Cache
CSR
Tag Propagatjon Logic Tag Check Logic Tag Update Logic Tag Check Logic T T T TPR TCR
Giuseppe Di Guglielmo HPEC 2018 9
Word 32 1 Tag Register File
x0 x1 x2 x29 x31 x30
Data Memory Word
Higher addresses Lower addresses
32 4 Tag
0x000000A5 0x000000A6 0x000000A7 0x000000A4 0x000000A3
Giuseppe Di Guglielmo HPEC 2018 10
Tag Propagatjon Register
16 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Load/Store Enable Load/Store Mode Logical Mode Comparison Mode Shifu Mode Jump Mode Branch Mode Arith Mode Load/Store Mode Comparison Mode
Tag Check Register
21 20 17 16 14 13 11 10 8 7 5 4 3 2 0
Execute Mode Logical Mode Shifu Mode Jump Mode Branch Mode Arith Mode
word/word in memory
Giuseppe Di Guglielmo HPEC 2018 11
#define SIZE 32 void tag_words(u32 *data_ptr, u32 size) { for (u32 i = 0; i < size; i++) { /* p.spsw set a tag for each byte in a * memory word */ asm volatile (“p.spsw x0, 0(%[offset]);” : :[offset] “r” (data_ptr); data_ptr++; } } void vfunc(u32 input_1[SIZE], /* non-secure */ u32 input_2[SIZE], /* non-secure */ u32 input_3[SIZE]) { /* secure */ /* Tag initialization phase*/ tag_words(SIZE, input_1); tag_words(SIZE, input_2); /* Function body */ /* ... */ }
are set
tags is set
“For an arithmetjc instructjon, if at least one input operand is tagged then the output is tagged”
Giuseppe Di Guglielmo HPEC 2018 12
Tag Propagatjon Register
Load/Store Enable Load/Store Mode Logical Mode Comparison Mode Shifu Mode Jump Mode Branch Mode Arith Mode
rs1 rs2
From ID Stage To MEM/WB Stage
tag-rs1 tag-rs2
tag-rd
rd
arith-policy
Giuseppe Di Guglielmo HPEC 2018 13 Load/Store Mode Comparison Mode
Tag Check Register
Execute Mode Logical Mode Shifu Mode Jump Mode Branch Mode Arith Mode
Source address Source data Destjnatjon data Destjnatjon address
PC +1
from MEM/WB Stage
tag-jump-addr
jump-addr
security-exception
instr-mem-addr
Giuseppe Di Guglielmo HPEC 2018 14
UART SPI Master ...
APB AXI
RI5CY
SPI Slave Debug Unit
instr RAM data RAM DIFT DIFT
D-
Giuseppe Di Guglielmo HPEC 2018 15
ATTACK # LOCATION TARGET TECHNIQUE RESULT 1 Stack Return Address Direct Detected 2 Stack Base Pointer Direct No False Positjve 3 Stack Functjon Pointer (local variable) Direct Detected 4 Stack Functjon Pointer (functjon parameter) Direct Detected 5 Heap/BSS/Data Functjon pointer Direct Detected 6 Stack Return Address Indirect Detected 7 Stack Base Pointer Indirect No False Positjve 8 Stack Functjon Pointer (variable) Indirect Detected 9 Stack Functjon Pointer (functjon parameter) Indirect Detected 10 Heap/BSS/Data Return Address Indirect Detected 11 Heap/BSS/Data Base Pointer Indirect No False Positjve 12 Heap/BSS/Data Functjon Pointer (variable) Indirect Detected 13 Heap/BSS/Data Functjon Pointer (functjon parameter) Indirect Detected ATTACK # SOFTWARE RESULT 1 QPOP 2.53/bfupd Detected 2 wu-fupd 2.6.0 Detected
Giuseppe Di Guglielmo HPEC 2018 16
Giuseppe Di Guglielmo HPEC 2018 17
Giuseppe Di Guglielmo HPEC 2018 18
September 17, 2018 (one week ago…)