disable sse for everyone

GCC optimizes big switches with sse so we could clobber users floating
point registers when they would do a syscall

Reproducer:
```
 #include <stdio.h>
 #include <stdlib.h>

 union num {
 	float f;
 	unsigned long long i;
 };

 #define WORKSIZE (1024 * 1024 * 32)

 int main(int argc, char **argv) {
 	char *work = malloc(WORKSIZE);
 	char *fromaddr;
 	char sink;
 	union num r;
 	unsigned long long int offset;

 	r.f = drand48();
 	printf("r: %llx\n", (long long)r.i);
 	offset = (long long int)(r.f * (double)WORKSIZE);
 	fromaddr = work + offset;
 	printf("%e %llx %llx\n", r.f, offset, fromaddr);
 	sink = *fromaddr;

 	return 0;
 }
```

Change-Id: I7bb0883ec8ef2f245ab98064e308025422afc115
This commit is contained in:
Dominique Martinet
2018-07-02 18:26:57 +09:00
committed by Dominique Martinet
parent eae5c40f60
commit bc3e6ded65

View File

@ -19,7 +19,7 @@ endif
CFLAGS += -I$(SRC)/include -I@abs_builddir@/../ -I@abs_builddir@/include -D__KERNEL__ -g -fno-omit-frame-pointer -fno-inline -fno-inline-small-functions
ifneq ($(ARCH), arm64)
CFLAGS += -mcmodel=large -mno-red-zone
CFLAGS += -mcmodel=large -mno-red-zone -mno-sse
endif
LDFLAGS += -e arch_start
IHKOBJ = ihk/ihk.o