Cache Storage Channels Alias-driven Attacks Formally Verified - - PowerPoint PPT Presentation
Cache Storage Channels Alias-driven Attacks Formally Verified - - PowerPoint PPT Presentation
Roberto Guanciale Mads Dam Hamed Nemati Christoph Baumann Cache Storage Channels Alias-driven Attacks Formally Verified Platforms Formally Verified Platforms Caches Excluded Formally Verified from the analysis Platforms Caches Excluded
Formally Verified Platforms
Formally Verified Platforms
Formally Verified Platforms Caches Excluded from the analysis
Formally Verified Platforms Caches Excluded from the analysis
Formally Verified Platforms Caches Excluded from the analysis
Formally Verified Platforms Caches Excluded from the analysis
Formally Verified Platforms Caches Excluded from the analysis Models should be Sound
Formally Verified Platforms Caches Excluded from the analysis Models should be Sound Storage Channels can invalidate results
Virtual Address MMU Cacheable (std-memory) Non-cacheable (devices)
Incoherent Cache Behaviors
Page T ables
Mismatched cacheability attributes
do not do this Mismatched cacheability attributes
do not do this Please, Mismatched cacheability attributes
do not do this Please, Mismatched cacheability attributes Incoherent Cache Behaviors
ARM-terminology: unexpected cache hit if the data cache reports a hit on a memory location that is marked as non- cacheable, the cache might access the memory disregarding such hit.
do not do this Please, Mismatched cacheability attributes Incoherent Cache Behaviors
Hypervisor OS OS
Scenarios
Hypervisor OS OS OS ARM TrustZone Service
Scenarios
Hypervisor OS OS OS ARM TrustZone Service Kernel Device Driver User Process
Scenarios
w r i t e ( V A _ n c , ) … w r i t e ( V A _ n c , 1 ) f r e e ( V A _ n c ) D = a c c e s s ( V A _ c ) … D = a c c e s s ( V A _ c ) i f n
- t
p
- l
i c y ( D ) R e j e c t ( ) … u s e ( V A _ c )
VA_nc PA VA_c line dirty
Attacker Victim
cache memory
w r i t e ( V A _ n c , ) … w r i t e ( V A _ n c , 1 ) f r e e ( V A _ n c ) D = a c c e s s ( V A _ c ) … D = a c c e s s ( V A _ c ) i f n
- t
p
- l
i c y ( D ) R e j e c t ( ) … u s e ( V A _ c )
Attacker Victim
VA_nc PA VA_c line dirty cache memory
w r i t e ( V A _ n c , ) … w r i t e ( V A _ n c , 1 ) f r e e ( V A _ n c ) D = a c c e s s ( V A _ c ) … D = a c c e s s ( V A _ c ) i f n
- t
p
- l
i c y ( D ) R e j e c t ( ) … u s e ( V A _ c )
Attacker Victim
VA_nc PA VA_c line dirty cache memory
w r i t e ( V A _ n c , ) … w r i t e ( V A _ n c , 1 ) f r e e ( V A _ n c ) D = a c c e s s ( V A _ c ) … D = a c c e s s ( V A _ c ) i f n
- t
p
- l
i c y ( D ) R e j e c t ( ) … u s e ( V A _ c )
Attacker Victim
VA_nc PA VA_c line dirty cache memory
w r i t e ( V A _ n c , ) … w r i t e ( V A _ n c , 1 ) f r e e ( V A _ n c ) D = a c c e s s ( V A _ c ) … D = a c c e s s ( V A _ c ) i f n
- t
p
- l
i c y ( D ) R e j e c t ( ) … u s e ( V A _ c )
VA_nc PA VA_c line dirty
Attacker Victim
cache memory
w r i t e ( V A _ n c , ) … w r i t e ( V A _ n c , 1 ) f r e e ( V A _ n c ) D = a c c e s s ( V A _ c ) … D = a c c e s s ( V A _ c ) i f n
- t
p
- l
i c y ( D ) R e j e c t ( ) … u s e ( V A _ c )
VA_nc PA VA_c line dirty
Attacker Victim
cache memory
w r i t e ( V A _ n c , ) … w r i t e ( V A _ n c , 1 ) f r e e ( V A _ n c ) D = a c c e s s ( V A _ c ) … D = a c c e s s ( V A _ c ) i f n
- t
p
- l
i c y ( D ) R e j e c t ( ) … u s e ( V A _ c )
VA_nc PA VA_c line dirty
Attacker Victim
cache memory
w r i t e ( V A _ n c , ) … w r i t e ( V A _ n c , 1 ) f r e e ( V A _ n c ) D = a c c e s s ( V A _ c ) … D = a c c e s s ( V A _ c ) i f n
- t
p
- l
i c y ( D ) R e j e c t ( ) … u s e ( V A _ c )
VA_nc PA VA_c F line dirty
Attacker Victim
cache memory
w r i t e ( V A _ n c , ) … w r i t e ( V A _ n c , 1 ) f r e e ( V A _ n c ) D = a c c e s s ( V A _ c ) … D = a c c e s s ( V A _ c ) i f n
- t
p
- l
i c y ( D ) R e j e c t ( ) … u s e ( V A _ c )
VA_nc PA VA_c F line dirty
Attacker Victim
cache memory
w r i t e ( V A _ n c , ) … w r i t e ( V A _ n c , 1 ) f r e e ( V A _ n c ) D = a c c e s s ( V A _ c ) … D = a c c e s s ( V A _ c ) i f n
- t
p
- l
i c y ( D ) R e j e c t ( ) … u s e ( V A _ c )
VA_nc PA VA_c F line dirty
Attacker Victim
cache 1 memory
w r i t e ( V A _ n c , ) … w r i t e ( V A _ n c , 1 ) f r e e ( V A _ n c ) D = a c c e s s ( V A _ c ) … D = a c c e s s ( V A _ c ) i f n
- t
p
- l
i c y ( D ) R e j e c t ( ) … u s e ( V A _ c )
VA_nc PA VA_c F line dirty
Attacker Victim
cache 1 memory
w r i t e ( V A _ n c , ) … w r i t e ( V A _ n c , 1 ) f r e e ( V A _ n c ) D = a c c e s s ( V A _ c ) … D = a c c e s s ( V A _ c ) i f n
- t
p
- l
i c y ( D ) R e j e c t ( ) … u s e ( V A _ c )
VA_nc PA VA_c F line dirty
Attacker Victim
cache 1 memory
w r i t e ( V A _ n c , ) … w r i t e ( V A _ n c , 1 ) f r e e ( V A _ n c ) D = a c c e s s ( V A _ c ) … D = a c c e s s ( V A _ c ) i f n
- t
p
- l
i c y ( D ) R e j e c t ( ) … u s e ( V A _ c )
VA_nc PA VA_c F line dirty
Attacker Victim
cache 1 memory
w r i t e ( V A _ n c , ) … w r i t e ( V A _ n c , 1 ) f r e e ( V A _ n c ) D = a c c e s s ( V A _ c ) … D = a c c e s s ( V A _ c ) i f n
- t
p
- l
i c y ( D ) R e j e c t ( ) … u s e ( V A _ c )
VA_nc PA VA_c F line dirty
Attacker Victim
cache 1 memory
w r i t e ( V A _ n c , ) … w r i t e ( V A _ n c , 1 ) f r e e ( V A _ n c ) D = a c c e s s ( V A _ c ) … D = a c c e s s ( V A _ c ) i f n
- t
p
- l
i c y ( D ) R e j e c t ( ) … u s e ( V A _ c )
VA_nc PA VA_c F line dirty
Attacker Victim
cache 1 memory
w r i t e ( V A _ n c , ) … w r i t e ( V A _ n c , 1 ) f r e e ( V A _ n c ) D = a c c e s s ( V A _ c ) … D = a c c e s s ( V A _ c ) i f n
- t
p
- l
i c y ( D ) R e j e c t ( ) … u s e ( V A _ c )
VA_nc PA VA_c F line dirty
Attacker Victim
cache 1 memory
w r i t e ( V A _ n c , ) … w r i t e ( V A _ n c , 1 ) f r e e ( V A _ n c ) D = a c c e s s ( V A _ c ) … D = a c c e s s ( V A _ c ) i f n
- t
p
- l
i c y ( D ) R e j e c t ( ) … u s e ( V A _ c )
VA_nc PA VA_c F line dirty
Attacker Victim
cache 1 memory
w r i t e ( V A _ n c , ) … w r i t e ( V A _ n c , 1 ) f r e e ( V A _ n c ) D = a c c e s s ( V A _ c ) … D = a c c e s s ( V A _ c ) i f n
- t
p
- l
i c y ( D ) R e j e c t ( ) … u s e ( V A _ c )
VA_nc PA VA_c F line dirty
Attacker Victim
cache 1 memory
w r i t e ( V A _ n c , ) … w r i t e ( V A _ n c , 1 ) f r e e ( V A _ n c ) D = a c c e s s ( V A _ c ) … D = a c c e s s ( V A _ c ) i f n
- t
p
- l
i c y ( D ) R e j e c t ( ) … u s e ( V A _ c )
VA_nc PA VA_c F line dirty
Attacker Victim
cache 1 memory
D = =
w r i t e ( V A _ n c , ) … w r i t e ( V A _ n c , 1 ) f r e e ( V A _ n c ) D = a c c e s s ( V A _ c ) … D = a c c e s s ( V A _ c ) i f n
- t
p
- l
i c y ( D ) R e j e c t ( ) … u s e ( V A _ c )
VA_nc PA VA_c F line dirty
Attacker Victim
cache 1 memory
D = =
w r i t e ( V A _ n c , ) … w r i t e ( V A _ n c , 1 ) f r e e ( V A _ n c ) D = a c c e s s ( V A _ c ) … D = a c c e s s ( V A _ c ) i f n
- t
p
- l
i c y ( D ) R e j e c t ( ) … u s e ( V A _ c )
VA_nc PA VA_c F line dirty
Attacker Victim
cache 1 memory
e v i c t i
- n
w r i t e ( V A _ n c , ) … w r i t e ( V A _ n c , 1 ) f r e e ( V A _ n c ) D = a c c e s s ( V A _ c ) … D = a c c e s s ( V A _ c ) i f n
- t
p
- l
i c y ( D ) R e j e c t ( ) … u s e ( V A _ c )
VA_nc PA VA_c line dirty
Attacker Victim
cache 1 memory
e v i c t i
- n
w r i t e ( V A _ n c , ) … w r i t e ( V A _ n c , 1 ) f r e e ( V A _ n c ) D = a c c e s s ( V A _ c ) … D = a c c e s s ( V A _ c ) i f n
- t
p
- l
i c y ( D ) R e j e c t ( ) … u s e ( V A _ c )
VA_nc PA VA_c line dirty
Attacker Victim
cache 1 memory
VA_nc PA VA_c line dirty
Attacker Victim
cache 1 memory
w r i t e ( V A _ n c , ) … w r i t e ( V A _ n c , 1 ) f r e e ( V A _ n c ) D = a c c e s s ( V A _ c ) … D = a c c e s s ( V A _ c ) i f n
- t
p
- l
i c y ( D ) R e j e c t ( ) … u s e ( V A _ c )
w r i t e ( V A _ n c , ) … w r i t e ( V A _ n c , 1 ) f r e e ( V A _ n c ) D = a c c e s s ( V A _ c ) … D = a c c e s s ( V A _ c ) i f n
- t
p
- l
i c y ( D ) R e j e c t ( ) … u s e ( V A _ c )
VA_nc PA VA_c line dirty
Attacker Victim
cache 1 memory
w r i t e ( V A _ n c , ) … w r i t e ( V A _ n c , 1 ) f r e e ( V A _ n c ) D = a c c e s s ( V A _ c ) … D = a c c e s s ( V A _ c ) i f n
- t
p
- l
i c y ( D ) R e j e c t ( ) … u s e ( V A _ c )
VA_nc PA VA_c 1 F line dirty
Attacker Victim
cache 1 memory
w r i t e ( V A _ n c , ) … w r i t e ( V A _ n c , 1 ) f r e e ( V A _ n c ) D = a c c e s s ( V A _ c ) … D = a c c e s s ( V A _ c ) i f n
- t
p
- l
i c y ( D ) R e j e c t ( ) … u s e ( V A _ c )
VA_nc PA VA_c 1 F line dirty
Attacker Victim
cache 1 memory
Integrity threat
- Transfer of memory ownership
- Time Of Check To Time Of Use attacks
- No need of
- simultaneous double mapping
- concurrency
Natural preys: reference monitors
Storage channels
cache VA_nc VA_c PA1 VA3 VA2 PA2 PA3 i n v a l i d a t e ( V A _ c ) w r i t e ( V A _ n c , ) D = r e a d ( V A _ c ) w r i t e ( V A _ n c , 1 ) c a l l v i c t i m D = r e a d ( V A _ c ) i f s e c r e t a c c e s s ( V A 2 ) e l s e a c c e s s ( V A 3 )
Attacker Victim
cache VA_nc VA_c PA1 VA3 VA2 PA2 PA3
Accessed cache line is secret-dependent
i n v a l i d a t e ( V A _ c ) w r i t e ( V A _ n c , ) D = r e a d ( V A _ c ) w r i t e ( V A _ n c , 1 ) c a l l v i c t i m D = r e a d ( V A _ c ) i f s e c r e t a c c e s s ( V A 2 ) e l s e a c c e s s ( V A 3 )
Attacker Victim
cache VA_nc VA_c PA1 VA3 VA2 PA2 PA3 i n v a l i d a t e ( V A _ c ) w r i t e ( V A _ n c , ) D = r e a d ( V A _ c ) w r i t e ( V A _ n c , 1 ) c a l l v i c t i m D = r e a d ( V A _ c ) i f s e c r e t a c c e s s ( V A 2 ) e l s e a c c e s s ( V A 3 )
Attacker Victim
Cache is a shared resource
cache VA_nc VA_c PA1 VA3 VA2 PA2 PA3 i n v a l i d a t e ( V A _ c ) w r i t e ( V A _ n c , ) D = r e a d ( V A _ c ) w r i t e ( V A _ n c , 1 ) c a l l v i c t i m D = r e a d ( V A _ c ) i f s e c r e t a c c e s s ( V A 2 ) e l s e a c c e s s ( V A 3 )
Attacker Victim
Mismatched cacheability attributes
Confidentiality threat
- Access driven attacks
- No external measure needed
- Difficult to counter-measure at
probing time Natural preys: look-up tables Natural preys: reference monitors
Storage channels
Integrity threat
- Transfer of memory ownership
- Time Of Check To Time Of Use
- No need of
- simultaneous double mapping
- concurrency
Hypervisor
▸ Beagleboard
Paravirtualizing Hypervisor
PT PT Linux
Linux prepares a PT
Linux
Hypervisor makes region read-only ▸ Beagleboard
Paravirtualizing Hypervisor
Hypervisor PT PT
Hypervisor PT PT Linux
Hypervisor validates content ▸ Beagleboard
Paravirtualizing Hypervisor
Hypervisor PT PT Linux
Hypervisor activates PT ▸ Beagleboard
Paravirtualizing Hypervisor
Hypervisor PT PT Linux
Hypervisor activates PT ▸ Beagleboard
Paravirtualizing Hypervisor
Hypervisor PT PT Linux
Hypervisor activates PT ▸ Beagleboard ▸ Linux takes complete control
Paravirtualizing Hypervisor
OS TrustZone Service
Vulnerability: c[j]=Kn[j] xor T4[s[j]]
▸ Raspberry PI 2 ▸ 128-bit key extracted after 850 encryptions
AES Cryptoservice
Integrity threat guarantee memory coherency
- cache flushes
(8x overhead)
- selective eviction
(0.2x overhead)
Countermeasures
Integrity threat guarantee memory coherency
- cache flushes
(8x overhead)
- selective eviction
(0.2x overhead)
Countermeasures
Confidentiality threat standard timing approaches
- secret-independent accesses
(5x overhead)
- no cache for secret accesses
(6x overhead)
Integrity threat guarantee memory coherency
- cache flushes
(8x overhead)
- selective eviction
(0.2x overhead)
Countermeasures
Confidentiality threat standard timing approaches
- secret-independent accesses
(5x overhead)
- no cache for secret accesses
(6x overhead) Vector specific
- avoid uncacheable aliases
(0.15x overhead)
Integrity threat guarantee memory coherency
- cache flushes
(8x overhead)
- selective eviction
(0.2x overhead)
Countermeasures
Confidentiality threat standard timing approaches
- secret-independent accesses
(5x overhead)
- no cache for secret accesses
(6x overhead) Vector specific
- avoid uncacheable aliases
(0.15x overhead) HW Countermeasures
- do not disregard
unexpected cache hit
Confidentiality threat using self-modifying code
Concluding remarks
Ongoing work
- Repair formal verification
- TLBs / Branch prediction / …
- Experimentation in multi-core
- Evaluating HW countermeasures