From cd184d861f5702e0ec5855e7247584c799bd24a2 Mon Sep 17 00:00:00 2001 From: Iru Cai Date: Wed, 10 Apr 2019 16:00:23 +0800 Subject: add attack code and attack test script --- attack_test.sh | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100755 attack_test.sh (limited to 'attack_test.sh') diff --git a/attack_test.sh b/attack_test.sh new file mode 100755 index 000000000..a50b3bc86 --- /dev/null +++ b/attack_test.sh @@ -0,0 +1,28 @@ +#!/bin/bash + +GEM5="./build/X86_MESI_Two_Level/gem5.opt -q configs/example/se.py --cpu-type=DerivO3CPU --ruby --needsTSO=1 --output=stdout.txt" +SCMS=( +"--scheme=UnsafeBaseline" +"--scheme=SpectreSafeInvisibleSpec --useIFT=0" +"--scheme=SpectreSafeInvisibleSpec --useIFT=1 --trackBranch=0" +"--scheme=SpectreSafeInvisibleSpec --useIFT=1 --trackBranch=1" +"--scheme=SpectreSafeFence --useIFT=0" +"--scheme=SpectreSafeFence --useIFT=1 --trackBranch=0" +"--scheme=SpectreSafeFence --useIFT=1 --trackBranch=1" +) + +echo "Testing Spectre PoC victim function" +for scm in "${SCMS[@]}" +do + echo "$scm" + $GEM5 $scm -c attack + grep hit stdout.txt && echo unsafe || echo safe +done + +echo "Testing victim function v10" +for scm in "${SCMS[@]}" +do + echo "$scm" + $GEM5 $scm -c attack_v10 + grep '^[123]' stdout.txt && echo unsafe || echo safe +done -- cgit v1.2.3