Repository navigation
RFE: Add Alpha support #481
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -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 | ||||||||||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The other arches have a fallback for older kernel headers. AUDIT_ARCH_ALPHA has been around long enough that it probably doesn't matter, but for consistency:
Suggested change
|
||||||||||||||||||
|
|
||||||||||||||||||
| /** | ||||||||||||||||||
| * The LoongArch architecture tokens | ||||||||||||||||||
| */ | ||||||||||||||||||
|
|
||||||||||||||||||
| 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, | ||
| }; |
| 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 |
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -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', | ||||||||||
|
|
@@ -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'], | ||||||||||
|
|
@@ -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'], | ||||||||||
|
|
@@ -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'], | ||||||||||
|
|
@@ -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'], | ||||||||||
|
|
@@ -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'], | ||||||||||
|
|
@@ -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'], | ||||||||||
|
|
@@ -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'], | ||||||||||
|
|
@@ -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'], | ||||||||||
|
|
@@ -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'], | ||||||||||
|
|
@@ -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'], | ||||||||||
|
|
@@ -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'], | ||||||||||
|
|
@@ -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'], | ||||||||||
|
|
@@ -363,7 +375,8 @@ | |||||||||
| 'sh': [None, 'UNDEF']}, | ||||||||||
| 'nfsservctl': {'i386': [169, 'UNDEF'], | ||||||||||
| 'x86_64': [180, 'UNDEF'], | ||||||||||
| 'x32': [None, 'UNDEF'], | ||||||||||
| 'x32': [42, 'UNDEF'], | ||||||||||
| 'alpha': [None, 'UNDEF'], | ||||||||||
|
Comment on lines
+378
to
+379
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. x32 doesn't have nfsservctl:
Suggested change
|
||||||||||
| 'arm': [169, 'UNDEF'], | ||||||||||
| 'arm64': [42, 'UNDEF'], | ||||||||||
| 'loongarch64': [42, 'UNDEF'], | ||||||||||
|
|
@@ -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'], | ||||||||||
|
|
@@ -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'], | ||||||||||
|
|
@@ -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'], | ||||||||||
|
|
@@ -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'], | ||||||||||
|
|
@@ -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'], | ||||||||||
|
|
@@ -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'], | ||||||||||
|
|
@@ -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'], | ||||||||||
|
|
@@ -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'], | ||||||||||
|
|
@@ -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'], | ||||||||||
|
|
@@ -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'], | ||||||||||
|
|
@@ -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'], | ||||||||||
|
|
||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks like a fix for building against kernel headers that predate open_tree_attr, not something alpha-specific (alpha's headers define it as 577). Could it go in a separate commit?