Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ The libseccomp library currently supports the architectures listed below:
* 32-bit x86 (x86)
* 64-bit x86 (x86_64)
* 64-bit x86 x32 ABI (x32)
* 64-bit Alpha (alpha)
* 32-bit ARM EABI (arm)
* 64-bit ARM (aarch64)
* 64-bit LoongArch (loongarch64)
Expand Down
7 changes: 4 additions & 3 deletions doc/man/man1/scmp_sys_resolver.1
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,10 @@ special manner by libseccomp depending on the operation.
.B \-a \fIARCH
The architecture to use for resolving the system call. Valid
.I ARCH
values are "x86", "x86_64", "x32", "arm", "aarch64", "loongarch64", "m68k",
"mips", "mipsel", "mips64", "mipsel64", "mips64n32", "mipsel64n32", "parisc",
"parisc64", "ppc", "ppc64", "ppc64le", "s390", "s390x", "sheb" and "sh".
values are "x86", "x86_64", "x32", "arm", "aarch64", "alpha", "loongarch64",
"m68k", "mips", "mipsel", "mips64", "mipsel64", "mips64n32", "mipsel64n32",
"parisc", "parisc64", "ppc", "ppc64", "ppc64le", "s390", "s390x", "sheb" and
"sh".
.TP
.B \-t
If necessary, translate the system call name to the proper system call number,
Expand Down
7 changes: 7 additions & 0 deletions include/seccomp-syscalls.h
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,7 @@
#define __PNR_getpagesize -10249
#define __PNR_riscv_hwprobe -10250
#define __PNR_uretprobe -10251
#define __PNR_open_tree_attr -10252

/*
* libseccomp syscall definitions
Expand Down Expand Up @@ -1356,6 +1357,12 @@
#define __SNR_open_tree __PNR_open_tree
#endif

#ifdef __NR_open_tree_attr
#define __SNR_open_tree_attr __NR_open_tree_attr
#else
#define __SNR_open_tree_attr __PNR_open_tree_attr
#endif

#define __SNR_openat __NR_openat

#define __SNR_openat2 __NR_openat2
Expand Down
5 changes: 5 additions & 0 deletions include/seccomp.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,11 @@ struct scmp_arg_cmp {
#endif /* AUDIT_ARCH_AARCH64 */
#define SCMP_ARCH_AARCH64 AUDIT_ARCH_AARCH64

/**
* The Alpha architecture tokens
*/
#define SCMP_ARCH_ALPHA AUDIT_ARCH_ALPHA

/**
* The LoongArch architecture tokens
*/
Expand Down
1 change: 1 addition & 0 deletions src/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ SOURCES_ALL = \
arch-x32.h arch-x32.c \
arch-arm.h arch-arm.c \
arch-aarch64.h arch-aarch64.c \
arch-alpha.h arch-alpha.c \
arch-loongarch64.h arch-loongarch64.c \
arch-m68k.h arch-m68k.c \
arch-mips.h arch-mips.c \
Expand Down
36 changes: 36 additions & 0 deletions src/arch-alpha.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/*
* This library is free software; you can redistribute it and/or modify it
* under the terms of version 2.1 of the GNU Lesser General Public License as
* published by the Free Software Foundation.
*
* This library is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
* for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this library; if not, see <http://www.gnu.org/licenses>.
*/

#include <stdlib.h>
#include <errno.h>
#include <linux/audit.h>

#include "arch.h"
#include "arch-alpha.h"
#include "syscalls.h"

ARCH_DEF(alpha)

const struct arch_def arch_def_alpha = {
.token = SCMP_ARCH_ALPHA,
.token_bpf = AUDIT_ARCH_ALPHA,
.size = ARCH_SIZE_64,
.endian = ARCH_ENDIAN_LITTLE,
.syscall_resolve_name_raw = alpha_syscall_resolve_name,
.syscall_resolve_num_raw = alpha_syscall_resolve_num,
.syscall_rewrite = NULL,
.rule_add = NULL,
.syscall_name_kver = alpha_syscall_name_kver,
.syscall_num_kver = alpha_syscall_num_kver,
};
22 changes: 22 additions & 0 deletions src/arch-alpha.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/*
* This library is free software; you can redistribute it and/or modify it
* under the terms of version 2.1 of the GNU Lesser General Public License as
* published by the Free Software Foundation.
*
* This library is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
* for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this library; if not, see <http://www.gnu.org/licenses>.
*/

#ifndef _ARCH_ALPHA_H
#define _ARCH_ALPHA_H

#include "arch.h"

ARCH_DECL(alpha)

#endif
32 changes: 28 additions & 4 deletions src/arch-create-syscalls-csv.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@
import math
import os

arch_list = ['i386', 'x86_64', 'x32', 'arm', 'arm64', 'loongarch64', 'm68k',
'mipso32', 'mips64', 'mips64n32', 'parisc', 'parisc64', 'powerpc',
'powerpc64', 'riscv64', 's390', 's390x', 'sh']
arch_list = ['i386', 'x86_64', 'x32', 'arm', 'arm64', 'alpha', 'loongarch64',
'm68k', 'mipso32', 'mips64', 'mips64n32', 'parisc', 'parisc64',
'powerpc', 'powerpc64', 'riscv64', 's390', 's390x', 'sh']

kernel_versions = ['3.0', '3.1', '3.2', '3.3', '3.4', '3.5', '3.6', '3.7',
'3.8', '3.9', '3.10', '3.11', '3.12', '3.13', '3.14',
Expand Down Expand Up @@ -148,6 +148,7 @@
'afs_syscall': {'i386': [137, 'UNDEF'],
'x86_64': [183, 'UNDEF'],
'x32': [183, 'UNDEF'],
'alpha': [338, 'UNDEF'],
'arm': [None, 'UNDEF'],
'arm64': [None, 'UNDEF'],
'loongarch64': [None, 'UNDEF'],
Expand All @@ -166,6 +167,7 @@
'bdflush': {'i386': [134, 'UNDEF'],
'x86_64': [None, 'UNDEF'],
'x32': [None, 'UNDEF'],
'alpha': [300, 'UNDEF'],
'arm': [134, 'UNDEF'],
'arm64': [None, 'UNDEF'],
'loongarch64': [None, 'UNDEF'],
Expand All @@ -184,6 +186,7 @@
'break': {'i386': [17, 'UNDEF'],
'x86_64': [None, 'UNDEF'],
'x32': [None, 'UNDEF'],
'alpha': [None, 'UNDEF'],
'arm': [None, 'UNDEF'],
'arm64': [None, 'UNDEF'],
'loongarch64': [None, 'UNDEF'],
Expand All @@ -202,6 +205,7 @@
'breakpoint': {'i386': [None, 'UNDEF'],
'x86_64': [None, 'UNDEF'],
'x32': [None, 'UNDEF'],
'alpha': [None, 'UNDEF'],
'arm': [983041, 'UNDEF'],
'arm64': [None, 'UNDEF'],
'loongarch64': [None, 'UNDEF'],
Expand All @@ -220,6 +224,7 @@
'create_module': {'i386': [127, 'UNDEF'],
'x86_64': [174, 'UNDEF'],
'x32': [None, 'UNDEF'],
'alpha': [306, 'UNDEF'],
'arm': [None, 'UNDEF'],
'arm64': [None, 'UNDEF'],
'loongarch64': [None, 'UNDEF'],
Expand All @@ -238,6 +243,7 @@
'ftime': {'i386': [35, 'UNDEF'],
'x86_64': [None, 'UNDEF'],
'x32': [None, 'UNDEF'],
'alpha': [None, 'UNDEF'],
'arm': [None, 'UNDEF'],
'arm64': [None, 'UNDEF'],
'loongarch64': [None, 'UNDEF'],
Expand All @@ -256,6 +262,7 @@
'get_kernel_syms': {'i386': [130, 'UNDEF'],
'x86_64': [177, 'UNDEF'],
'x32': [None, 'UNDEF'],
'alpha': [309, 'UNDEF'],
'arm': [None, 'UNDEF'],
'arm64': [None, 'UNDEF'],
'loongarch64': [None, 'UNDEF'],
Expand All @@ -274,6 +281,7 @@
'getpmsg': {'i386': [188, 'UNDEF'],
'x86_64': [181, 'UNDEF'],
'x32': [181, 'UNDEF'],
'alpha': [None, 'UNDEF'],
'arm': [None, 'UNDEF'],
'arm64': [None, 'UNDEF'],
'loongarch64': [None, 'UNDEF'],
Expand All @@ -292,6 +300,7 @@
'gtty': {'i386': [32, 'UNDEF'],
'x86_64': [None, 'UNDEF'],
'x32': [None, 'UNDEF'],
'alpha': [None, 'UNDEF'],
'arm': [None, 'UNDEF'],
'arm64': [None, 'UNDEF'],
'loongarch64': [None, 'UNDEF'],
Expand All @@ -310,6 +319,7 @@
'idle': {'i386': [112, 'UNDEF'],
'x86_64': [None, 'UNDEF'],
'x32': [None, 'UNDEF'],
'alpha': [None, 'UNDEF'],
'arm': [None, 'UNDEF'],
'arm64': [None, 'UNDEF'],
'loongarch64': [None, 'UNDEF'],
Expand All @@ -328,6 +338,7 @@
'lock': {'i386': [53, 'UNDEF'],
'x86_64': [None, 'UNDEF'],
'x32': [None, 'UNDEF'],
'alpha': [None, 'UNDEF'],
'arm': [None, 'UNDEF'],
'arm64': [None, 'UNDEF'],
'loongarch64': [None, 'UNDEF'],
Expand All @@ -346,6 +357,7 @@
'mpx': {'i386': [56, 'UNDEF'],
'x86_64': [None, 'UNDEF'],
'x32': [None, 'UNDEF'],
'alpha': [None, 'UNDEF'],
'arm': [None, 'UNDEF'],
'arm64': [None, 'UNDEF'],
'loongarch64': [None, 'UNDEF'],
Expand All @@ -363,7 +375,8 @@
'sh': [None, 'UNDEF']},
'nfsservctl': {'i386': [169, 'UNDEF'],
'x86_64': [180, 'UNDEF'],
'x32': [None, 'UNDEF'],
'x32': [42, 'UNDEF'],
'alpha': [None, 'UNDEF'],
'arm': [169, 'UNDEF'],
'arm64': [42, 'UNDEF'],
'loongarch64': [42, 'UNDEF'],
Expand All @@ -382,6 +395,7 @@
'prof': {'i386': [44, 'UNDEF'],
'x86_64': [None, 'UNDEF'],
'x32': [None, 'UNDEF'],
'alpha': [None, 'UNDEF'],
'arm': [None, 'UNDEF'],
'arm64': [None, 'UNDEF'],
'loongarch64': [None, 'UNDEF'],
Expand All @@ -400,6 +414,7 @@
'profil': {'i386': [98, 'UNDEF'],
'x86_64': [None, 'UNDEF'],
'x32': [None, 'UNDEF'],
'alpha': [None, 'UNDEF'],
'arm': [None, 'UNDEF'],
'arm64': [None, 'UNDEF'],
'loongarch64': [None, 'UNDEF'],
Expand All @@ -418,6 +433,7 @@
'putpmsg': {'i386': [189, 'UNDEF'],
'x86_64': [182, 'UNDEF'],
'x32': [182, 'UNDEF'],
'alpha': [None, 'UNDEF'],
'arm': [None, 'UNDEF'],
'arm64': [None, 'UNDEF'],
'loongarch64': [None, 'UNDEF'],
Expand All @@ -436,6 +452,7 @@
'query_module': {'i386': [167, 'UNDEF'],
'x86_64': [178, 'UNDEF'],
'x32': [None, 'UNDEF'],
'alpha': [347, 'UNDEF'],
'arm': [None, 'UNDEF'],
'arm64': [None, 'UNDEF'],
'loongarch64': [None, 'UNDEF'],
Expand All @@ -454,6 +471,7 @@
'security': {'i386': [None, 'UNDEF'],
'x86_64': [185, 'UNDEF'],
'x32': [185, 'UNDEF'],
'alpha': [None, 'UNDEF'],
'arm': [None, 'UNDEF'],
'arm64': [None, 'UNDEF'],
'loongarch64': [None, 'UNDEF'],
Expand All @@ -472,6 +490,7 @@
'stty': {'i386': [31, 'UNDEF'],
'x86_64': [None, 'UNDEF'],
'x32': [None, 'UNDEF'],
'alpha': [None, 'UNDEF'],
'arm': [None, 'UNDEF'],
'arm64': [None, 'UNDEF'],
'loongarch64': [None, 'UNDEF'],
Expand All @@ -490,6 +509,7 @@
'_sysctl': {'i386': [149, 'UNDEF'],
'x86_64': [156, 'UNDEF'],
'x32': [None, 'UNDEF'],
'alpha': [319, 'UNDEF'],
'arm': [149, 'UNDEF'],
'arm64': [None, 'UNDEF'],
'loongarch64': [None, 'UNDEF'],
Expand All @@ -508,6 +528,7 @@
'tuxcall': {'i386': [None, 'UNDEF'],
'x86_64': [184, 'UNDEF'],
'x32': [184, 'UNDEF'],
'alpha': [397, 'UNDEF'],
'arm': [None, 'UNDEF'],
'arm64': [None, 'UNDEF'],
'loongarch64': [None, 'UNDEF'],
Expand All @@ -526,6 +547,7 @@
'ulimit': {'i386': [58, 'UNDEF'],
'x86_64': [None, 'UNDEF'],
'x32': [None, 'UNDEF'],
'alpha': [None, 'UNDEF'],
'arm': [None, 'UNDEF'],
'arm64': [None, 'UNDEF'],
'loongarch64': [None, 'UNDEF'],
Expand All @@ -544,6 +566,7 @@
'uselib': {'i386': [86, 'UNDEF'],
'x86_64': [134, 'UNDEF'],
'x32': [None, 'UNDEF'],
'alpha': [313, 'UNDEF'],
'arm': [86, 'UNDEF'],
'arm64': [None, 'UNDEF'],
'loongarch64': [None, 'UNDEF'],
Expand All @@ -562,6 +585,7 @@
'vserver': {'i386': [273, 'UNDEF'],
'x86_64': [236, 'UNDEF'],
'x32': [None, 'UNDEF'],
'alpha': [428, 'UNDEF'],
'arm': [313, 'UNDEF'],
'arm64': [None, 'UNDEF'],
'loongarch64': [None, 'UNDEF'],
Expand Down
4 changes: 4 additions & 0 deletions src/arch-syscall-dump.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
#include "arch-mips64.h"
#include "arch-mips64n32.h"
#include "arch-aarch64.h"
#include "arch-alpha.h"
#include "arch-parisc.h"
#include "arch-parisc64.h"
#include "arch-ppc.h"
Expand Down Expand Up @@ -109,6 +110,9 @@ int main(int argc, char *argv[])
case SCMP_ARCH_AARCH64:
sys = aarch64_syscall_iterate(iter);
break;
case SCMP_ARCH_ALPHA:
sys = alpha_syscall_iterate(iter);
break;
case SCMP_ARCH_LOONGARCH64:
sys = loongarch64_syscall_iterate(iter);
break;
Expand Down
Loading