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>
Wed, 2 Sep 2020 11:30:52 +0000 (12:30 +0100)
commitef6792c2dfebea855cb3771f9b14f46ae77d9196
treeaa39729e006035d87637c29d5ef996856c3d910c
parent69cfc4a24240d56b5040afc834e04524e68cdad5
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