From 334324466b09fd63cef5664a0e7b20a35c817625 Mon Sep 17 00:00:00 2001 From: Samuel Aubertin Date: Fri, 28 Jan 2022 16:42:43 +0100 Subject: [PATCH] Style, more doc in README --- Makefile | 12 +++++------- README.md | 22 +++++++++++++++------- 2 files changed, 20 insertions(+), 14 deletions(-) diff --git a/Makefile b/Makefile index af72e71..88b486e 100644 --- a/Makefile +++ b/Makefile @@ -15,10 +15,9 @@ # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .PHONY: clean build upload .SILENT: -.NOTPARALLEL: -EXECUTABLES = clang gcc uuid rsync lld taskset -DEPENDENCIES := $(foreach exec,$(EXECUTABLES), $(if $(shell which $(exec) 2> /dev/null),X,$(error "No '$(exec)' in PATH, please install it and restart octopus !"))) +EXECUTABLES= clang gcc uuid rsync lld taskset +XXXX:= $(foreach exec,$(EXECUTABLES), $(if $(shell which $(exec) 2> /dev/null),X,$(error "No '$(exec)' in PATH, please install it and restart octopus !"))) ### Generic flags SRCS= spectre_v1 spectre_v2 @@ -50,9 +49,9 @@ VULN1:= $(shell cat /sys/devices/system/cpu/vulnerabilities/spectre_v1) VULN2:= $(shell cat /sys/devices/system/cpu/vulnerabilities/spectre_v2) ifndef PROGRESS -HIT_TOTAL != ${MAKE} ${MAKECMDGOALS} --dry-run PROGRESS="HIT_MARK" | grep -c "HIT_MARK" -HIT_COUNT = $(eval HIT_N != expr ${HIT_N} + 1)${HIT_N} -PROGRESS = echo "[`expr ${HIT_COUNT} '*' 100 / ${HIT_TOTAL}`%]" +HIT_TOTAL!= $(MAKE) $(MAKECMDGOALS) --dry-run PROGRESS="HIT_MARK" | grep -c "HIT_MARK" +HIT_COUNT= $(eval HIT_N != expr $(HIT_N) + 1)$(HIT_N) +PROGRESS= echo "[`expr $(HIT_COUNT) '*' 100 / $(HIT_TOTAL)`%]" endif SUB_ONE= $(word 1, $(subst -, ,$@)) @@ -108,7 +107,6 @@ PROGS+= $(RSCPROGS) PROGS+= $(RGROGS) PROGS+= $(RSGPROGS) - all: upload echo -e "\033[1mThank you for helping science today !\033[0m" diff --git a/README.md b/README.md index 7f0a1f9..e70d7e0 100644 --- a/README.md +++ b/README.md @@ -15,8 +15,13 @@ It measures the success rate of the attacks using different compilers: And compilation/linking flags such as: - Optimisation levels (```-O```) -- Static linking -- RETPOLINE +- Static/dynamic linking +- Masking and lfence as mitigation against Spectre V1 +- RETPOLINE as mitigation against Spectre V2 + +## Results + +Results are stored as JSON objects in an unique file for each run, following this pattern: ```result-$(UUID).json``` ## Dependencies @@ -24,20 +29,21 @@ And compilation/linking flags such as: - ```gcc``` - ```sftp``` - ```uuid``` -- The libC static symbols ```glibc-static``` +- The libC static symbols: ```glibc-static``` ## Execution -```make``` +Will build, execute and upload the results. +```make``` ### Build only -```make build``` +```make [-j XXX] build``` where ```XXX``` is the number of parallel processes. ## Results aggregation -Results are automatically uploaded to a server with ```sftp``` using a dedicated account. +Results are automatically uploaded to a server with a dedicated account using ```sftp```. Here is an exhaustive list of the data sent: - CPU model name and microcode version. @@ -49,7 +55,9 @@ Here is an exhaustive list of the data sent: **NONE** of this data will be used for anyhting else except this experiment. -## Sources +## References + +Both implementations are heavily inspired by: - [ErikAugust gist](https://gist.github.com/ErikAugust/724d4a969fb2c6ae1bbd7b2a9e3d4bb6) - [genua GmbH PoC](https://github.com/genua/meltdown)