Skip to content

fix: disable ASLR when loading VCS simulator library#88

Merged
Makiras merged 2 commits into
XS-MLVP:masterfrom
Sergeant-Salz:master
Jun 4, 2026
Merged

fix: disable ASLR when loading VCS simulator library#88
Makiras merged 2 commits into
XS-MLVP:masterfrom
Sergeant-Salz:master

Conversation

@Sergeant-Salz
Copy link
Copy Markdown

Description

As described in #86, VCS will launch a new instance of python after disabling ASLR. Because the argv to that execv call is malformed, this interrupts the original process and drops the user in a clean shell.
To avoid this, we disable ASLR before VCS initializes and thus prevent the undesired behavior.

Fixes #86

Type of change

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

Tested with VCS 2025 on Rocky 9.5 while using LD_PRELOAD.

Copilot AI review requested due to automatic review settings June 3, 2026 13:39
@Sergeant-Salz
Copy link
Copy Markdown
Author

This issue is alternatively solved by #87

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Adds a VCS-specific workaround to disable ASLR during DUT initialization to prevent VCS from relaunching the process (and failing when argv is malformed).

Changes:

  • Includes <sys/personality.h> for access to personality() / ADDR_NO_RANDOMIZE.
  • Disables ASLR at startup when USE_VCS is defined, with logging and a warning on failure.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread template/lib/dut_base.cpp
Comment thread template/lib/dut_base.cpp Outdated
Comment thread template/lib/dut_base.cpp Outdated
Comment thread template/lib/dut_base.cpp
Fixed variable might be undefined causing warning
@Makiras
Copy link
Copy Markdown
Contributor

Makiras commented Jun 4, 2026

LGTM and test passed on VCS 2024. It will be merged after CI passes.
Personally, I believe this is a more elegant fix for the VCS issue without sacrificing functionality.

@Makiras Makiras merged commit 7d336d5 into XS-MLVP:master Jun 4, 2026
6 checks passed
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.

Generated library hijacks execution, spawning an empty Python REPL

3 participants