Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hook execve and execv to allow shared sockets. #2610

Merged
merged 76 commits into from
Jul 30, 2024

Conversation

meowjesty
Copy link
Member

@meowjesty meowjesty commented Jul 22, 2024

We now share the SOCKETS created by the parent process with its children (yay happy family) through an env var MIRRORD_SHARED_SOCKETS (the creativity is astonishing) that is set up in exec* calls (and also posix_spawn for macos). The SOCKETS are rebuilt from this env var (if it exists) in the child process.

  • Adds a new hook execv for linux;
    • Sets an env var with Rust's set_var;
  • Makes the previously macos only execve hook also available on linux;
    • Changes execve behaviour to insert a new env var before calling FN_EXECVE;
  • Adds a new integration test for an uvicorn app with the --reload flag, which triggers the issue;

@meowjesty meowjesty marked this pull request as ready for review July 23, 2024 20:05
Copy link
Member

@DmitryDodzin DmitryDodzin left a comment

Choose a reason for hiding this comment

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

Minor changes regarding sip but looks good otherwise =]

mirrord/layer/src/exec_hooks/hooks.rs Outdated Show resolved Hide resolved
mirrord/layer/src/exec_hooks/hooks.rs Outdated Show resolved Hide resolved
mirrord/layer/src/exec_utils.rs Outdated Show resolved Hide resolved
mirrord/layer/src/exec_hooks/hooks.rs Outdated Show resolved Hide resolved
mirrord/layer/src/exec_utils.rs Outdated Show resolved Hide resolved
@meowjesty meowjesty requested a review from DmitryDodzin July 29, 2024 19:41
Copy link
Member

@DmitryDodzin DmitryDodzin left a comment

Choose a reason for hiding this comment

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

🥷

@aviramha aviramha enabled auto-merge July 30, 2024 09:26
@aviramha aviramha added this pull request to the merge queue Jul 30, 2024
Merged via the queue into metalbear-co:main with commit b1ee41f Jul 30, 2024
16 checks passed
Razz4780 added a commit to Razz4780/mirrord that referenced this pull request Jul 30, 2024
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