[PATCH] arch: adapt arch-syscall-validate to Linux 6.11
authorWANG Xuerui <git@xen0n.name>
Tue, 20 Aug 2024 04:16:55 +0000 (12:16 +0800)
committerFelix Geyer <fgeyer@debian.org>
Sun, 24 Nov 2024 20:54:16 +0000 (21:54 +0100)
The aarch64, loongarch64 and riscv64 architectures have their syscall
table sources changed to scripts/syscall.tbl, from the original
inclusion of asm-generic/unistd.h. Make the script recognize the new
format for these architectures.

Signed-off-by: WANG Xuerui <git@xen0n.name>
Signed-off-by: Paul Moore <paul@paul-moore.com>
Gbp-Pq: Name arch_adapt_arch-syscall-validate_to_Linux_6.11.patch

src/arch-syscall-validate

index d9ee6f9e355f945d41fa0dfe43ad6bb0d874d43c..8c4d632237ab37c82b0a7331cb1bf49c8a58a4bf 100755 (executable)
@@ -286,6 +286,13 @@ function dump_lib_arm() {
 #  Dump the architecture's syscall table to stdout.
 #
 function dump_sys_aarch64() {
+       local syscall_tbl_file="$1/arch/arm64/tools/syscall_64.tbl"
+       if [[ -e $syscall_tbl_file ]]; then
+               dump_from_syscall_tbl "$syscall_tbl_file" \
+                       64 renameat rlimit memfd_secret
+               return
+       fi
+
        local sed_filter=""
 
        sed_filter+='s/__NR3264_statfs/43/;'
@@ -331,6 +338,11 @@ function dump_lib_aarch64() {
 #  Dump the architecture's syscall table to stdout.
 #
 function dump_sys_loongarch64() {
+       if [[ -e $1/arch/loongarch/kernel/Makefile.syscalls ]]; then
+               dump_from_syscall_tbl "$1/scripts/syscall.tbl" 64
+               return
+       fi
+
        local sed_filter=""
 
        sed_filter+='s/__NR3264_fadvise64/223/;'
@@ -522,6 +534,12 @@ function dump_lib_ppc64() {
 #  Dump the architecture's syscall table to stdout.
 #
 function dump_sys_riscv64() {
+       if [[ -e $1/arch/riscv/kernel/Makefile.syscalls ]]; then
+               dump_from_syscall_tbl "$1/scripts/syscall.tbl" \
+                       64 riscv rlimit memfd_secret
+               return
+       fi
+
        local sed_filter=""
 
        sed_filter+='s/__NR3264_fadvise64/223/;'