Skip to content

fix(fspy): improve seccomp_unotify ipc#255

Merged
branchseer merged 11 commits intomainfrom
10-24-fix_fspy_fix_ipc_of_seccomp_filter_fd
Oct 25, 2025
Merged

fix(fspy): improve seccomp_unotify ipc#255
branchseer merged 11 commits intomainfrom
10-24-fix_fspy_fix_ipc_of_seccomp_filter_fd

Conversation

@branchseer
Copy link
Copy Markdown
Member

@branchseer branchseer commented Oct 24, 2025

Fix seccomp filter IPC and add static executable support

This PR improves the seccomp filter IPC mechanism by using path-based Unix domain sockets instead of directly passing file descriptors. This approach is consistent with #234 and eliminates the need for pre-exec handling.

Key changes:

  • Replace direct fd passing with Unix domain socket communication
  • Fix handling of path overflow in CStrPtr by returning a boolean success indicator
  • Add support for tracking static executables with tests
  • Add a test binary crate that can be included as a static binary for testing
  • Implement proper handling of the open syscall on x86_64 architecture
  • Enable typeaware linting test on Linux

The PR also includes various code improvements and cleanup, such as better error handling and more robust syscall tracking.

Copy link
Copy Markdown
Member Author

branchseer commented Oct 24, 2025

@branchseer branchseer changed the base branch from 10-24-test_add_test_for_type-aware_linting to graphite-base/255 October 24, 2025 08:37
@branchseer branchseer force-pushed the 10-24-fix_fspy_fix_ipc_of_seccomp_filter_fd branch from 2521ede to eca1c3b Compare October 24, 2025 08:38
@graphite-app graphite-app Bot changed the base branch from graphite-base/255 to main October 24, 2025 08:38
@branchseer branchseer force-pushed the 10-24-fix_fspy_fix_ipc_of_seccomp_filter_fd branch 3 times, most recently from 9464840 to 39c3141 Compare October 24, 2025 09:45
@branchseer branchseer changed the title fix(fspy): fix ipc of seccomp filter fd fix(fspy): improve seccomp filter ipc Oct 24, 2025
@branchseer branchseer changed the title fix(fspy): improve seccomp filter ipc fix(fspy): improve seccomp-filter ipc Oct 24, 2025
@branchseer branchseer changed the title fix(fspy): improve seccomp-filter ipc fix(fspy): improve seccomp_unotify ipc Oct 24, 2025
@branchseer branchseer marked this pull request as ready for review October 24, 2025 10:20
Copilot AI review requested due to automatic review settings October 24, 2025 10:20
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

This PR improves the seccomp filter IPC mechanism by replacing direct file descriptor passing with Unix domain socket path-based communication, resolving deadlock issues and adding support for static executable tracking.

Key Changes:

  • Replaced FD inheritance with Unix socket path passing for seccomp_unotify IPC
  • Added test infrastructure for static executables including a test binary crate
  • Implemented handling of the open syscall for x86_64 architecture

Reviewed Changes

Copilot reviewed 19 out of 21 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
packages/cli/snap-tests/oxlint-typeaware/steps.json Enabled typeaware linting test on Linux by removing platform restriction
crates/fspy_test_bin/src/main.rs Added test binary for static executable testing with file operation actions
crates/fspy_test_bin/Cargo.toml Created cargo configuration for test binary crate
crates/fspy_shared_unix/src/spawn/linux/mod.rs Moved elf module to library root for shared access
crates/fspy_shared_unix/src/lib.rs Exposed elf utility for verifying static executables
crates/fspy_seccomp_unotify/tests/arg_types.rs Updated tests to handle optional path reads and new supervisor API
crates/fspy_seccomp_unotify/src/target.rs Changed from direct FD passing to Unix socket connection
crates/fspy_seccomp_unotify/src/supervisor/mod.rs Replaced FD pair with Unix domain socket listener for IPC
crates/fspy_seccomp_unotify/src/supervisor/handler/mod.rs Enhanced macro to support conditional compilation attributes
crates/fspy_seccomp_unotify/src/supervisor/handler/arg.rs Modified CStrPtr reading to return success status instead of error on overflow
crates/fspy_seccomp_unotify/src/payload/mod.rs Changed payload from RawFd to socket path bytes
crates/fspy_seccomp_unotify/Cargo.toml Added dependencies for socket handling and async operations
crates/fspy/tests/test_utils.rs Improved assertion with detailed error message on failure
crates/fspy/tests/static_executable.rs Added comprehensive tests for tracking static executables
crates/fspy/src/unix/syscall_handler/mod.rs Added x86_64 open syscall handler and refactored path handling
crates/fspy/src/unix/mod.rs Updated to use new supervisor API without pre_exec
crates/fspy/Cargo.toml Added platform-specific test binary dependencies
.github/workflows/ci.yml Added musl target for building static test binaries
.devcontainer/devcontainer.json Simplified devcontainer setup by removing mise dependency

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment thread crates/fspy_seccomp_unotify/src/supervisor/handler/arg.rs
Comment thread crates/fspy/tests/test_utils.rs
@branchseer branchseer force-pushed the 10-24-fix_fspy_fix_ipc_of_seccomp_filter_fd branch from a0847f3 to 687857f Compare October 25, 2025 04:47
@branchseer branchseer merged commit 1c7c9d7 into main Oct 25, 2025
10 checks passed
Copy link
Copy Markdown
Member Author

Merge activity

@branchseer branchseer deleted the 10-24-fix_fspy_fix_ipc_of_seccomp_filter_fd branch October 25, 2025 09:03
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