Style, more doc in README
This commit is contained in:
		
							
								
								
									
										12
									
								
								Makefile
									
									
									
									
									
								
							
							
						
						
									
										12
									
								
								Makefile
									
									
									
									
									
								
							@@ -15,10 +15,9 @@
 | 
				
			|||||||
# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 | 
					# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 | 
				
			||||||
.PHONY: clean build upload 
 | 
					.PHONY: clean build upload 
 | 
				
			||||||
.SILENT:
 | 
					.SILENT:
 | 
				
			||||||
.NOTPARALLEL:
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
EXECUTABLES = clang gcc uuid rsync lld taskset
 | 
					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 !")))
 | 
					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
 | 
					### Generic flags
 | 
				
			||||||
SRCS=		spectre_v1 spectre_v2
 | 
					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)
 | 
					VULN2:=		$(shell cat /sys/devices/system/cpu/vulnerabilities/spectre_v2)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
ifndef PROGRESS
 | 
					ifndef PROGRESS
 | 
				
			||||||
HIT_TOTAL != ${MAKE} ${MAKECMDGOALS} --dry-run PROGRESS="HIT_MARK" | grep -c "HIT_MARK"
 | 
					HIT_TOTAL!=	$(MAKE) $(MAKECMDGOALS) --dry-run PROGRESS="HIT_MARK" | grep -c "HIT_MARK"
 | 
				
			||||||
HIT_COUNT = $(eval HIT_N != expr ${HIT_N} + 1)${HIT_N}
 | 
					HIT_COUNT= 	$(eval HIT_N != expr $(HIT_N) + 1)$(HIT_N)
 | 
				
			||||||
PROGRESS = echo "[`expr ${HIT_COUNT} '*' 100 / ${HIT_TOTAL}`%]"
 | 
					PROGRESS= 	echo "[`expr $(HIT_COUNT) '*' 100 / $(HIT_TOTAL)`%]"
 | 
				
			||||||
endif
 | 
					endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
SUB_ONE=	$(word 1, $(subst -, ,$@))
 | 
					SUB_ONE=	$(word 1, $(subst -, ,$@))
 | 
				
			||||||
@@ -108,7 +107,6 @@ PROGS+=		$(RSCPROGS)
 | 
				
			|||||||
PROGS+=		$(RGROGS)
 | 
					PROGS+=		$(RGROGS)
 | 
				
			||||||
PROGS+=		$(RSGPROGS)
 | 
					PROGS+=		$(RSGPROGS)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					 | 
				
			||||||
all: upload
 | 
					all: upload
 | 
				
			||||||
	echo -e "\033[1mThank you for helping science today !\033[0m"
 | 
						echo -e "\033[1mThank you for helping science today !\033[0m"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										22
									
								
								README.md
									
									
									
									
									
								
							
							
						
						
									
										22
									
								
								README.md
									
									
									
									
									
								
							@@ -15,8 +15,13 @@ It measures the success rate of the attacks using different compilers:
 | 
				
			|||||||
And compilation/linking flags such as:
 | 
					And compilation/linking flags such as:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
- Optimisation levels (```-O```)
 | 
					- Optimisation levels (```-O```)
 | 
				
			||||||
- Static linking
 | 
					- Static/dynamic linking
 | 
				
			||||||
- RETPOLINE
 | 
					- 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
 | 
					## Dependencies
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -24,20 +29,21 @@ And compilation/linking flags such as:
 | 
				
			|||||||
- ```gcc```
 | 
					- ```gcc```
 | 
				
			||||||
- ```sftp```
 | 
					- ```sftp```
 | 
				
			||||||
- ```uuid```
 | 
					- ```uuid```
 | 
				
			||||||
- The libC static symbols ```glibc-static```
 | 
					- The libC static symbols: ```glibc-static```
 | 
				
			||||||
 | 
					
 | 
				
			||||||
## Execution
 | 
					## Execution
 | 
				
			||||||
 | 
					
 | 
				
			||||||
```make```
 | 
					Will build, execute and upload the results.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					```make```
 | 
				
			||||||
 | 
					
 | 
				
			||||||
### Build only 
 | 
					### Build only 
 | 
				
			||||||
 | 
					
 | 
				
			||||||
```make build```
 | 
					```make [-j XXX] build``` where ```XXX``` is the number of parallel processes.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
## Results aggregation
 | 
					## 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:
 | 
					Here is an exhaustive list of the data sent:
 | 
				
			||||||
- CPU model name and microcode version.
 | 
					- 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.
 | 
					**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)
 | 
					- [ErikAugust gist](https://gist.github.com/ErikAugust/724d4a969fb2c6ae1bbd7b2a9e3d4bb6)
 | 
				
			||||||
- [genua GmbH PoC](https://github.com/genua/meltdown)
 | 
					- [genua GmbH PoC](https://github.com/genua/meltdown)
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user