Skip to content

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

flush-reload-xarch

CSE 531 Computer Security project — Flush+Reload cache side-channel reproduced across six CPU microarchitectures, with two attack scenarios and a CWE taxonomy mapping.

Architectures measured

Architecture CPU Environment
Intel Raptor Lake (client hybrid) i7-13700 Ubuntu Linux
Intel Sapphire Rapids (server) Xeon w9-3495X Ubuntu Linux
Intel Alder Lake-N (low-power) N150 Ubuntu Linux
AMD Zen 3 Ryzen 5 5600X Ubuntu on WSL2
Apple Silicon M3 Pro macOS
ARM Neoverse N2 Azure Cobalt 100 (Dpsv6) Ubuntu Linux (Azure VM, spun up + torn down via Azure CLI)

Status

Milestone State
1. Latency-histogram calibration done on all 6 archs
2. Covert-channel PoC + bandwidth/BER sweep done on all 6 archs
3. Side-channel key-recovery PoC done; 20-run stats CSV captured
4. CWE-1194 taxonomy table done (18 attacks mapped)
5. Report (IEEE 2-column) done
6. Slide deck done

Quick build (Linux x86 / Linux ARM)

sudo apt-get install -y build-essential python3-matplotlib
make

On Apple Silicon (macOS) the same make works — the covert_common.h header dispatches automatically (Linux ARM uses native DC CIVAC + 1 GHz CNTVCT; Apple Silicon falls back to an eviction-based flush + helper-thread counter, since DC CIVAC is a userspace no-op on Apple).

Binaries

Binary Role
latency_histogram Calibration: prints HIT/MISS cycle CSV for one cache line.
sender / receiver Covert-channel pair. 64-bit preamble auto-calibrates threshold; train BER and held-out BER reported separately.
victim_keyed / spy_keyed Side-channel key-recovery PoC. Victim loops a hardcoded 128-bit secret; spy phase-locks on a "kick" line (RSA-routine-entry analogue) and reconstructs the key by majority vote.

Scripts

Script Purpose
scripts/run_covert.sh <msg> <period_ns> Single covert-channel run with start-time sync.
scripts/sweep_bandwidth.sh <machine_tag> [pairs_file] Matrix of (core-pair × period) → CSV. Pair files in scripts/pairs_*.txt.
scripts/run_key_recovery.sh <delay_us> <n_repeats> One key-recovery trial.
scripts/key_recovery_stats.sh <n_runs> <delay_us> <n_repeats> N trials → results/key_recovery_stats.csv.
scripts/sweep_m3.sh Honest M3 sweep at very low rates.
scripts/plot_latency.py Two-peak HIT/MISS histogram for one machine.
scripts/plot_sweep.py <csv...> Bandwidth-vs-BER curves; multi-file overlays.

Results files

results/
├── <machine>.csv          latency-histogram raw samples
├── <machine>.png          latency histogram plot
├── <machine>.sweep.csv    bandwidth × core-pair × BER
├── <machine>.sweep.log    stderr from the sweep
├── key_recovery_stats.csv 20-run side-channel statistics (Raptor Lake)
└── sweep_combined.png     all-architecture overlay

Machine tags: raptor_lake, sapphire_rapids, alder_lake_n150, zen3_5600x, m3pro, neoverse_n2.

Layout

flush-reload-xarch/
├── Makefile
├── README.md
├── src/
│   ├── covert_common.h
│   ├── latency_histogram.c
│   ├── sender.c
│   ├── receiver.c
│   ├── victim_keyed.c
│   └── spy_keyed.c
├── scripts/
│   ├── run_covert.sh
│   ├── sweep_bandwidth.sh
│   ├── run_key_recovery.sh
│   ├── key_recovery_stats.sh
│   ├── sweep_m3.sh
│   ├── plot_latency.py
│   ├── plot_sweep.py
│   ├── pairs_zen3.txt
│   ├── pairs_spr.txt
│   ├── pairs_n150.txt
│   ├── pairs_neoverse.txt
│   └── pairs_m3.txt
└── results/

Known limitations / methodology notes

  • WSL2 (Zen 3) measurements run inside a Hyper-V VM — cache topology and scheduler jitter differ from bare metal. Documented in the comparison section.
  • Apple M3 Pro: covert channel works at only ~10-50 bps; eviction-based flush is high-overhead and Apple's DMP prefetcher repopulates lines.
  • Cloud Neoverse N2: 2 vCPU shared-tenant VM adds noise; the BER trend is representative, the absolute numbers are not bare-metal-grade.
  • Sapphire Rapids cross-core-far (CPU 0 ↔ 55): an initial run showed ~40-60 % BER that first looked like a mesh-interconnect distance penalty, but repeated runs traced it to co-tenant load on the shared workstation — not interconnect distance. When the machine is idle, every pair (including the far corner) is clean. Detailed in the report's comparison section.
  • Threshold calibration: the receiver computes its threshold from the first half of the preamble and reports held-out BER on the second half, separating training error from generalisation error.

About

Cross-architecture Flush+Reload reproduction on six modern CPUs (CSE 531 course project)

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages