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, 14 Sep 2020 06:04:39 +0000 (07:04 +0100)
commitc3e87fecb8ad5d87301a018dcdb4bd6e372e7719
tree679a34522dfc8d912e78c858873db2b10907796b
parent0899a52866715cc6c7c42cca0939d753837145d7
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