RFR: 7903686: jtreg Agent should use loopback address [v2]

Jaikiran Pai jpai at openjdk.org
Wed Mar 6 06:32:18 UTC 2024


> 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.

Jaikiran Pai has updated the pull request incrementally with one additional commit since the last revision:

  add an entry to changelog

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

Changes:
  - all: https://git.openjdk.org/jtreg/pull/185/files
  - new: https://git.openjdk.org/jtreg/pull/185/files/cf29d4f9..6af39c07

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jtreg&pr=185&range=01
 - incr: https://webrevs.openjdk.org/?repo=jtreg&pr=185&range=00-01

  Stats: 3 lines in 1 file changed: 3 ins; 0 del; 0 mod
  Patch: https://git.openjdk.org/jtreg/pull/185.diff
  Fetch: git fetch https://git.openjdk.org/jtreg.git pull/185/head:pull/185

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


More information about the jtreg-dev mailing list