SecDir: A Secure Directory to Defeat Directory Side-Channel Attacks

undefined
 
S
e
c
D
i
r
:
 
A
 
S
e
c
u
r
e
 
D
i
r
e
c
t
o
r
y
 
t
o
 
D
e
f
e
a
t
D
i
r
e
c
t
o
r
y
 
S
i
d
e
-
C
h
a
n
n
e
l
 
A
t
t
a
c
k
s
 
M
e
n
g
j
i
a
 
Y
a
n
*
,
 
J
e
n
-
Y
a
n
g
 
W
e
n
,
 
C
h
r
i
s
t
o
p
h
e
r
 
W
.
 
F
l
e
t
c
h
e
r
,
 
J
o
s
e
p
 
T
o
r
r
e
l
l
a
s
University of Illinois at Urbana-Champaign
*University of Illinois at Urbana-Champaign/MIT
 
ISCA, June 2019
Motivation
 
Cache-based side-channel attacks are serious security threats
Directories are also vulnerable to side-channel attacks [Yan et al, S&P’19]
I
t
 
i
s
 
c
h
a
l
l
e
n
g
i
n
g
 
t
o
 
d
e
s
i
g
n
 
s
e
c
u
r
e
 
d
i
r
e
c
t
o
r
i
e
s
 
i
n
e
x
p
e
n
s
i
v
e
l
y
 
a
n
d
 
s
c
a
l
a
b
l
y
2
d
i
r
e
c
t
o
r
y
C
o
n
t
r
i
b
u
t
i
o
n
:
 
A
 
S
e
c
u
r
e
 
D
i
r
e
c
t
o
r
y
 
(
S
e
c
D
i
r
)
 
Key: Block directory interference between processes
Main idea: Take a portion of the storage used by conventional directory and
re-assign it to per-core private directory (Victim Directory)
3
V
D
 
Outline
 
Background
The Problem
Threat Model
SecDir Design
Evaluation
 
4
Directory Basics
 
Directory is used to keep presence information for cache lines
A directory entry contains “sharer information”, address tag, coherence state
Sharer information: N presence bits, where N is # of cores in machine
D
i
r
e
c
t
o
r
y
 
i
s
 
p
a
r
t
i
t
i
o
n
e
d
 
i
n
t
o
 
s
l
i
c
e
s
 
l
i
k
e
 
L
L
C
 
u
s
i
n
g
 
a
 
h
a
s
h
 
f
u
n
c
t
i
o
n
5
Directories in Non-inclusive Cache Hierarchies
 
Trend to have non-inclusive cache hierarchies
A
d
d
e
d
 
E
x
t
e
n
d
e
d
 
D
i
r
e
c
t
o
r
y
 
t
o
 
h
o
l
d
 
s
t
a
t
e
 
f
o
r
 
l
i
n
e
s
 
t
h
a
t
 
a
r
e
 
i
n
 
p
r
i
v
a
t
e
 
c
a
c
h
e
s
 
(
L
2
)
 
6
[Yan et al, S&P’19]
 
S
l
i
c
e
 
o
f
 
I
n
t
e
l
 
S
k
y
l
a
k
e
-
X
/
S
P
 
L
L
C
 
a
n
d
 
d
i
r
e
c
t
o
r
y
Directories are Vulnerable to Side-Channel Attacks
 
Every single line in the cache hierarchy has a directory entry
Directory conflict 
 Evicts victim’s directory entry 
 Evicts victim’s cache line
R
o
o
t
 
c
a
u
s
e
:
 
L
i
m
i
t
e
d
 
p
e
r
-
s
l
i
c
e
 
d
i
r
e
c
t
o
r
y
 
a
s
s
o
c
i
a
t
i
v
i
t
y
traditional
directory
(TD)
v
i
c
t
i
m
core 0
 
a
t
t
a
c
k
e
r
core 1
P
r
i
v
a
t
e
c
a
c
h
e
extended
directory
(ED)
L
L
C
s
l
i
c
e
cache lines 
 
a
t
t
a
c
k
e
r
core 2
7
[Yan et al, S&P’19]
Defense Goal & Threat Model
8
 
* Victim self-conflicts (e.g. in victim’s private structures) are not considered leakage
G
o
a
l
:
 
A
 
s
e
c
u
r
e
 
d
i
r
e
c
t
o
r
y
 
t
o
 
b
l
o
c
k
 
d
i
r
e
c
t
o
r
y
 
i
n
t
e
r
f
e
r
e
n
c
e
 
b
e
t
w
e
e
n
 
p
r
o
c
e
s
s
e
s
 
Naïve Secure Directory Designs Are Not Scalable
 
Strategy I: Substantially increase associativity of each directory slice
Unrealistic: Need too high associativity
9
 
(e.g. 
> 300 for a 22-core machine
)
 
Naïve Secure Directory Designs Are Not Scalable
 
10
 
Strategy I: Substantially increase associativity of each directory slice
Unrealistic: Need too high associativity (e.g. 
> 300 for a 22-core machine
)
Strategy II: Way-partition the directory slice (at least 1 way per security domain)
Unacceptable: 
Inflexible, low performance and limiting
O
u
r
 
p
r
o
p
o
s
a
l
:
 
S
e
c
D
i
r
S
l
i
c
e
 
o
f
 
I
n
t
e
l
S
k
y
l
a
k
e
-
X
 
d
i
r
e
c
t
o
r
y
.
 
S
l
i
c
e
 
o
f
 
S
e
c
D
i
r
.
11
P
r
o
v
i
d
e
 
p
e
r
-
c
o
r
e
 
i
s
o
l
a
t
i
o
n
 
M
a
i
n
 
i
d
e
a
:
 
T
a
k
e
 
p
a
r
t
 
o
f
 
t
h
e
s
t
o
r
a
g
e
 
u
s
e
d
 
b
y
 
c
o
n
v
e
n
t
i
o
n
a
l
d
i
r
e
c
t
o
r
y
 
a
n
d
 
r
e
-
a
s
s
i
g
n
 
i
t
 
t
o
 
p
e
r
-
c
o
r
e
 
p
r
i
v
a
t
e
 
d
i
r
e
c
t
o
r
i
e
s
:
 
V
i
c
t
i
m
D
i
r
e
c
t
o
r
i
e
s
 
(
V
D
)
 
VD bank
O
u
r
 
p
r
o
p
o
s
a
l
:
 
S
e
c
D
i
r
12
 
P
r
o
v
i
d
e
s
 
i
n
e
x
p
e
n
s
i
v
e
 
a
n
d
 
s
c
a
l
a
b
l
e
 
i
s
o
l
a
t
i
o
n
Uses modest storage
 
V
D
 
s
i
z
e
 
f
o
r
 
a
 
c
o
r
e
 
i
s
 
c
o
n
s
t
a
n
t
i
r
r
e
s
p
e
c
t
i
v
e
 
t
o
 
N
 
N: number of cores
S: number of slices
SecDir Blocks Directory Interference
Consider each directory transition and its security implications
13
SecDir Blocks Directory Interference
 
Consider each directory transition and its security implications
ED

 TD: Line location does not change; 
no leakage
 
14
SecDir Blocks Directory Interference
 
Consider each directory transition and its security implications
ED

 TD: Line location does not change; 
no leakage
TD 
 Memory: 
Line is in LLC but in no L2; It is because of 
L2 self-conflicts, not due to attacker
 
15
SecDir Blocks Directory Interference
 
Consider each directory transition and its security implications
ED

 TD: Line location does not change; 
no leakage
TD 
 Memory: 
Line is in LLC but in no L2; It is because of 
L2 self-conflicts, not due to attacker
TD 
 VD: 
Line location does not change. VD of every sharer receives a copy. 
no leakage
 
16
SecDir Blocks Directory Interference
 
Consider each directory transition and its security implications
ED

 TD: Line location does not change; 
no leakage
TD 
 Memory: 
Line is in LLC but in no L2; It is because of 
L2 self-conflicts, not due to attacker
TD 
 VD: 
Line location does not change. VD of every sharer receives a copy. 
no leakage
VD 
 Memory: L2 line is evicted; 
VD self-conflict, not due to attacker
 
17
S
e
c
D
i
r
 
p
r
e
v
e
n
t
s
 
c
a
c
h
e
 
l
i
n
e
 
e
v
i
c
t
i
o
n
s
d
u
e
 
t
o
 
a
t
t
a
c
k
e
r
 
i
n
d
u
c
e
d
 
d
i
r
e
c
t
o
r
y
 
i
n
t
e
r
f
e
r
e
n
c
e
SecDir Optimizations
18
 
Provides high associativity in VD
VD supports 
Cuckoo hashing 
to increase effective 
VD associativity
Delivers efficient directory lookup
Uses a “Early-Miss” (EM) bit
  
 skips many VD lookups
Experimental Setup and Benchmarks
 
Configurations: two 8-core designs
Baseline: Use Skylake-X directory (ED associativity=12)
SecDir: Take 4 ways from the ED to create the VD
Remaining ED is as big as L2
A
ugment VD in each slice with 28.5KB  
 
per-core VD is as big as L2
 
Benchmarks:
SPEC Mixes: Groups of programs running 8 threads, with different
characteristics
PARSEC: Individual parallel programs running with 8 threads
19
Evaluation Results – PARSEC
20
 
ED/TD conflicts migrate entries to VD without evicting L2 lines 
 fewer L2 misses
B: baseline
 
S: SecDir
Evaluation Results – PARSEC
21
 
Under benign conditions, the performance overhead is negligible
     + 
Fewer L2 misses
     -  VD accesses add 5-10 cycles
Summary: Secure and little performance impact
 
More in the paper & Discussion
 
More performance results for SPECMIX
Security discussion
VD timing issues
Performance evaluation
Effects of the two optimizations: cuckoo hashing and Early-Miss bits
Storage and area overhead
 
22
 
Conclusion
 
Directories are vulnerable to side-channel attacks [Yan et al, S&P’19]
Naïve solutions are not effective
C
o
n
t
r
i
b
u
t
i
o
n
:
 
S
e
c
D
i
r
Main idea: Take a portion of the storage used by conventional directory
and re-assign it to per-core private directory (Victim Directory)
Provides isolation inexpensively and scalably
Uses moderate storage
 
23
undefined
 
Q
&
A
 
SecDir Blocks Directory Interference
 
Consider each directory transition and its security implications
ED

 TD: Line location does not change; 
no leakage
TD 
 Memory: 
Line is in LLC but in no L2; 
L2 self-conflicts
TD 
 VD: 
Line location does not change. VD of every sharer receives a copy. 
no leakage
④ VD 
 TD: L2 wants to write back the cache line to LLC; 
L2 self-conflict
 
25
Evaluation of SPECMIX
26
 
Under benign conditions, the performance overhead is negligible
     + ED/TD conflicts migrate entries to VD: do not evict L2 lines 
 fewer L2 misses
     -  VD accesses add 5-10 cycles
Summary: Secure and little performance impact
Evaluation of SPECMIX
27
 
SecDir has fewer L2 misses because fewer directory conflicts
No VD hits (since no shared data) 
 VD accesses add 
to a DRAM latency
 
Directories in Non-inclusive Cache Hierarchies
 
Trend to have non-inclusive cache hierarchies
#cores ↑, LLC size ↑, latency ↑;
Thus, we want LLC access ↓, L2 size ↑
Too much duplication if inclusive
A
d
d
e
d
 
E
x
t
e
n
d
e
d
 
D
i
r
e
c
t
o
r
y
 
t
o
 
h
o
l
d
 
s
t
a
t
e
 
f
o
r
 
l
i
n
e
s
 
i
n
 
p
r
i
v
a
t
e
 
c
a
c
h
e
s
 
(
L
2
)
 
28
[Yan et al, S&P’19]
 
S
l
i
c
e
 
o
f
 
I
n
t
e
l
 
S
k
y
l
a
k
e
-
X
/
S
P
L
L
C
 
a
n
d
 
d
i
r
e
c
t
o
r
y
.
Naïve Secure Directory Designs
 
Strategy I: Substantially increase associativity of each directory slice
Unrealistic: Need too high associativity
29
 
To hide one cache block from the victim,
it requires
W
ED
 + W
TD
 > W
L2
 x (N-1) + W
L3
where W is associativity.
Evaluation Results – PARSEC
30
 
Similar results except that VD sometime hits:
- P1 brings data and its dir is evicted into VD
- P2 accesses the data
 
Still: Few VD hits:
- Speed of VD does not matter much
Directories are Vulnerable to Attacks
Every single line in the cache hierarchy has a directory entry
Attacker can cause conflicts in the directory 
 evicting a victim directory entry
This, in turn, evicts a victim cache line
31
 
traditional
directory
(TD)
 
v
i
c
t
i
m
core 0
 
a
t
t
a
c
k
e
r
core 1
 
P
r
i
v
a
t
e
L
2
 
extended
directory
(ED)
 
cache lines
 
S
h
a
r
e
d
L
L
C
s
l
i
c
e
 
Target
address
 
cache
line
 
directory
entry
 
Attacker's
addresses
[Yan et al, S&P’19]
Victim Directory Lookup
 
First ED/TD: one associative lookup; returns sharer info
Then VD:  lookups at multiple VD banks; returns one bit per core
32
 
VD Lookups Are Efficient: Not On Critical Paths
 
33
Minimizing VD Self-Conflicts
 
Organize VD as Cuckoo Directory
Performance: Longer lookup/insert latency
Security:
Reduce VD self-conflicts
Obscures victim self-conflict patterns
34
x
h
1
(x)
h
2
(x)
VD bank
Example: VD Offers High Associativity
Example: insert x into an almost full VD
35
(a) Before inserting item x
x
h
1
(x)
h
2
(x)
 
relocation
 
relocation
 
(b) After item x inserted
 
moved entry
 
not changed
entry
 
Early Detection of VD Misses
 
Under benign conditions: VD will be highly underutilized
Want to quickly detect when a VD access will miss 
 save E
Add an Empty Bit (EB) per set and bank
If all the entries in that set of that bank are Invalid 
  EB is set
 
36
SecDir Uses Low Area
 
VD does not store “sharing information”
More cores 
 More bits of sharing information
“saved”
37
 
Comparing the number of per-core VD entries
 
machine-wide to the number of L2 lines.
Values above 1
 
mean that the per-core VD has more entries than lines in L2.
 
B
a
s
e
l
i
n
e
:
 
S
k
y
l
a
k
e
-
X
 
d
i
r
e
c
t
o
r
y
 
(
W
E
D
=
1
2
)
.
S
e
c
D
i
r
:
 
T
a
k
e
 
s
o
m
e
 
E
D
 
w
a
y
s
 
f
o
r
 
V
D
.
 
F
o
r
e
x
a
m
p
l
e
,
 
k
e
e
p
 
W
E
D
=
8
 
(
s
u
c
h
 
t
h
a
t
 
E
D
 
c
a
n
h
o
l
d
 
a
s
 
m
a
n
y
 
l
i
n
e
s
 
a
s
 
L
2
)
.
Summary: by stealing 4
ways of ED, we quickly
attain a per-core VD that
has as many entries as L2
lines
Directories are Vulnerable to Attacks
 
As the victim re-accesses the data 
 directory entry reloaded
Attacker can observe the directory changing
 
 
38
[Yan S&P’19]
traditional
directory
v
i
c
t
i
m
core 0
a
t
t
a
c
k
e
r
core 1
P
r
i
v
a
t
e
c
a
c
h
e
extended
directory
(ED)
L
L
C
s
l
i
c
e
cache lines 
target
address
cache
line
directory
entry
attacker's
addresses
N
o
n
-
i
n
c
l
u
s
i
v
e
 
c
a
c
h
e
 
h
i
e
r
a
r
c
h
y
Other Results in the Paper
 
In an attack, the VD does prevent victim misses
The Empty bit (EB) saves 60-80% of the VD accesses
Under worst attack (i.e., all victim directory entries in the VD), the Cukoo
hashing eliminates many of the self-conflicts
Storage and area overhead of SecDir is small for 8 cores (for 44 cores, break
even)
39
Directory Basics (Snoop filter, Core valid bits)
 
Directory entry contains “sharer information” for a cache line.
E.g., 1 dirty bit + N presence bits, where N is # of cores in machine
Directory partitioned into 
slices 
like LLC 
using 
a hash function
As the number of cores increases, tendency toward non-inclusive caches.  
 Added
Extended Directory 
to hold state for lines in pvt caches (L2)
#sets
#ways
40
Ideal Secure Directory
 
Set aside some dir area to support many isolated partitions inexpensibly and
scalably.
Each partition should provide high associativity
Victim suffers minimal self-conflicts
Directory needs little area and can provide fast lookups
41
 
Current Directory Operation
 
42
 
SecDir Operations Provide Isolation
 
43
C
o
n
t
r
i
b
u
t
i
o
n
:
 
A
 
S
e
c
u
r
e
 
D
i
r
e
c
t
o
r
y
 
-
-
 
S
e
c
D
i
r
 
Take part of the storage used by conventional dir and re-assign it to per-core
private dirs: 
Victim Directory (VD)
Distributed VD for a core holds as many lines as in pvt L2
To provide high associativity, VD organized as Cuckoo directory
OK to be slower than main dir because it is a victim dir
Uses modest space because it does not keep sharer info (it is per-core)
Modeled a modified Intel Skylake dir 
 
Secure + negligible perf impact
44
 
SecDir Properties
 
Provides inexpensive and scalable isolation
Provides high associativity
Uses low storage
Delivers efficient directory lookup
 
45
 
Benchmarks
 
SPEC Mixes
Profile applications on baseline to classify them into
CCF (core cache fit); LLCF (LLC fit); LLCT (LLC
thrashing)
 
 
 
 
 
 
 
PARSEC
 
46
Directory Structure
 
Naïve organization of the “sharer information”:
Each entry has: 1 dirty bit + N presence bits
N: number of cores in the machine
Directory partitioned into 
slices using 
hash function
As the number of cores increases, tendency toward non-inclusive
caches.  
 Added 
Extended Directory
47
Directories for Non-Inclusive Caches
 
To hold a victim line, need a high per-slice associativity:
W
TD
 + W
ED
 > W
L2
 x (N-1) + W
L3
 
 
Directories
are easy
targets
48
Directories are Easy Targets
 
Victim reads line; data goes to L2 and dir info to ED
Attacker causes ED conflicts: dir info moves from ED to TD
Attacker causes TD conflicts: dir info evicted from TD; data evicted from
L2
49
Slide Note
Embed
Share

SecDir introduces a secure directory design to mitigate directory side-channel attacks, a critical security threat. By reassigning part of the conventional directory storage to per-core private directories, SecDir aims to block directory interference between processes and enhance security in cache hierarchies.

  • Secure Directory
  • Side-Channel Attacks
  • Cache Security
  • Directory Design
  • Security Threat

Uploaded on Sep 27, 2024 | 0 Views


Download Presentation

Please find below an Image/Link to download the presentation.

The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author. Download presentation by click this link. If you encounter any issues during the download, it is possible that the publisher has removed the file from their server.

E N D

Presentation Transcript


  1. SecDir: A Secure Directory to Defeat Directory Side-Channel Attacks Mengjia Yan*, Jen-Yang Wen, Christopher W. Fletcher, Josep Torrellas University of Illinois at Urbana-Champaign *University of Illinois at Urbana-Champaign/MIT ISCA, June 2019 1

  2. Motivation Cache-based side-channel attacks are serious security threats Directories are also vulnerable to side-channel attacks [Yan et al, S&P 19] It is challenging to design secure directories inexpensively and scalably Core L1 Core L1 Core L1 Core L1 L2 L2 L2 L2 Shared LLC directory 2 SecDir ISCA 19

  3. Contribution: A Secure Directory (SecDir) Key: Block directory interference between processes Main idea: Take a portion of the storage used by conventional directory and re-assign it to per-core private directory (Victim Directory) Core L1 Core L1 Core L1 Core L1 Core L1 Core L1 Core L1 Core L1 L2 L2 L2 L2 L2 L2 L2 L2 Shared LLC directory VD Shared LLC directory 3 SecDir ISCA 19

  4. Outline Background The Problem Threat Model SecDir Design Evaluation 4 SecDir ISCA 19

  5. Directory Basics Directory is used to keep presence information for cache lines A directory entry contains sharer information , address tag, coherence state Sharer information: N presence bits, where N is # of cores in machine Directory is partitioned into slices like LLC using a hash function 5 SecDir ISCA 19

  6. Directories in Non-inclusive Cache Hierarchies [Yan et al, S&P 19] Trend to have non-inclusive cache hierarchies Added Extended Directory to hold state for lines that are in private caches (L2) Slice of Intel Skylake-X/SP LLC and directory 6 SecDir ISCA 19

  7. Directories are Vulnerable to Side-Channel Attacks [Yan et al, S&P 19] Every single line in the cache hierarchy has a directory entry Directory conflict Evicts victim s directory entry Evicts victim s cache line Root cause: Limited per-slice directory associativity attacker core 1 victim core 0 attacker core 2 Private cache LLC slice traditional directory (TD) extended directory (ED) cache lines 7 SecDir ISCA 19

  8. Defense Goal & Threat Model Goal: A secure directory to block directory interference between processes Co-location Same-core Cross-core X Active Attack Strategy Passive * Victim self-conflicts (e.g. in victim s private structures) are not considered leakage 8 SecDir ISCA 19

  9. Nave Secure Directory Designs Are Not Scalable Strategy I: Substantially increase associativity of each directory slice Unrealistic: Need too high associativity (e.g. > 300 for a 22-core machine) attacker core 1 victim core 0 attacker core 2 attacker core N-1 Private cache LLC slice traditional directory (TD) extended directory (ED) cache lines 9 SecDir ISCA 19

  10. Nave Secure Directory Designs Are Not Scalable Strategy I: Substantially increase associativity of each directory slice Unrealistic: Need too high associativity (e.g. > 300 for a 22-core machine) Strategy II: Way-partition the directory slice (at least 1 way per security domain) Unacceptable: Inflexible, low performance and limiting 10 SecDir ISCA 19

  11. Our proposal: SecDir Main idea: Take part of the storage used by conventional directory and re-assign it to per- core private directories: Victim Directories (VD) Slice of Intel Skylake-X directory. VD bank Slice of SecDir. Provide per-core isolation 11 SecDir ISCA 19

  12. Our proposal: SecDir N: number of cores S: number of slices Provides inexpensive and scalable isolation Uses modest storage VD bank size = 1 Total VD per core = S 1 = L2 size ? L2 size ? L2 size VD size for a core is constant irrespective to N 12 SecDir ISCA 19

  13. SecDir Blocks Directory Interference Consider each directory transition and its security implications 13 SecDir ISCA 19

  14. SecDir Blocks Directory Interference Consider each directory transition and its security implications ED TD: Line location does not change; no leakage 14 SecDir ISCA 19

  15. SecDir Blocks Directory Interference Consider each directory transition and its security implications ED TD: Line location does not change; no leakage TD Memory: Line is in LLC but in no L2; It is because of L2 self-conflicts, not due to attacker 15 SecDir ISCA 19

  16. SecDir Blocks Directory Interference Consider each directory transition and its security implications ED TD: Line location does not change; no leakage TD Memory: Line is in LLC but in no L2; It is because of L2 self-conflicts, not due to attacker TD VD: Line location does not change. VD of every sharer receives a copy. no leakage 16 SecDir ISCA 19

  17. SecDir Blocks Directory Interference Consider each directory transition and its security implications ED TD: Line location does not change; no leakage TD Memory: Line is in LLC but in no L2; It is because of L2 self-conflicts, not due to attacker TD VD: Line location does not change. VD of every sharer receives a copy. no leakage VD Memory: L2 line is evicted; VD self-conflict, not due to attacker SecDir prevents cache line evictions due to attacker induced directory interference 17 SecDir ISCA 19

  18. SecDir Optimizations Provides high associativity in VD VD supports Cuckoo hashing to increase effective VD associativity Delivers efficient directory lookup Uses a Early-Miss (EM) bit skips many VD lookups 18 SecDir ISCA 19

  19. Experimental Setup and Benchmarks Configurations: two 8-core designs Baseline: Use Skylake-X directory (ED associativity=12) SecDir: Take 4 ways from the ED to create the VD Remaining ED is as big as L2 Augment VD in each slice with 28.5KB per-core VD is as big as L2 Benchmarks: SPEC Mixes: Groups of programs running 8 threads, with different characteristics PARSEC: Individual parallel programs running with 8 threads 19 SecDir ISCA 19

  20. Evaluation Results PARSEC ED/TD conflicts migrate entries to VD without evicting L2 lines fewer L2 misses B: baseline S: SecDir 20 SecDir ISCA 19

  21. Evaluation Results PARSEC Under benign conditions, the performance overhead is negligible + Fewer L2 misses - VD accesses add 5-10 cycles Summary: Secure and little performance impact 21 SecDir ISCA 19

  22. More in the paper & Discussion More performance results for SPECMIX Security discussion VD timing issues Performance evaluation Effects of the two optimizations: cuckoo hashing and Early-Miss bits Storage and area overhead 22 SecDir ISCA 19

  23. Conclusion Directories are vulnerable to side-channel attacks [Yan et al, S&P 19] Na ve solutions are not effective Contribution: SecDir Main idea: Take a portion of the storage used by conventional directory and re-assign it to per-core private directory (Victim Directory) Provides isolation inexpensively and scalably Uses moderate storage 23 SecDir ISCA 19

  24. Q&A 24

  25. SecDir Blocks Directory Interference Consider each directory transition and its security implications ED TD: Line location does not change; no leakage TD Memory: Line is in LLC but in no L2; L2 self-conflicts TD VD: Line location does not change. VD of every sharer receives a copy. no leakage VD TD: L2 wants to write back the cache line to LLC; L2 self-conflict 25 SecDir ISCA 19

  26. Evaluation of SPECMIX Under benign conditions, the performance overhead is negligible + ED/TD conflicts migrate entries to VD: do not evict L2 lines fewer L2 misses - VD accesses add 5-10 cycles Summary: Secure and little performance impact 26 SecDir ISCA 19

  27. Evaluation of SPECMIX SecDir has fewer L2 misses because fewer directory conflicts No VD hits (since no shared data) VD accesses add to a DRAM latency 27 SecDir ISCA 19

  28. Directories in Non-inclusive Cache Hierarchies [Yan et al, S&P 19] Trend to have non-inclusive cache hierarchies #cores , LLC size , latency ; Thus, we want LLC access , L2 size Too much duplication if inclusive Added Extended Directory to hold state for lines in private caches (L2) Slice of Intel Skylake-X/SP LLC and directory. 28 SecDir ISCA 19

  29. Nave Secure Directory Designs Strategy I: Substantially increase associativity of each directory slice Unrealistic: Need too high associativity attacker core 1 victim core 0 attacker core 2 attacker core N-1 Private cache To hide one cache block from the victim, it requires WED + WTD > WL2 x (N-1) + WL3 where W is associativity. LLC slice traditional directory (TD) extended directory (ED) cache lines 29 SecDir ISCA 19

  30. Evaluation Results PARSEC Similar results except that VD sometime hits: - P1 brings data and its dir is evicted into VD - P2 accesses the data Still: Few VD hits: - Speed of VD does not matter much 30 SecDir ISCA 19

  31. Directories are Vulnerable to Attacks [Yan et al, S&P 19] Every single line in the cache hierarchy has a directory entry Attacker can cause conflicts in the directory evicting a victim directory entry This, in turn, evicts a victim cache line directory entry cache line attacker core 1 victim core 0 Private L2 Target address Attacker's addresses cache lines Shared LLC slice traditional directory (TD) extended directory (ED) 31 SecDir ISCA 19

  32. Victim Directory Lookup First ED/TD: one associative lookup; returns sharer info Then VD: lookups at multiple VD banks; returns one bit per core 32 SecDir ISCA 19

  33. VD Lookups Are Efficient: Not On Critical Paths Transaction VD Operation TD Memory ------ Insert the address into the VDs of all the sharers. No search, cheap TD VD On L2 writeback: Search all VD banks to find the address and remove all the matches. Expensive, but no on critical paths VD TD On VD self-conflict: Remove the conflicting address from the VD bank. No search, cheap VD DRAM Read Read VD banks in batches. Stop when we hit in one Write Search all banks and invalidate the relevant copies 33 SecDir ISCA 19

  34. Minimizing VD Self-Conflicts Organize VD as Cuckoo Directory Performance: Longer lookup/insert latency Security: Reduce VD self-conflicts Obscures victim self-conflict patterns 1 a b VD bank 2 c d x 3 e f 4 g 34 SecDir ISCA 19

  35. Example: VD Offers High Associativity Example: insert x into an almost full VD not changed entry 1 a b 1 a b 2 c d 2 f d x moved entry 3 e f 3 e x relocation 4 g 4 g c relocation (a) Before inserting item x (b) After item x inserted 35 SecDir ISCA 19

  36. Early Detection of VD Misses Under benign conditions: VD will be highly underutilized Want to quickly detect when a VD access will miss save E Add an Empty Bit (EB) per set and bank If all the entries in that set of that bank are Invalid EB is set 36 SecDir ISCA 19

  37. SecDir Uses Low Area VD does not store sharing information More cores More bits of sharing information saved Baseline: Skylake-X directory (WED=12). SecDir: Take some ED ways for VD. For example, keep WED=8 (such that ED can hold as many lines as L2). Summary: by stealing 4 ways of ED, we quickly attain a per-core VD that has as many entries as L2 lines Comparing the number of per-core VD entries machine-wide to the number of L2 lines. Values above 1 mean that the per-core VD has more entries than lines in L2. 37 SecDir ISCA 19

  38. Directories are Vulnerable to Attacks [Yan S&P 19] As the victim re-accesses the data directory entry reloaded Attacker can observe the directory changing attacker core 1 victim core 0 Non-inclusive cache hierarchy Private cache directory entry cache line target address attacker's addresses LLC slice traditional directory extended directory (ED) cache lines 38 SecDir ISCA 19

  39. Other Results in the Paper In an attack, the VD does prevent victim misses The Empty bit (EB) saves 60-80% of the VD accesses Under worst attack (i.e., all victim directory entries in the VD), the Cukoo hashing eliminates many of the self-conflicts Storage and area overhead of SecDir is small for 8 cores (for 44 cores, break even) 39 SecDir ISCA 19

  40. Directory Basics (Snoop filter, Core valid bits) Directory entry contains sharer information for a cache line. E.g., 1 dirty bit + N presence bits, where N is # of cores in machine Directory partitioned into slices like LLC using a hash function As the number of cores increases, tendency toward non-inclusive caches. Added Extended Directory to hold state for lines in pvt caches (L2) Sharer Information Coherence State Address Tag #sets Data 40 SecDir ISCA 19

  41. Ideal Secure Directory Set aside some dir area to support many isolated partitions inexpensibly and scalably. Each partition should provide high associativity Victim suffers minimal self-conflicts Directory needs little area and can provide fast lookups 41 SecDir ISCA 19

  42. Current Directory Operation Transaction ED TD TD ED When Conflict in ED; Eviction of data from L2 Write to a line shared by multiple L2 42 SecDir ISCA 19

  43. SecDir Operations Provide Isolation Transaction TD Memory TD VD Explanation + Security Line is in LLC but in no L2. No leakage Line location does not change. To be safe, VD of every sharer receives a copy. No leakage L2 self-conflict. Requires searching all VDs. Safe leak VD self-conflict. Cannot move to TD due deadlock. Safe leak VD TD VD -> DRAM 43 SecDir ISCA 19

  44. Contribution: A Secure Directory -- SecDir Take part of the storage used by conventional dir and re-assign it to per-core private dirs: Victim Directory (VD) Distributed VD for a core holds as many lines as in pvt L2 To provide high associativity, VD organized as Cuckoo directory OK to be slower than main dir because it is a victim dir Uses modest space because it does not keep sharer info (it is per-core) Modeled a modified Intel Skylake dir Secure + negligible perf impact 44 SecDir ISCA 19

  45. SecDir Properties Provides inexpensive and scalable isolation Provides high associativity Uses low storage Delivers efficient directory lookup 45 SecDir ISCA 19

  46. Benchmarks SPEC Mixes Profile applications on baseline to classify them into CCF (core cache fit); LLCF (LLC fit); LLCT (LLC thrashing) PARSEC 46 SecDir ISCA 19

  47. Directory Structure Na ve organization of the sharer information : Each entry has: 1 dirty bit + N presence bits N: number of cores in the machine Directory partitioned into slices using hash function As the number of cores increases, tendency toward non-inclusive caches. Added Extended Directory 47 SecDir ISCA 19

  48. Directories for Non-Inclusive Caches Directories are easy targets To hold a victim line, need a high per-slice associativity: WTD + WED > WL2 x (N-1) + WL3 48 SecDir ISCA 19

  49. Directories are Easy Targets Victim reads line; data goes to L2 and dir info to ED Attacker causes ED conflicts: dir info moves from ED to TD Attacker causes TD conflicts: dir info evicted from TD; data evicted from L2 49 SecDir ISCA 19

More Related Content

giItT1WQy@!-/#giItT1WQy@!-/#giItT1WQy@!-/#giItT1WQy@!-/#giItT1WQy@!-/#giItT1WQy@!-/#giItT1WQy@!-/#