Repository navigation
seccomp: reject x32 syscalls before evaluating policy rules - #284
Open
congwang-mk wants to merge 1 commit into
Open
congwang-mk wants to merge 1 commit into
congwang-mk wants to merge 1 commit into
Conversation
The x32 ABI shares AUDIT_ARCH_X86_64 with native x86_64, but sets bit 30 in syscall numbers. These numbers miss the native notification and deny checks and fall through to allow. Reject x32 syscalls at filter entry on x86_64, before argument rules can return. Place the architecture kill return next to its check so large filters cannot truncate the jump offset. Keep the syscall number reload after argument rules for native notification and deny checks. Add behavioral regressions for ABI rejection and native syscall actions, plus a child-process test that verifies SIGSYS without requiring x32 kernel support. All 1,765 workspace tests pass, with 8 doctests ignored. Fixes #282 Signed-off-by: Cong Wang <cwang@multikernel.io>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
x32 shares the x86_64 audit architecture but sets bit 30 in syscall numbers, allowing those requests to miss native notification and deny checks and fall through to allow.
Reject x32 syscalls before any policy rule can return. The guard is compiled only for x86_64. Move the shared architecture kill return next to its check to avoid jump-offset truncation in large filters, and preserve the syscall number reload after argument rules.
Regression tests cover native allow, deny, and notification behavior, rejection before an early allow, and large argument blocks. A child-process test verifies SIGSYS even when the kernel has x32 disabled.
Validation: full workspace suite passed on x86_64 with 1,765 tests passing and 8 doctests ignored. ARM64 and RISC-V hardware tests were not run.
Fixes #282