This patch adds seccomp support to the riscv64 architecture. seccomp support is available in the riscv64 kernel since version 5.5, and it has just been added to the libseccomp library.
riscv64 uses generic syscalls like aarch64, so I used that architecture as a reference to find which code has to be modified.
With this patch, the testsuite passes successfully, including the test-seccomp test. The system boots and works fine with kernel 5.4 (i.e. without seccomp support) and kernel 5.5 (i.e. with seccomp support). I have also verified that the "SystemCallFilter=~socket" option prevents a service to use the ping utility when running on kernel 5.5.
f9252236c8 seccomp: add support for riscv64
src/nspawn/nspawn-oci.c | 3 +++
src/shared/seccomp-util.c | 30 ++++++++++++++++++++++++++----
src/test/test-seccomp.c | 3 +++
3 files changed, 32 insertions(+), 4 deletions(-)