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>
Thu, 15 Oct 2020 21:48:34 +0000 (22:48 +0100)
commitc469d76945e39b3226747f2057a7b0f18b3950b6
tree9ea8c57ca89268d2c41646d9fb5e1fdb72a3cb80
parentf8b96a3e03419a65bde294f0fc99562ed0ed2e93
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