Skip to content

sparc64: add seccomp filter support

Stian Halseth linux-kselftest lkml sparclinux 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest2 patches 4 repliesIn review
  2. v12 patches 3 repliesSuperseded

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2sparc64: add seccomp filter supportarch/sparc/Kconfig arch/sparc/include/asm/seccomp.h arch/sparc/include/asm/syscall.h +3 more+63 -230 replies
2/2selftests/seccomp: add sparc64 supporttools/testing/selftests/seccomp/seccomp_bpf.c+36 -01 reply

Reviews trailers per patch

1 of 2 patches has a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchKees CookAndreas Larsson
SeriesR-b T-b
1/2
2/2R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [PATCH v2 0/2] sparc64: add seccomp filter support

This adds SECCOMP_FILTER support for sparc64.

The arch prerequisites have been in place for years, so patch 1 is mostly about the missing piece: letting seccomp veto a syscall, and returning to user space with the return value the seccomp core set in pt_regs rather than the -ENOSYS the assembler stubs used to force on any denied syscall. Patch 2 teaches the seccomp_bpf selftest to drive sparc64's registers.

Tested on an UltraSPARC T4-1 (sun4v):

- tools/testing/selftests/seccomp/seccomp_bpf: 95 passed, 0 failed, 16 skipped (uprobes and other optional features)
- libseccomp with its pending SPARC support (libseccomp PR #471) passes its full suite, 5190 of 5190, including the live tests that require kernel SECCOMP_FILTER
- docker containers run confined by the default profile, and a custom SCMP_ACT_ERRNO profile denies as expected

The libseccomp side is https://github.com/seccomp/libseccomp/pull/471,
and the tracking issue is https://github.com/sparclinux/issues/issues/11.

v2: drop the local regs-struct definition in the selftest in favour of
PTRACE_GETREGS64/PTRACE_SETREGS64 and the uapi struct pt_regs (Kees Cook); patch 1 unchanged.

Stian Halseth (2):
sparc64: add seccomp filter support
selftests/seccomp: add sparc64 support

 arch/sparc/Kconfig                            |  2 +-
 arch/sparc/include/asm/seccomp.h              | 15 ++++++++
 arch/sparc/include/asm/syscall.h              | 11 +++---
 arch/sparc/kernel/entry.h                     |  2 +-
 arch/sparc/kernel/ptrace_64.c                 | 28 ++++++++++-----
 arch/sparc/kernel/syscalls.S                  | 28 +++++++++++----
 tools/testing/selftests/seccomp/seccomp_bpf.c | 36 ++++++++++++++++++++
 7 files changed, 99 insertions(+), 23 deletions(-)
Signature · 1 line
2.45