[aarch64-port-dev ] RFR: Fix runtime/7107135/Test7107135.jtr - execstack problems
Edward Nevill
ed at camswl.com
Fri Feb 28 06:40:10 PST 2014
Hi,
The following patch fixes a problem in the jtreg test suite.
The test is "runtime/7107135/Test7107135.jtr" which currently causes a SEGV on aarch64.
Basically what the test does is loads a shared library with executable stack set. The test then checks that the VM correctly detects this and re-enables the stack guard.
Now, on x86, if it is not specified in a shared library, it is assumed that the stack is executable. This is for historical reasons. On aarch64 it is assumed that the stack is not executable.
This lead to a path of execution where on aarch64 the VM thought that every shared library it loaded had executable stack!
Now because the kernel only enables executable stack on the first load of a dll with executable stack, the VM only restores the guard on the first load of a dll with executable stack.
This meant that when a genuine dll with executable stack was loaded, the VM did not re-enable the stack guard because it thinks it is not necessary because it has done so already.
I have tested this on both aarch64 and x86 and it now passes on both.
OK to push?
Ed.
--- CUT HERE ---
# HG changeset patch
# User Edward Nevill edward.nevill at linaro.org
# Date 1393597521 0
# Fri Feb 28 14:25:21 2014 +0000
# Node ID 0303ccd7b68d682d04e0a38d6f4de12357202ee9
# Parent ff7482096849f4ae0370de34cdbf3c24e94911a9
Fix runtime/7107135/Test7107135 - problems with execstack
diff -r ff7482096849 -r 0303ccd7b68d src/share/vm/utilities/elfFile.cpp
--- a/src/share/vm/utilities/elfFile.cpp Tue Feb 25 12:37:30 2014 -0500
+++ b/src/share/vm/utilities/elfFile.cpp Fri Feb 28 14:25:21 2014 +0000
@@ -217,7 +217,12 @@
}
}
}
+// x86 defaults to execstack, AARCH64 defaults to noexecstack
+#ifdef AARCH64
+ return true;
+#else
return false;
+#endif
}
#endif
--- CUT HERE ---
More information about the aarch64-port-dev
mailing list