Skip to content

Commit 421eeb1

Browse files
committed
Restrict graalpytest worker socket to loopback
1 parent 21df2c0 commit 421eeb1

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

  • graalpython/com.oracle.graal.python.test/src

graalpython/com.oracle.graal.python.test/src/runner.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,8 @@
8383

8484
RUNNER_ENV = {}
8585
DISABLE_JIT_ENV = {'GRAAL_PYTHON_VM_ARGS': '--experimental-options --engine.Compilation=false'}
86+
# The worker transport sends pickled data, so keep it on loopback only.
87+
WORKER_SERVER_HOST = '127.0.0.1'
8688

8789
GITHUB_CI = os.environ.get("GITHUB_CI", None)
8890
if GITHUB_CI:
@@ -791,7 +793,7 @@ def run_in_subprocess_and_watch(self):
791793
self.thread = threading.current_thread()
792794
with (
793795
tempfile.TemporaryDirectory(prefix='graalpytest-') as tmp_dir,
794-
socket.create_server(('0.0.0.0', 0)) as server,
796+
socket.create_server((WORKER_SERVER_HOST, 0)) as server,
795797
):
796798
tmp_dir = Path(tmp_dir)
797799

@@ -1327,7 +1329,7 @@ def poll(self, timeout=None):
13271329

13281330

13291331
def main_worker(args):
1330-
with socket.create_connection(('localhost', args.port)) as sock:
1332+
with socket.create_connection((WORKER_SERVER_HOST, args.port)) as sock:
13311333
conn = Connection(sock)
13321334

13331335
tests = conn.recv()

0 commit comments

Comments
 (0)