From 39cc8caa93107ba7cfb612dc071332b31574b60d Mon Sep 17 00:00:00 2001 From: Ophestra Date: Sun, 8 Feb 2026 18:06:22 +0900 Subject: [PATCH] container: add riscv64 constants This target is unlikely to become viable any time soon. Signed-off-by: Ophestra --- container/seccomp/presets_riscv64_test.go | 27 + container/std/mksysnum_linux.pl | 1 + container/std/syscall_extra_linux_riscv64.go | 55 ++ container/std/syscall_linux_riscv64.go | 719 +++++++++++++++++++ 4 files changed, 802 insertions(+) create mode 100644 container/seccomp/presets_riscv64_test.go create mode 100644 container/std/syscall_extra_linux_riscv64.go create mode 100644 container/std/syscall_linux_riscv64.go diff --git a/container/seccomp/presets_riscv64_test.go b/container/seccomp/presets_riscv64_test.go new file mode 100644 index 0000000..f59469b --- /dev/null +++ b/container/seccomp/presets_riscv64_test.go @@ -0,0 +1,27 @@ +package seccomp_test + +import ( + . "hakurei.app/container/seccomp" + . "hakurei.app/container/std" +) + +var bpfExpected = bpfLookup{ + {AllowMultiarch | AllowCAN | + AllowBluetooth, PresetExt | + PresetDenyNS | PresetDenyTTY | PresetDenyDevel | + PresetLinux32}: toHash( + "a1c4ffa35f4bfbf38061184760b9a09edfcb4964c3b534395e47327b83f3fb61f2f9573ddfcc4772424cc2f5dd12fd32471e6531dbe10e85eda3797dd4fa179f"), + + {0, 0}: toHash( + "f3910fd727d087def593e3876c2c6ab9ace71d82ec8cbc992a26223e7bba85e1d7a0b56c5fc6303703f24595825dad8561637edaedd5384b34a6cd080946633c"), + {0, PresetExt}: toHash( + "741438c5e3f11c36c92ae8c5934f13440675c6e719541c2dbffeda79a10081bcfd9ad8314a60c1d1f53db86c8080c13fffa3bbcf7fe753935679b4b902737286"), + {0, PresetStrict}: toHash( + "79e9e464d02405c6d74fd2c771bd72a1311e488221c73a9c32db9270219837c54fccec2f36fe2474895547e60c311514567e2e6cf4e7a7fcf909c1ecd1e254a7"), + {0, PresetDenyNS | PresetDenyTTY | PresetDenyDevel}: toHash( + "3c443715a6c1e557a284862ea8efb70a5d4ecbe67d1226627323e861cd3646fb3e7768ec5b94b93760b7f652cf6916f66e317a4fbf8716d10c3673aa4fc3ae58"), + {0, PresetExt | PresetDenyDevel}: toHash( + "4448a74e8cc75a4ab63799c4f2cc2a5af63e5f4e8e9b8ac15a1873d647dfa67a4c67b39ed466d8dd32abc64136d401879fc6185c9ab00feeaf59ccf4305f8201"), + {0, PresetExt | PresetDenyNS | PresetDenyDevel}: toHash( + "c7c86e793cb7192f5f6c735f372cda27eb43ae1045e587f8eadb64c849520a3280b6570a3d7b601d32cddb38021585a2234db38e506cebfd10aa3d6c75440f17"), +} diff --git a/container/std/mksysnum_linux.pl b/container/std/mksysnum_linux.pl index 65689dd..0bb9d22 100755 --- a/container/std/mksysnum_linux.pl +++ b/container/std/mksysnum_linux.pl @@ -12,6 +12,7 @@ my %syscall_cutoff_arch = ( "x86" => 340, "x86_64" => 302, "aarch64" => 281, + "riscv64" => 281, ); print <