-
Notifications
You must be signed in to change notification settings - Fork 732
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Is the execstack flag required on any of the shared libraries? #20956
Comments
I don't think it's explicitly set, since I can't find it in the code. I did find some occurrences of I found this in the doc: |
Are your execstack results from zlinux? I looked on X and while jit has it, vm does not. |
From searching around, apparently when we link with object files produced from assembly sources (.s), those object files are assumed to potentially require executable stack unless they have a special section The VM has this (somewhat) recent change, which might prevent newer VM libraries from indicating a need for executable stack. I think it was done to avoid the warning that was introduced in binutils 2.39:
Maybe the JIT still has some assembly sources that are missing the magic incantation. The JIT library that I most recently built on my system doesn't demand executable stack, but it seems to be due to a difference in the behaviour of the |
I was testing on X linux |
I've seen the same as Peter in a few builds with and without #20278, so apparently something else was already making sure that the VM library wouldn't have executable stack, at least at the time when that went in |
Interesting. I checked the ones I have quickly available; |
I found the link commands for both the VM and JIT libraries from a build log on my machine, and I lightly edited them to run using Re-linking the libraries with #20284 and #20278 reverted, both had executable stack Re-linking them without anything reverted OTOH, only the JIT library had executable stack This was with a CMake build of JDK17 on x86-64 Linux. It would seem that the new The With the VM's assembly sources out of the way, it seems that the problem (in my build...) is now just due to the .nasm files. I managed to link a JIT library with non-executable stack by adding
to each of the following files:
I'm not sure we should go about it that way though. We'd have to do the same exercise for every ISA, and it would be easy to accidentally make the stack executable again by introducing a new assembly file and forgetting the stack permissions section I think it would be better to link using
And apparently this does get passed to a bunch of link commands, mostly to produce binaries in support/modules_cmds, support/modules_libs, and support/test, but it doesn't get passed into any of the commands that link libj9*.so As for the builds that I looked at before, they were UMA builds, not CMake builds. Maybe in those some Anyway, at this point I think I'm out of my depth 😅 |
A customer reports failures of the JVM when running with SELinux enabled and configured to disallow execstack. The problem occurs because libj9jit29.so and libj9vm29.so are both flagged as requiring execstack. As an experiment I cleared the flag on both libraries and was able to run -version and a standard benchmark without problems. Is it possible that these libraries have been flagged in error?
I tested using Java 17.0.12.1 where both libraries are marked:
and also with ibm sdk 8.0.8.30 where only the jit library is affected. As a footnote, there is also at least one library in WebSphere that has the same problem.
The text was updated successfully, but these errors were encountered: