seccomp: add support for riscv64
authorAurelien Jarno <aurelien@aurel32.net>
Wed, 19 Aug 2020 20:44:15 +0000 (22:44 +0200)
committerMichael Biebl <biebl@debian.org>
Mon, 21 Sep 2020 18:28:36 +0000 (19:28 +0100)
commit2fd88ca95aa78f36a2e5bda03866d7930633fe8e
treec9038ba356a651c370dfc73bfb4e837bb8a823e7
parentf11bbe179cdb0116fc731ac074be321ebaff4dc8
seccomp: add support for riscv64

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.

(cherry picked from commit f9252236c8618f7e0476667076b9a939f0e91967)

Gbp-Pq: Name seccomp-add-support-for-riscv64.patch
src/nspawn/nspawn-oci.c
src/shared/seccomp-util.c
src/test/test-seccomp.c