Integrated: 7903686: jtreg Agent should use loopback address

Jaikiran Pai jpai at openjdk.org
Thu Mar 7 06:59:08 UTC 2024


On Fri, 1 Mar 2024 12:01:08 GMT, Jaikiran Pai <jpai at openjdk.org> wrote:

> Can I please get a review of this change which proposes to address https://bugs.openjdk.org/browse/CODETOOLS-7903686?
> 
> The jtreg framework when handling "agentvm" mode, creates a `java.net.ServerSocket` in the jtreg process and then launches a JVM with `com.sun.javatest.regtest.agent.AgentServer` as the main class, passing it the port to which the `ServerSocket` is bound to. The `AgentServer` is then responsible for creating a `java.net.Socket` and connecting against the jtreg process' `ServerSocket`. In its current form, the `ServerSocket` is bound to "any address" which means that it can `accept()` a connection from not just the current host on which `jtreg` is running but from any other host on the network from which this host is accessible. If such a connection is established, then such an unexpected connection then interferes with the semantics of jtreg and the AgentServer and leads to test failures. We have noticed such failures in our CI environment, when running the JDK tests.
> 
> The change in this PR proposes to bind the `ServerSocket` to loopback address to reduce the changes of such interference. This doesn't completely rule out interference from unexpected/rogue processes connecting from within the same host to this `ServerSocket`, but given that the processes running on the current host are much more controlled and managed, then that should not be too much of a problem.
> 
> A custom built jtreg was used with these changes and the JDK mainline's tier1, tier2, tier3 testing was done. All tests have passed.

This pull request has now been integrated.

Changeset: 51fbb370
Author:    Jaikiran Pai <jpai at openjdk.org>
Committer: Christian Stein <cstein at openjdk.org>
URL:       https://git.openjdk.org/jtreg/commit/51fbb370257c01ed2281f3b57378e1cafc46ec0a
Stats:     13 lines in 3 files changed: 7 ins; 0 del; 6 mod

7903686: jtreg Agent should use loopback address

Reviewed-by: jjg, cstein

-------------

PR: https://git.openjdk.org/jtreg/pull/185


More information about the jtreg-dev mailing list