-
Notifications
You must be signed in to change notification settings - Fork 187
RFE: Add support for SPARC #471
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
Open
glaubitz
wants to merge
2
commits into
seccomp:main
Choose a base branch
from
glaubitz:sparc-support
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -283,6 +283,18 @@ | |
| #define __PNR_getpagesize -10249 | ||
| #define __PNR_riscv_hwprobe -10250 | ||
| #define __PNR_uretprobe -10251 | ||
| #define __PNR_execv -10252 | ||
| #define __PNR_getdomainname -10253 | ||
| #define __PNR_getresgid -10254 | ||
| #define __PNR_getresuid -10255 | ||
| #define __PNR_kern_features -10256 | ||
| #define __PNR_memory_ordering -10257 | ||
| #define __PNR_perfctr -10258 | ||
| #define __PNR_sched_get_affinity -10259 | ||
| #define __PNR_sched_set_affinity -10260 | ||
| #define __PNR_setresgid -10261 | ||
| #define __PNR_setresuid -10262 | ||
| #define __PNR_utrap_install -10263 | ||
|
|
||
| /* | ||
| * libseccomp syscall definitions | ||
|
|
@@ -580,6 +592,8 @@ | |
|
|
||
| #define __SNR_eventfd2 __NR_eventfd2 | ||
|
|
||
| #define __SNR_execv __NR_execv | ||
|
|
||
| #define __SNR_execve __NR_execve | ||
|
|
||
| #define __SNR_execveat __NR_execveat | ||
|
|
@@ -648,6 +662,10 @@ | |
|
|
||
| #define __SNR_fgetxattr __NR_fgetxattr | ||
|
|
||
| #define __SNR_file_getattr __NR_file_getattr | ||
|
|
||
| #define __SNR_file_setattr __NR_file_setattr | ||
|
|
||
| #define __SNR_finit_module __NR_finit_module | ||
|
|
||
| #define __SNR_flistxattr __NR_flistxattr | ||
|
|
@@ -802,6 +820,8 @@ | |
|
|
||
| #define __SNR_getdents64 __NR_getdents64 | ||
|
|
||
| #define __SNR_getdomainname __NR_getdomainname | ||
|
|
||
| #ifdef __NR_getegid | ||
| #define __SNR_getegid __NR_getegid | ||
| #else | ||
|
|
@@ -1036,6 +1056,8 @@ | |
|
|
||
| #define __SNR_kcmp __NR_kcmp | ||
|
|
||
| #define __SNR_kern_features __NR_kern_features | ||
|
|
||
| #ifdef __NR_kexec_file_load | ||
| #define __SNR_kexec_file_load __NR_kexec_file_load | ||
| #else | ||
|
|
@@ -1152,6 +1174,8 @@ | |
| #define __SNR_memfd_secret __PNR_memfd_secret | ||
| #endif | ||
|
|
||
| #define __SNR_memory_ordering __NR_memory_ordering | ||
|
|
||
| #ifdef __NR_migrate_pages | ||
| #define __SNR_migrate_pages __NR_migrate_pages | ||
| #else | ||
|
|
@@ -1356,6 +1380,8 @@ | |
| #define __SNR_open_tree __PNR_open_tree | ||
| #endif | ||
|
|
||
| #define __SNR_open_tree_attr __PNR_open_tree_attr | ||
|
|
||
| #define __SNR_openat __NR_openat | ||
|
|
||
| #define __SNR_openat2 __NR_openat2 | ||
|
|
@@ -1386,6 +1412,8 @@ | |
|
|
||
| #define __SNR_perf_event_open __NR_perf_event_open | ||
|
|
||
| #define __SNR_perfctr __PNR_perfctr | ||
|
Member
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. I think this should this be: |
||
|
|
||
| #define __SNR_personality __NR_personality | ||
|
|
||
| #define __SNR_pidfd_getfd __NR_pidfd_getfd | ||
|
|
@@ -1672,6 +1700,8 @@ | |
| #define __SNR_s390_sthyi __PNR_s390_sthyi | ||
| #endif | ||
|
|
||
| #define __SNR_sched_get_affinity __NR_sched_get_affinity | ||
|
|
||
| #define __SNR_sched_get_priority_max __NR_sched_get_priority_max | ||
|
|
||
| #define __SNR_sched_get_priority_min __NR_sched_get_priority_min | ||
|
|
@@ -1692,6 +1722,8 @@ | |
| #define __SNR_sched_rr_get_interval_time64 __PNR_sched_rr_get_interval_time64 | ||
| #endif | ||
|
|
||
| #define __SNR_sched_set_affinity __NR_sched_set_affinity | ||
|
|
||
| #define __SNR_sched_setaffinity __NR_sched_setaffinity | ||
|
|
||
| #define __SNR_sched_setattr __NR_sched_setattr | ||
|
|
@@ -2368,6 +2400,8 @@ | |
| #define __SNR_utimes __PNR_utimes | ||
| #endif | ||
|
|
||
| #define __SNR_utrap_install __PNR_utrap_install | ||
|
Member
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. I think this should this be: |
||
|
|
||
| #ifdef __NR_vfork | ||
| #define __SNR_vfork __NR_vfork | ||
| #else | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,58 @@ | ||
| /** | ||
| * Enhanced Seccomp sparc Specific Code | ||
| * | ||
| * Copyright (c) 2015 Freescale <bogdan.purcareata@freescale.com> | ||
| * 2025 John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de> | ||
| * Author: Bogdan Purcareata <bogdan.purcareata@freescale.com> | ||
| * John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de> | ||
| * | ||
| * Derived from the PPC-specific code | ||
| * | ||
| */ | ||
|
|
||
| /* | ||
| * 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 <string.h> | ||
| #include <linux/audit.h> | ||
|
|
||
| #include "db.h" | ||
| #include "syscalls.h" | ||
| #include "arch.h" | ||
| #include "arch-sparc.h" | ||
|
|
||
| /* sparc syscall numbers */ | ||
| #define __sparc_NR_socketcall 206 | ||
| #define __sparc_NR_ipc 215 | ||
|
|
||
| ARCH_DEF(sparc) | ||
|
|
||
| const struct arch_def arch_def_sparc = { | ||
| .token = SCMP_ARCH_SPARC, | ||
| .token_bpf = AUDIT_ARCH_SPARC, | ||
| .size = ARCH_SIZE_32, | ||
| .endian = ARCH_ENDIAN_BIG, | ||
| .sys_socketcall = __sparc_NR_socketcall, | ||
| .sys_ipc = __sparc_NR_ipc, | ||
| .syscall_resolve_name = abi_syscall_resolve_name_munge, | ||
| .syscall_resolve_name_raw = sparc_syscall_resolve_name, | ||
| .syscall_resolve_num = abi_syscall_resolve_num_munge, | ||
| .syscall_resolve_num_raw = sparc_syscall_resolve_num, | ||
| .syscall_rewrite = abi_syscall_rewrite, | ||
| .rule_add = abi_rule_add, | ||
| .syscall_name_kver = sparc_syscall_name_kver, | ||
| .syscall_num_kver = sparc_syscall_num_kver, | ||
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| /** | ||
| * Enhanced Seccomp sparc Specific Code | ||
| * | ||
| * Copyright (c) 2015 Freescale <bogdan.purcareata@freescale.com> | ||
| * 2025 John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de> | ||
| * Author: Bogdan Purcareata <bogdan.purcareata@freescale.com> | ||
| * John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de> | ||
| * | ||
| * Derived from the PPC-specific code | ||
| * | ||
| */ | ||
|
|
||
| /* | ||
| * 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_SPARC_H | ||
| #define _ARCH_SPARC_H | ||
|
|
||
| #include "arch.h" | ||
|
|
||
| #ifdef sparc | ||
| #undef sparc | ||
| #endif | ||
|
|
||
| ARCH_DECL(sparc) | ||
|
|
||
| #endif |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,58 @@ | ||
| /** | ||
| * Enhanced Seccomp sparc64 Specific Code | ||
| * | ||
| * Copyright (c) 2015 Freescale <bogdan.purcareata@freescale.com> | ||
| * 2025 John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de> | ||
| * Author: Bogdan Purcareata <bogdan.purcareata@freescale.com> | ||
| * John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de> | ||
| * | ||
| * Derived from the PPC-specific code | ||
| * | ||
| */ | ||
|
|
||
| /* | ||
| * 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 <string.h> | ||
| #include <linux/audit.h> | ||
|
|
||
| #include "db.h" | ||
| #include "syscalls.h" | ||
| #include "arch.h" | ||
| #include "arch-sparc64.h" | ||
|
|
||
| /* sparc64 syscall numbers */ | ||
| #define __sparc64_NR_socketcall 206 | ||
| #define __sparc64_NR_ipc 215 | ||
|
|
||
| ARCH_DEF(sparc64) | ||
|
|
||
| const struct arch_def arch_def_sparc64 = { | ||
| .token = SCMP_ARCH_SPARC64, | ||
| .token_bpf = AUDIT_ARCH_SPARC64, | ||
| .size = ARCH_SIZE_64, | ||
| .endian = ARCH_ENDIAN_BIG, | ||
| .sys_socketcall = __sparc64_NR_socketcall, | ||
| .sys_ipc = __sparc64_NR_ipc, | ||
| .syscall_resolve_name = abi_syscall_resolve_name_munge, | ||
| .syscall_resolve_name_raw = sparc64_syscall_resolve_name, | ||
| .syscall_resolve_num = abi_syscall_resolve_num_munge, | ||
| .syscall_resolve_num_raw = sparc64_syscall_resolve_num, | ||
| .syscall_rewrite = abi_syscall_rewrite, | ||
| .rule_add = abi_rule_add, | ||
| .syscall_name_kver = sparc64_syscall_name_kver, | ||
| .syscall_num_kver = sparc64_syscall_num_kver, | ||
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| /** | ||
| * Enhanced Seccomp sparc64 Specific Code | ||
| * | ||
| * Copyright (c) 2015 Freescale <bogdan.purcareata@freescale.com> | ||
| * 2025 John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de> | ||
| * Author: Bogdan Purcareata <bogdan.purcareata@freescale.com> | ||
| * John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de> | ||
| * | ||
| * Derived from the PPC-specific code | ||
| * | ||
| */ | ||
|
|
||
| /* | ||
| * 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_SPARC64_H | ||
| #define _ARCH_SPARC64_H | ||
|
|
||
| #include "arch.h" | ||
|
|
||
| ARCH_DECL(sparc64) | ||
|
|
||
| #endif |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
I think this should this be: