Skip to content

seccomp: reject x32 syscalls before evaluating policy rules - #284

Open
congwang-mk wants to merge 1 commit into
mainfrom
fix-282-x32-seccomp
Open

congwang-mk wants to merge 1 commit into
mainfrom
fix-282-x32-seccomp

Conversation

@congwang-mk

Copy link
Copy Markdown
Contributor

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

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

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.

Reject x32 syscall numbers in the x86_64 seccomp filter

1 participant