From 56bd6fac14c7aeb801949d2c2f5e206c936da299 Mon Sep 17 00:00:00 2001 From: Stefan Gehn Date: Sat, 27 Sep 2014 16:30:50 +0200 Subject: [PATCH] Enable ASLR and DEP on Windows builds Always enable ASLR and DEP when building GKrellM on Windows. Since GKrellM also does network communication bugs like buffer overflows and the like may eventually allow remote code execution. By enabling these build flags such attacks should be quite a bit more complicated (although still not impossible). --- server/Makefile | 2 +- src/Makefile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/server/Makefile b/server/Makefile index e6e947a..7050d00 100644 --- a/server/Makefile +++ b/server/Makefile @@ -130,7 +130,7 @@ windows: libgkrellmd.a $(MAKE) \ BINEXT=".exe" \ CFLAGS="${CFLAGS} -D_WIN32_WINNT=0x0501 -DWINVER=0x0501 -DWIN32_LEAN_AND_MEAN" \ - LINK_FLAGS="-mconsole" \ + LINK_FLAGS="-mconsole -Wl,--dynamicbase -Wl,--nxcompat" \ EXTRAOBJS="${EXTRAOBJS} win32-resource.o win32-plugin.o" \ SYS_LIBS="-lws2_32 -lwtsapi32 -lpdh -lnetapi32 -liphlpapi -lintl" \ all diff --git a/src/Makefile b/src/Makefile index e385825..3e67bbd 100644 --- a/src/Makefile +++ b/src/Makefile @@ -168,7 +168,7 @@ windows: libgkrellm.a $(MAKE) \ BINEXT=".exe" \ CFLAGS="${CFLAGS} -D_WIN32_WINNT=0x0501 -DWINVER=0x0501 -DWIN32_LEAN_AND_MEAN" \ - LINK_FLAGS="-mwindows" \ + LINK_FLAGS="-mwindows -Wl,--dynamicbase -Wl,--nxcompat" \ EXTRAOBJS="${EXTRAOBJS} winops-win32.o win32-plugin.o win32-resource.o" \ SYS_LIBS="-lws2_32 -lwtsapi32 -lpdh -lnetapi32 -liphlpapi -lintl" \ X11_LIBS="" \