From e6167b5aa63ab4efc2ad8b2fa3fe86a114ca360c Mon Sep 17 00:00:00 2001 From: Cyrill Gorcunov Date: Fri, 20 Jul 2012 19:39:25 +0400 Subject: [PATCH] make: Disable stack executable bit Otherwise crtools built with stack executable, in result kernel sets up current->personality |= READ_IMPLIES_EXEC; when our crtools get loaded into memory and mmap calls in restorer create VMAs with EXEC bit set. Signed-off-by: Cyrill Gorcunov Signed-off-by: Pavel Emelyanov --- Makefile.pie | 2 +- Makefile.syscall | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile.pie b/Makefile.pie index d3494252e..6f6a3d458 100644 --- a/Makefile.pie +++ b/Makefile.pie @@ -24,7 +24,7 @@ DEPS += $(patsubst %.o,%.d,$(POBJS)) DEPS += $(patsubst %.o,%.d,$(ROBJS)) PIELDS := pie.lds.S -PIEFLAGS := -fpie +PIEFLAGS := -fpie -Wa,--noexecstack ASMFLAGS := -D__ASSEMBLY__ $(PASM-OBJS): $(PASM-SRC) $(SYS-OBJ) diff --git a/Makefile.syscall b/Makefile.syscall index d307ebdb4..29e61a747 100644 --- a/Makefile.syscall +++ b/Makefile.syscall @@ -10,7 +10,7 @@ SYS-GEN := syscalls-x86-64.sh SYS-OBJ := $(patsubst %.S,%.o,$(SYS-ASM)) -SYS-FLAGS := -fpie -Wstrict-prototypes -D__ASSEMBLY__ -nostdlib -fomit-frame-pointer +SYS-FLAGS := -fpie -Wstrict-prototypes -Wa,--noexecstack -D__ASSEMBLY__ -nostdlib -fomit-frame-pointer $(SYS-ASM): $(SYS-GEN) $(SYS-DEF) $(SYS-ASM-COMMON) $(SYS-TYPES) $(E) " GEN " $@