Integrated: JDK-8308350: Increase buffer size for jspawnhelper arguments
Thomas Stuefe
stuefe at openjdk.org
Thu May 18 14:04:01 UTC 2023
On Thu, 18 May 2023 07:08:57 GMT, Thomas Stuefe <stuefe at openjdk.org> wrote:
> 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.
This pull request has now been integrated.
Changeset: 808dc1b0
Author: Thomas Stuefe <stuefe at openjdk.org>
URL: https://git.openjdk.org/jdk/commit/808dc1b047c5a67b7397d47e38495efde022317d
Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod
8308350: Increase buffer size for jspawnhelper arguments
Reviewed-by: rriggs
-------------
PR: https://git.openjdk.org/jdk/pull/14045
More information about the core-libs-dev
mailing list