"매 캐시 access timing 의 secret 를 leak". CPU cache 의 shared resource — attacker 가 victim 의 access pattern 을 timing 으로 observe 해서 key/data 를 복원. 2018 Spectre/Meltdown 이후 매 modern CPU 의 systemic threat — 2026 에도 hardware mitigation (Intel CET, ARM MTE) + software (constant-time crypto) 의 combo 가 필수.
매 핵심
매 attack primitives
Flush+Reload: 매 shared memory (libcrypto) — clflush 후 victim run, 다시 access timing 으로 hit/miss 판별. L3 inclusive cache 의 cross-core leak.
Prime+Probe: 매 shared memory 없을 때 — attacker 가 cache set 을 fill, victim run, attacker 의 reload 시 evicted line 의 timing spike.
Evict+Time: 매 victim 의 own execution time 측정 — coarser 매 cache state 무관.
Flush+Flush: 매 clflush 의 latency 자체로 hit/miss — quieter 매 PMU detection 회피.
// Build eviction set for target cache set (LLC)
voidprime(uint8_t**set,size_tways){for(size_ti=0;i<ways;i++){(void)*(volatileuint8_t*)set[i];}}intprobe_set(uint8_t**set,size_tways){uint64_ttotal=0;for(size_ti=0;i<ways;i++){uint64_tt0=rdtscp_serialized();(void)*(volatileuint8_t*)set[i];uint64_tt1=rdtscp_serialized();total+=(t1-t0);}returntotal>THRESHOLD;// victim accessed this set
}
Constant-time AES (defensive)
// 매 T-table lookup 의 X — bitsliced AES 의 use
// libgcrypt / OpenSSL 3.x 의 AES-NI fallback path 의 default
#include<wmmintrin.h>__m128iaes_round(__m128istate,__m128irk){return_mm_aesenc_si128(state,rk);// hardware, no table
}
clang -mspeculative-load-hardening -O2 victim.c -o victim
# 매 conditional masking 의 inject — speculative path 의 secret 을 0 으로 mask
Constant-time comparison
intct_memcmp(constvoid*a,constvoid*b,size_tn){constuint8_t*x=a,*y=b;uint8_tdiff=0;for(size_ti=0;i<n;i++)diff|=x[i]^y[i];returndiff;// 매 early-exit 의 X
}
Cache partitioning (Intel CAT)
# 매 LLC ways 의 isolate — victim domain 의 dedicated partition
pqos -e "llc:1=0x00ff;llc:2=0xff00"
pqos -a "core:1=1;core:2=2"
언제: red-team threat model 의 enumerate, mitigation review, constant-time code audit.
언제 X: 매 actual exploit chain — practical attack 은 매 hardware-specific 의 measurement, LLM 의 hallucinate 가능.
❌ 안티패턴
Table-based AES in shared lib: 매 T-table 의 cache footprint 가 key-dependent — Flush+Reload 의 즉시 leak.
Branch on secret: 매 BTB poisoning 의 vector — constant-time control flow 의 use.
memcmp on secrets: 매 early-exit timing — ct_memcmp 의 substitute.
SMT enabled in cloud: sibling thread 의 L1 share — 매 disable.
Trusting rdtsc jitter as defense: 매 attacker 의 amplify 가능 — fundamental fix 가 필요.