Skip to content

Make xauth file PID-specific - #4831

Open
jeffng-or wants to merge 1 commit into
The-OpenROAD-Project:masterfrom
The-OpenROAD-Project-staging:xauth-collision-fix
Open

jeffng-or wants to merge 1 commit into
The-OpenROAD-Project:masterfrom
The-OpenROAD-Project-staging:xauth-collision-fix

Conversation

@jeffng-or

Copy link
Copy Markdown
Contributor

Change the xauth file to be PID specific to avoid conflicts when multiple users are using docker_shell on the same machine. Added cleanup of the PID specific files so they don't accumulate.

Fixes https://github.com/The-OpenROAD-Project-private/OpenROAD-flow-scripts/issues/1960

@jeffng-or jeffng-or self-assigned this Nov 13, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates flow/util/docker_shell to use a unique X11 authority file path based on the process ID, adds a trap to clean up this file on exit, and removes the exec command when executing the Docker container. Feedback highlights a security vulnerability (CWE-377) where using predictable filenames with $$ in /tmp is susceptible to symlink attacks and race conditions, and recommends using mktemp to securely generate the temporary file with restricted permissions.

Comment thread flow/util/docker_shell Resolved
@openroad-ci

openroad-ci commented Nov 13, 2026 •

Copy link
Copy Markdown
Member

🔍 QoR check

Metrics reflect the PR merge build — i.e. what will land on the target branch.

Commit 548b78c · Jenkins build #3 · Baseline: build · View build on dashboard

62 design(s) checked — 0 with regression(s), 0 without a comparable baseline.

@vvbandeira vvbandeira left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comment at flow/util/docker_shell:104 still says "otherwise exec it", but the PR removes the exec, and the new blank line 105 separates the comment from DOCKER_CMD.
--dry-run now prints a mktemp path that the EXIT trap deletes. If someone runs the printed command, docker mounts a missing path, so X forwarding fails.
Please quote $XAUTH at line 74, like the other uses at lines 116-117.

switched to mktemp
incorporated code review feedback

Signed-off-by: Jeff Ng <jeffng@precisioninno.com>
@jeffng-or

Copy link
Copy Markdown
Contributor Author

The comment at flow/util/docker_shell:104 still says "otherwise exec it", but the PR removes the exec, and the new blank line 105 separates the comment from DOCKER_CMD. --dry-run now prints a mktemp path that the EXIT trap deletes. If someone runs the printed command, docker mounts a missing path, so X forwarding fails. Please quote $XAUTH at line 74, like the other uses at lines 116-117.

thanks for the feedback. I've made the updates and ran it through Claude for further refinement.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants