Skip to content

Add PARISC, LOONGARCH64, M68K, SH, and SHEB seccomp architectures #327

Merged
utam0k merged 2 commits intoyouki-dev:mainfrom
hayama17:feat/add-missing-seccomp-archs
Mar 10, 2026
Merged

Add PARISC, LOONGARCH64, M68K, SH, and SHEB seccomp architectures #327
utam0k merged 2 commits intoyouki-dev:mainfrom
hayama17:feat/add-missing-seccomp-archs

Conversation

@hayama17
Copy link
Copy Markdown

What type of PR is this?

/kind feature

What this PR does / why we need it

Add missing Arch enum variants for seccomp architecture filtering.

The following architectures are defined in the OCI runtime spec but were absent from the Rust implementation:

OCI string seccomp.h.in linux/audit.h linux/elf-em.h value
SCMP_ARCH_PARISC AUDIT_ARCH_PARISC (EM_PARISC) EM_PARISC=15 0x0000000f
SCMP_ARCH_PARISC64 AUDIT_ARCH_PARISC64 (EM_PARISC|__AUDIT_ARCH_64BIT) EM_PARISC=15 0x8000000f
SCMP_ARCH_LOONGARCH64 AUDIT_ARCH_LOONGARCH64 (EM_LOONGARCH|__AUDIT_ARCH_64BIT|__AUDIT_ARCH_LE) EM_LOONGARCH=258 0xc0000102
SCMP_ARCH_M68K AUDIT_ARCH_M68K (EM_68K) EM_68K=4 0x00000004
SCMP_ARCH_SH AUDIT_ARCH_SHEL (EM_SH|__AUDIT_ARCH_LE) EM_SH=42 0x4000002a
SCMP_ARCH_SHEB AUDIT_ARCH_SH (EM_SH) EM_SH=42 0x0000002a

Flags are defined in linux/audit.h L393-L394:

  • __AUDIT_ARCH_64BIT = 0x80000000
  • __AUDIT_ARCH_LE = 0x40000000

Note: SCMP_ARCH_SH and SCMP_ARCH_SHEB are intentionally reversed relative to their names — SCMP_ARCH_SH maps to AUDIT_ARCH_SHEL (LE) and SCMP_ARCH_SHEB maps to AUDIT_ARCH_SH (BE), following seccomp.h.in L241-L242.

Which issue(s) this PR fixes

Fixes #311

Special notes for your reviewer

Round-trip tests (to_string / parse) for all new variants are added in src/runtime/linux.rs.

Does this PR introduce a user-facing change?

Add missing seccomp Arch enum variants: PARISC, PARISC64, LOONGARCH64, M68K, SH, SHEB

Signed-off-by: hayama17 <kohei.hayama.9r@gmail.com>
…B seccomp architectures

Signed-off-by: hayama17 <kohei.hayama.9r@gmail.com>
@utam0k utam0k merged commit f496b8a into youki-dev:main Mar 10, 2026
16 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.

Add missing Seccomp Architectures (SCMP_ARCH)

2 participants