changeset 3217:513b121b3a0f

PR2522: Add executable stack markings to callNative.S on JamVM 2015-07-13 Andrew John Hughes <gnu_andrew@member.fsf.org> PR2522: Add executable stack markings to callNative.S on JamVM * Makefile.am: (ICEDTEA_PATCHES): Add patch. (jamvm): Drop setting -noexecstack in LDFLAGS; replaced by code fix in JamVM. * NEWS: Updated. * patches/jamvm/noexecstack.patch: Add notes to assembly files in order to turn off executable stack.
author Andrew John Hughes <gnu.andrew@redhat.com>
date Wed, 22 Jul 2015 16:36:15 +0100
parents b755ea6f65cb
children ead3ddec2474
files ChangeLog Makefile.am NEWS patches/jamvm/noexecstack.patch
diffstat 4 files changed, 65 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Wed Jul 22 16:27:58 2015 +0100
+++ b/ChangeLog	Wed Jul 22 16:36:15 2015 +0100
@@ -1,3 +1,16 @@
+2015-07-13  Andrew John Hughes  <gnu_andrew@member.fsf.org>
+
+	PR2500: Add executable stack markings
+	to callNative.S on JamVM
+	* Makefile.am:
+	(ICEDTEA_PATCHES): Add patch.
+	(jamvm): Drop setting -noexecstack in
+	LDFLAGS; replaced by code fix in JamVM.
+	* NEWS: Updated.
+	* patches/jamvm/noexecstack.patch:
+	Add notes to assembly files in order to
+	turn off executable stack.
+
 2015-07-13  Andrew John Hughes  <gnu_andrew@member.fsf.org>
 
 	PR2507, G541462: Only apply PaX markings by default
--- a/Makefile.am	Wed Jul 22 16:27:58 2015 +0100
+++ b/Makefile.am	Wed Jul 22 16:36:15 2015 +0100
@@ -677,7 +677,8 @@
 
 if BUILD_JAMVM
 ICEDTEA_PATCHES += \
-	patches/jamvm/pr2190-find_class_from_caller.patch
+	patches/jamvm/pr2190-find_class_from_caller.patch \
+	patches/jamvm/noexecstack.patch
 endif
 
 if ENABLE_NSS
@@ -2422,7 +2423,6 @@
 stamps/jamvm.stamp: $(OPENJDK_TREE) stamps/rt.stamp
 if BUILD_JAMVM
 	cd jamvm/jamvm && \
-	LDFLAGS="-Xlinker -z -Xlinker noexecstack" \
 	./autogen.sh --with-java-runtime-library=openjdk6 \
 	  --prefix=$(abs_top_builddir)/jamvm/install ; \
 	$(MAKE) ; \
--- a/NEWS	Wed Jul 22 16:27:58 2015 +0100
+++ b/NEWS	Wed Jul 22 16:36:15 2015 +0100
@@ -55,6 +55,8 @@
   - PR2481, RH489586, RH1236619: OpenJDK can't handle spaces in zone names in /etc/sysconfig/clock
   - PR2486: JSSE server is still limited to 768-bit DHE
   - PR2508, G541462: Only apply PaX markings by default on running PaX kernels
+* JamVM
+  - PR2522: Add executable stack markings to callNative.S on JamVM
 
 New in release 1.13.7 (2015-04-14):
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/jamvm/noexecstack.patch	Wed Jul 22 16:36:15 2015 +0100
@@ -0,0 +1,48 @@
+diff --git a/src/os/linux/arm/callNative.S jamvm/jamvm/src/os/linux/arm/callNative.S
+index 245afd1..1583023 100644
+--- jamvm.orig/jamvm/src/os/linux/arm/callNative.S
++++ jamvm/jamvm/src/os/linux/arm/callNative.S
+@@ -36,3 +36,7 @@
+ #include "callNativeOABI.S"
+ #endif
+ #endif
++
++#if defined(__linux__) && defined(__ELF__)
++.section .note.GNU-stack,"",%progbits
++#endif
+diff --git jamvm.orig/jamvm/src/os/linux/mips/callNative.S jamvm/jamvm/src/os/linux/mips/callNative.S
+index cede343..90d9163 100644
+--- jamvm.orig/jamvm/src/os/linux/mips/callNative.S
++++ jamvm/jamvm/src/os/linux/mips/callNative.S
+@@ -184,3 +184,7 @@ return:
+ 	j $31
+ 	.end callJNIMethod
+ #endif
++
++#if defined(__linux__) && defined(__ELF__)
++.section .note.GNU-stack,"",%progbits
++#endif
+diff --git jamvm.orig/jamvm/src/os/linux/powerpc/callNative.S jamvm/jamvm/src/os/linux/powerpc/callNative.S
+index aa47f6a..763dc0a 100644
+--- jamvm.orig/jamvm/src/os/linux/powerpc/callNative.S
++++ jamvm/jamvm/src/os/linux/powerpc/callNative.S
+@@ -281,3 +281,7 @@ return:
+         mr 1,11
+         blr
+ #endif
++
++#if defined(__linux__) && defined(__ELF__)
++.section .note.GNU-stack,"",%progbits
++#endif
+diff --git jamvm.orig/jamvm/src/os/linux/x86_64/callNative.S jamvm/jamvm/src/os/linux/x86_64/callNative.S
+index 26404e6..9fb5cdf 100644
+--- jamvm.orig/jamvm/src/os/linux/x86_64/callNative.S
++++ jamvm/jamvm/src/os/linux/x86_64/callNative.S
+@@ -267,3 +267,7 @@ float_ret:
+     addq    $8, %rcx
+     jmp     return
+ #endif
++
++#if defined(__linux__) && defined(__ELF__)
++.section .note.GNU-stack,"",%progbits
++#endif