Skip to content

Conversation

@kov
Copy link
Owner

@kov kov commented Jan 1, 2026

Implements:

  • memfd_create: create anonymous file in memory

  • pkey_mprotect: set protection with memory protection key

  • mseal: seal memory region (Linux 6.10+)

  • remap_file_pages: remap file pages (deprecated)

  • Add data structures for all 4 syscalls

  • Add eBPF handlers in memory.rs

  • Register syscalls in MEMORY_SYSCALLS

  • Add format_memfd_create_flags() helper with MFD_* constants

  • Add return value formatting (fd for memfd_create, success/error for others)

  • Add 5 pretty printing tests

  • All 540 tests passing

🤖 Generated with Claude Code

Copy link
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

This PR adds support for four memory management syscalls: memfd_create, pkey_mprotect, mseal, and remap_file_pages. The implementation follows the established consolidated handler architecture for the memory category.

Key changes:

  • Adds data structures for all four syscalls to the common library
  • Implements eBPF handlers in the consolidated memory handler
  • Adds comprehensive unit tests and an integration test for memfd_create

Reviewed changes

Copilot reviewed 7 out of 8 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
pinchy-common/src/lib.rs Adds data structures for the four new syscalls to SyscallEventData union
pinchy-ebpf/src/memory.rs Implements eBPF handlers for the four syscalls in the consolidated memory handler
pinchy/src/server.rs Registers the four syscalls in MEMORY_SYSCALLS array for loading
pinchy/src/format_helpers.rs Adds format_memfd_create_flags(), format_mseal_flags(), and return value handling for the syscalls
pinchy/src/events.rs Adds event parsing logic for all four syscalls with appropriate argument formatting
pinchy/src/tests/memory.rs Adds five unit tests covering various scenarios for the new syscalls
pinchy/tests/integration.rs Adds integration test for memfd_create with multiple flag combinations
pinchy/src/bin/test-helper.rs Implements memfd_test() workload function to exercise memfd_create in integration tests

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Implements:
- memfd_create: create anonymous file in memory
- pkey_mprotect: set protection with memory protection key
- mseal: seal memory region (Linux 6.10+)
- remap_file_pages: remap file pages (deprecated)

- Add data structures for all 4 syscalls
- Add eBPF handlers in memory.rs
- Register syscalls in MEMORY_SYSCALLS
- Add format_memfd_create_flags() helper with MFD_* constants
- Add return value formatting (fd for memfd_create, success/error for others)
- Add 5 pretty printing tests
- All 540 tests passing

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@kov kov merged commit ccb8385 into main Jan 1, 2026
2 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.

2 participants