RFR: JDK-8308350: Increase buffer size for jspawnhelper arguments [v2]
Thomas Stuefe
stuefe at openjdk.org
Thu May 18 09:22:19 UTC 2023
> Trivial fix for a small problem.
>
> jspawnhelper gets handed several file descriptors as arguments. The buffer size for this string is too small (7 chars per fd) to print out every conceivable int. This will overun the buffer if we happen to have fds larger than (printed size) 7 characters. This could lead to crashes or malfunctions if the parent VM has opened a large amount of file descriptors.
>
> Note that on Linux, this can normally not happen since the kernel limits the number of open file descriptors per process to 1M, and these fds are still printable within the limits of this buffer. It is possible to get more fds per process, but only via kernel patch. But we still should not rely on that. And there is also still MacOS using the same mechanism.
Thomas Stuefe has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains two additional commits since the last revision:
- Merge branch 'openjdk:master' into JDK-8308350-Increase-buffer-size-for-jspawnhelper-arguments
- JDK-8308350-Increase-buffer-size-for-jspawnhelper-arguments
-------------
Changes:
- all: https://git.openjdk.org/jdk/pull/14045/files
- new: https://git.openjdk.org/jdk/pull/14045/files/6fda35fb..dbce7ce1
Webrevs:
- full: https://webrevs.openjdk.org/?repo=jdk&pr=14045&range=01
- incr: https://webrevs.openjdk.org/?repo=jdk&pr=14045&range=00-01
Stats: 23 lines in 2 files changed: 23 ins; 0 del; 0 mod
Patch: https://git.openjdk.org/jdk/pull/14045.diff
Fetch: git fetch https://git.openjdk.org/jdk.git pull/14045/head:pull/14045
PR: https://git.openjdk.org/jdk/pull/14045
More information about the core-libs-dev
mailing list