-
Enhancement
-
Resolution: Fixed
-
P4
-
11, 17, 21, 22, 23
-
b15
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8331949 | 22.0.2 | Aleksey Shipilev | P4 | Resolved | Fixed | b06 |
JDK-8332133 | 21.0.4 | Aleksey Shipilev | P4 | Resolved | Fixed | b03 |
JDK-8334407 | 17.0.13 | Aleksey Shipilev | P4 | Resolved | Fixed | b01 |
We expect that only JDK invokes jspawnhelper. But there are two corner cases.
First, someone could call jspawnhelper directly. There is a warning message printed in some cases, for example when jspawnhelper is invoked without arguments: "This command is not for general use and should only be run as the result of a call to ProcessBuilder.start() or Runtime.exec() in a java application". Quick googling shows that projects still ignore this warning. See for example Zimbra (https://wiki.zimbra.com/wiki/Jspawnhelper): "One example of legitimate use [sic! -Aleksey] of jspawnhelper is by zmprov, the command line utility to provision accounts on Zimbra."
Second, there is a minuscule chance of system misconfiguration when jspawnhelper from another JDK would be executed instead of one shipping with invoking JDK. Current code figures out the jspawnhelper path from `java.home` property, which looks safe-ish, but it would be even better to make sure. There is also the report from Ubuntu: https://bugs.launchpad.net/ubuntu/+source/openjdk-17/+bug/2055280 -- that unattended upgrade replaced the JDK under the running JVM, which effectively replaced the old jspawnhelper with an incompatible one. This is arguably the upgrade process problem, as JDK is not guaranteed to work when its contents are overwritten, but we want to catch that error consistently.
I think we can make jspawnhelper checks a bit better by handshaking on explicit JDK/VM version. Something like `VERSION_STRING` already defined by the build system can be compiled into the `jspawnhelper` and checked against.
- backported by
-
JDK-8331949 Improve jspawnhelper version checks
- Resolved
-
JDK-8332133 Improve jspawnhelper version checks
- Resolved
-
JDK-8334407 Improve jspawnhelper version checks
- Resolved
- relates to
-
JDK-8310265 (process) jspawnhelper should not use argv[0]
- Closed
-
JDK-8325567 jspawnhelper without args fails with segfault
- Closed
- links to
-
Commit openjdk/jdk17u-dev/d056b73c
-
Commit openjdk/jdk21u-dev/fa874b3d
-
Commit openjdk/jdk22u/7b1ae122
-
Commit openjdk/jdk/a232e8fb
-
Review openjdk/jdk17u-dev/2592
-
Review openjdk/jdk21u-dev/547
-
Review openjdk/jdk22u/181
-
Review openjdk/jdk/18204