aboutsummaryrefslogtreecommitdiffstats
path: root/arch/um/kernel/skas
diff options
context:
space:
mode:
authorPaolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>2006-05-01 15:16:04 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-05-01 21:17:45 -0400
commit275e6e1ee2bafde77e9390b27e876fa83f24cb60 (patch)
treefca0c0a7e3bdabe82bc75a0dad5c765f3b6edaf0 /arch/um/kernel/skas
parentcb8aa3d29b562e4c16fdfa4ecc8170ddc55397f4 (diff)
[PATCH] uml: fix compilation and execution with hardened GCC
To make some half-assembly stubs compile, disable various "hardened" GCC features: *) we can't make it build PIC code as we need %ebx to do syscalls and GCC wants it free for PIC *) we can't leave stack protection as the stub is moved (not relocated!) in memory so the RIP-relative access to the canary tries reading from an unmapped address and causes a segfault, since we move the stub of various megabytes (the exact amount will be decided at runtime) away from the link-time address. Signed-off-by: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it> Acked-by: Jeff Dike <jdike@addtoit.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'arch/um/kernel/skas')
-rw-r--r--arch/um/kernel/skas/Makefile9
1 files changed, 8 insertions, 1 deletions
diff --git a/arch/um/kernel/skas/Makefile b/arch/um/kernel/skas/Makefile
index 57181a920d48..ad842964707a 100644
--- a/arch/um/kernel/skas/Makefile
+++ b/arch/um/kernel/skas/Makefile
@@ -11,4 +11,11 @@ USER_OBJS := clone.o
11include arch/um/scripts/Makefile.rules 11include arch/um/scripts/Makefile.rules
12 12
13# clone.o is in the stub, so it can't be built with profiling 13# clone.o is in the stub, so it can't be built with profiling
14$(obj)/clone.o : c_flags = -Wp,-MD,$(depfile) $(call unprofile,$(USER_CFLAGS)) 14# GCC hardened also auto-enables -fpic, but we need %ebx so it can't work ->
15# disable it
16
17CFLAGS_clone.o := $(CFLAGS_NO_HARDENING)
18
19# since we're setting c_flags we _must_ add $(CFLAGS_$(*F).o).
20
21$(obj)/clone.o : c_flags = -Wp,-MD,$(depfile) $(call unprofile,$(USER_CFLAGS)) $(CFLAGS_$(*F).o)