Spectre Demo Source.c via Github Gist
The minimal set of CFLAGS that would toggle the success of the Spectre demo were
Code: Select all
-O2 -fno-plt -fno-commonNote that this attack relies upon cached data; it is interesting (for some value of...) to run the demo binary repeatedly, and see how the snooped data comes and goes. Optimization levels below -O2 or -Og and the secret string shows up almost immediately, if not then it converges on the secret string. With -O2, any portions of the secret string seem to quickly get flushed out: the hack can't get to the secret, and repeated attempts seem to make it less successful rather than more so.
Code: Select all
CFLAGS = -std=c99 -D__POWERPC__
MITIGATE = -O2 -pipe -fno-plt -fno-common
PROGRAM = spectre.out
SOURCE = Source.c
all: $(PROGRAM)
$(PROGRAM): $(SOURCE) ; $(CC) $(CFLAGS) -o $(PROGRAM) $(SOURCE)
clean: ; rm -f $(PROGRAM)
safe: $(SOURCE)
$(CC) $(CFLAGS) $(MITIGATE) -o $(PROGRAM) $(SOURCE)
----
Linux g2ppc-mini 4.15.3-gentoo #1 Tue Feb 13 20:18:30 MST 2018 ppc 7447A, altivec supported PowerMac10,1 GNU/Linux




