Skip to content

Lind + MPK minimal support - #1322

Draft
F-Wilke wants to merge 20 commits into
mainfrom
elf-loading-pr
Draft

F-Wilke wants to merge 20 commits into
mainfrom
elf-loading-pr

Conversation

@F-Wilke

@F-Wilke F-Wilke commented Jul 20, 2026

Copy link
Copy Markdown

Summary

Key changes:

  • The initialization sequence in lind-boot now loads input files using either wasmtime or libc's dlmopen based on their file magic and elf headers.
  • Handling of the fork, exec and exit system is now implemented using a trait that needs to be implemented by every runtime.

All these changes are needed to support multiple other runtimes along WASM.

Related issues

none

Testing

shows same behavior under

Compatibility and security impact

Checklist

  • I have read the
    contribution guidelines.
  • I added or updated tests where appropriate.
  • I ran the relevant tests locally and they pass.
  • I formatted the code and ran the relevant linters.
  • I updated documentation for user-visible or architectural changes.
  • I disclosed security vulnerabilities privately rather than in this PR.

Fredrik Wilke added 18 commits June 3, 2026 21:58
Add two new documentation files:

1. docs/internal/syscall-interposition.md
   - Technical overview of the interposition infrastructure
   - Explains core components and integration points
   - Documents API usage and debugging

2. docs/contribute/glibc-interposition-guide.md
   - Step-by-step guide for applying changes to different glibc versions
   - Practical examples and troubleshooting tips
   - Version-specific considerations

These guides help other developers apply the syscall interposition
changes to their glibc versions and understand the underlying
architecture.
…pick approach

Add two detailed documentation files:

1. docs/internal/syscall-interposition.md
   - Technical overview of the interposition infrastructure
   - Explains core components and integration points
   - Documents API usage and debugging
   - Emphasizes git cherry-pick as the recommended approach

2. docs/contribute/glibc-interposition-guide.md
   - Step-by-step guide for applying changes to different glibc versions
   - Detailed git cherry-pick instructions with conflict resolution
   - Practical examples and troubleshooting tips
   - Version-specific considerations
   - Automation script examples

These guides help other developers apply the syscall interposition
changes to their glibc versions using best practices (git cherry-pick)
and understand the underlying architecture.
@@ -0,0 +1,62 @@
use libc::c_void;

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.

What is this file for?

@@ -0,0 +1,392 @@

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.

Why is this different from the wasm syscall tables?

INSTANCE_NUMBER, RAWPOSIX_CAGEID, UNUSED_ARG, UNUSED_ID, WASMTIME_CAGEID,
};
use sysdefs::constants::syscall_const::{CLONE_SYSCALL, EXEC_SYSCALL, EXIT_SYSCALL};
use sysdefs::constants::syscall_const::{CLONE3_SYSCALL, EXEC_SYSCALL, EXIT_SYSCALL};

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.

Should this be done for both wasm and MPK?

Comment thread src/lind-boot/src/main.rs
Comment on lines +89 to +90
init_wasmtime(lind_manager.clone());
init_mpk(lind_manager.clone());

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.

should these be done all the time or does it makes sense to have this be configurable?

@@ -0,0 +1,402 @@

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.

Need header comment

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

First of all, I know this is draft.

I wonder if you'd be better off submitting a PR first to generalize the interface and then adding in MPK as a "plug-in" for that interface.

I did also notice a fair amount of code that looks duplicated related to the system call processing / interfaces. Maybe there is a better abstraction for all of this?

This branch has not been deployed

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

2 participants