[PATCH] Set GNU stack marking for non-executable stack on Linux
Tim Bell
Tim.Bell at Sun.COM
Thu May 10 17:55:35 PDT 2007
Forwarded message
Please update your address books. Stop using hotspot-dev at openjdk.dev.java.net
^^^^
and use hotspot-dev at openjdk.java.net instead (note the missing .dev).
-------- Original Message --------
The attached patch adds the GNU stack markings so that the stack is not
marked as RWX (both writable and executable). This is actually a minor
issues as with an enforced PaX (NX), Java will still not work because
of the JIT compiler, but at least it will remove one issue present
after building OpenJDK.
I'm not sure how the released binaries don't have the stacks marked as
executable, I suppose something might be mangling them afterward, but
this should cover the issue from the start.
The optimal way to handle this would have been to have it conditional
to Linux and ELF target, but that would have required to have
pre-processed sources (.S, rather than .s), and the two source files
are only for Linux (and thus only for ELF) anyway.
It also requires GNU as, but I think that is true already.
--=
Diego "Flameeyes" Petten=C3=B2
http://farragut.flameeyes.is-a-geek.org/
--MP_m0vvBlEIdtBj7CmDh5DKDIs
Content-Type: text/x-patch; name=openjdk-execstac.patch
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment; filename=openjdk-execstac.patch
Index: openjdk/hotspot/src/os_cpu/linux_amd64/vm/linux_amd64.s
==========================
==========================
=================
--- openjdk.orig/hotspot/src/os_cpu/linux_amd64/vm/linux_amd64.s
+++ openjdk/hotspot/src/os_cpu/linux_amd64/vm/linux_amd64.s
@@ -401,3 +401,5 @@ acl_CopyLeft:
addq $4,%rdx
jg 4b
ret
+
+.section .note.GNU-stack,"",%progbits
Index: openjdk/hotspot/src/os_cpu/linux_i486/vm/linux_i486.s
==========================
==========================
=================
--- openjdk.orig/hotspot/src/os_cpu/linux_i486/vm/linux_i486.s
+++ openjdk/hotspot/src/os_cpu/linux_i486/vm/linux_i486.s
@@ -651,3 +651,4 @@ _Atomic_cmpxchg_long:
popl %ebx
ret
=
+.section .note.GNU-stack,"",%progbits
-------------- next part --------------
An embedded message was scrubbed...
From: Diego 'Flameeyes' =?UTF-8?B?UGV0dGVuw7I=?= <flameeyes at gmail.com>
Subject: [PATCH] Set GNU stack marking for non-executable stack on Linux
Date: Thu, 10 May 2007 22:20:17 +0200
Size: 4703
Url: http://mail.openjdk.java.net/pipermail/hotspot-dev/attachments/20070510/b98e6aed/attachment.mht
More information about the hotspot-dev
mailing list