summaryrefslogtreecommitdiff
path: root/src/arch-syscall-validate
Commit message (Collapse)AuthorAgeFilesLines
* arch: Add 32-bit Motorola 68000 supportJohn Paul Adrian Glaubitz2023-04-251-0/+32
| | | | | | Signed-off-by: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de> Acked-by: Paul Moore <paul@paul-moore.com> Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
* arch: Add 64-bit LoongArch supportXiaotian Wu2023-02-181-0/+50
| | | | | | | Signed-off-by: Xiaotian Wu <wuxiaotian@loongson.cn> Signed-off-by: WANG Xuerui <git@xen0n.name> Acked-by: Tom Hromatka <tom.hromatka@oracle.com> Signed-off-by: Paul Moore <paul@paul-moore.com>
* arch: disambiguate $(( in arch-syscall-validateKir Kolyshkin2022-09-211-2/+2
| | | | | | | | | | | | | | | | | | shellcheck complains: > In arch-syscall-validate line 785: > sc_list=$((for abi in $abi_list; do > ^-- SC1102 (error): Shells disambiguate $(( differently or not at all. For $(command substitution), add space after $( . For $((arithmetics)), fix parsing errors. Another tool, shfmt, can't even parse the file: > arch-syscall-validate:785:17: not a valid arithmetic operator: abi Add a space to resolve this. Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com> Acked-by: Paul Moore <paul@paul-moore.com> Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
* arch: require arch-syscall-dump from arch-syscall-validateKir Kolyshkin2022-09-211-4/+5
| | | | | | | | | | | | | | | | | The arch-syscall-dump is almost always used from arch-syscall-validate (the only exception I found is when -c and -l are given), so it makes sense to check that it's available beforehand. Without this patch, when arch-syscall-dump is not present, the script produces lots of output with a few errors about the missing ./arch-syscall-dump hidden in the middle of it. To keep things simple, we require arch-syscall-dump even when it is not going to be used. Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com> Acked-by: Paul Moore <paul@paul-moore.com> Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
* arch: fix a typo in arch-syscall-validateKir Kolyshkin2022-09-191-1/+1
| | | | | Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com> Signed-off-by: Paul Moore <paul@paul-moore.com>
* arch: basic infrastructure for tracking per-syscall/ABI kernel versionsPaul Moore2022-05-091-29/+56
| | | | | | | | | | | | This commit adds basic support for tracking what kernel introduced a syscall for a given arch/ABI. It does not provide any of that kernel version information, leaving only a SCMP_KV_UNDEF placeholder, nor does it attempt to do anything meaningful with this new source of information; this patch simply establishes a new syscalls.csv format so that we can start properly recording the kernel versions. Acked-by: Tom Hromatka <tom.hromatka@oracle.com> Signed-off-by: Paul Moore <paul@paul-moore.com>
* arch: Add SuperH 32-bit supportJohn Paul Adrian Glaubitz2021-03-081-1/+34
| | | | | | | | | | Initial support for seccomp for SuperH in Linux was added in 2.6.27-rc2, support for SECCOMP_FILTER was added for Linux 5.9. This adds support for SuperH in libseccomp, both for little-endian and big-endian mode. Signed-off-by: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de> Acked-by: Tom Hromatka <tom.hromatka@oracle.com> Signed-off-by: Paul Moore <paul@paul-moore.com>
* arch: cleanup the syscalls.csv formatPaul Moore2020-06-151-6/+2
| | | | | | | This should provide a nice clean display in the GitHub CSV viewer. Acked-by: Tom Hromatka <tom.hromatka@oracle.com> Signed-off-by: Paul Moore <paul@paul-moore.com>
* aarch64: Use architecture specific header to general syscallsAlex Murray2020-05-181-1/+1
| | | | | | | | | This ensures clone3, getrlimit and setrlimit are defined for aarch64 - also update syscalls.csv from 5.6.0 to pick up these new syscalls Signed-off-by: Alex Murray <alex.murray@canonical.com> Reviewed-by: Tom Hromatka <tom.hromatka@oracle.com> Signed-off-by: Paul Moore <paul@paul-moore.com>
* arch: simplify the MIPS ABI syscall generation codePaul Moore2020-03-231-57/+15
| | | | | | | The MIPS ABIs now use the parser friendly syscall.tbl format so make use of that to simplify our code. Signed-off-by: Paul Moore <paul@paul-moore.com>
* arch: simplify the ppc/ppc64 code in arch-syscall-validatePaul Moore2020-03-231-12/+2
| | | | | | | We no longer need to do the complex substitutions we used to have to do for ppc/ppc64. Signed-off-by: Paul Moore <paul@paul-moore.com>
* arch: fix the library output of arch-syscall-validatePaul Moore2020-03-231-5/+4
| | | | | | | We no longer need to correct the syscall offsets for x32, mips, mips64, and mips64n32. Signed-off-by: Paul Moore <paul@paul-moore.com>
* arch: use gperf to generate a perfact hash to lookup syscall namesGiuseppe Scrivano2020-03-231-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch significantly improves the performance of seccomp_syscall_resolve_name since it replaces the expensive strcmp for each syscall in the database, with a lookup table. The complexity for syscall_resolve_num is not changed and it uses the linear search, that is anyway less expensive than seccomp_syscall_resolve_name as it uses an index for comparison instead of doing a string comparison. On my machine, calling 1000 seccomp_syscall_resolve_name_arch and seccomp_syscall_resolve_num_arch over the entire syscalls DB passed from ~0.45 sec to ~0.06s. PM: After talking with Giuseppe I made a number of additional changes, some substantial, the highlights include: * various style tweaks * .gitignore fixes * fixed subject line, tweaked the description * dropped the arch-syscall-validate changes as they were masking other problems * extracted the syscalls.csv and file deletions to other patches to keep this one more focused * fixed the x86, x32, arm, all the MIPS ABIs, s390, and s390x ABIs as the syscall offsets were not properly incorporated into this change * cleaned up the ABI specific headers * cleaned up generate_syscalls_perf.sh and renamed to arch-gperf-generate * fixed problems with automake's file packaging Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com> Reviewed-by: Tom Hromatka <tom.hromatka@oracle.com> [PM: see notes in the "PM" section above] Signed-off-by: Paul Moore <paul@paul-moore.com>
* arch: add missing parisc64 support to arch-syscall-validatePaul Moore2020-03-221-0/+25
| | | | | | | | Commit c61950e1d972 ("arch: add missing parisc and parisc64 support to arch-syscall-validate") forgot to add parisc64 support, this patch fixes that. Signed-off-by: Paul Moore <paul@paul-moore.com>
* arch: add missing parisc and parisc64 support to arch-syscall-validatePaul Moore2020-03-211-5/+46
| | | | | | | For some reason we completely forgot to add this ABIs to the arch-syscall-validate script. Signed-off-by: Paul Moore <paul@paul-moore.com>
* arch: rework/fix the arch-syscall-validate scriptPaul Moore2020-03-201-107/+269
| | | | | | | | | | Update the arch-syscall-validate script to be "CSV friendly" in preparation for follow-up work to move the libseccomp internal syscall tables into a single CVS file. In this process of making this change, a number of unrelated problems with the script were identified and fixed. Signed-off-by: Paul Moore <paul@paul-moore.com>
* arch: Add riscv64 support to syscall validate scriptTom Hromatka2020-03-101-0/+45
| | | | | | | This patch adds riscv64 support to arch-syscall-validate. Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com> Signed-off-by: Paul Moore <paul@paul-moore.com>
* arch: update the syscalls for Linux v5.0-rc5Tom Hromatka2019-02-191-31/+41
| | | | | | | | | | | | | | | | Key changes include: * Added __NR_statx, __NR_io_pgetevents, and __NR_rseq syscalls to seccomp.h.in * mips architecture now generates some of its syscall header files. Added logic to arch-syscall-validate to create these headers * ppc architecture now uses a syscall.tbl * s390 now uses a syscall.tbl This addresses GitHub issue #136 Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com> Signed-off-by: Paul Moore <paul@paul-moore.com>
* all: update the syscall validation code/scripts for January 2017Paul Moore2017-01-251-17/+10
| | | | | | | | A variety of updates to reflect changes in the Linux Kernel and the library itself with the goal of making sure the syscall checking scripts continue to work. Signed-off-by: Paul Moore <paul@paul-moore.com>
* build: ensure we sort the library and kernel syscall lists the same during ↵Paul Moore2017-01-251-1/+1
| | | | | | validation Signed-off-by: Paul Moore <paul@paul-moore.com>
* arch: fix syscall validate script so ppc64 is checked againPaul Moore2016-02-191-1/+15
| | | | | | | This patch also adds some extra checking to ensure this doesn't happen again. Signed-off-by: Paul Moore <paul@paul-moore.com>
* all: update my email addressPaul Moore2016-02-111-1/+1
| | | | | | | Employer agnostic emails make things a lot easier in the long run so make sure the paul-moore.com address is used whenever it makes sense. Signed-off-by: Paul Moore <paul@paul-moore.com>
* arch: fixes and improvements to the arch-syscall-validate scriptPaul Moore2015-11-111-22/+57
| | | | | | | Fix a few problems with the arch-syscall-validate script, do some minor cleanups, and ensure it works correctly against Linux v4.3. Signed-off-by: Paul Moore <pmoore@redhat.com>
* Merge branch 'working-s390' into masterPaul Moore2015-08-281-13/+74
|\ | | | | | | Signed-off-by: Paul Moore <pmoore@redhat.com>
| * arch: add support for s390Jan Willeke2015-07-131-1/+29
| | | | | | | | | | | | | | | | This patch adds support for S390 (32-bit) architecture. Signed-off-by: Jan Willeke <willeke@linux.vnet.ibm.com> [PM: rewrote the subject line, style fixes, s390x/s390 typo bugfixes] Signed-off-by: Paul Moore <pmoore@redhat.com>
| * arch: add support for s390xJan Willeke2015-07-131-1/+29
| | | | | | | | | | | | | | | | This patch adds support for S390x (64-bit) architecture. Signed-off-by: Jan Willeke <willeke@linux.vnet.ibm.com> [PM: rewrote the subject line, style fixes] Signed-off-by: Paul Moore <pmoore@redhat.com>
* | Merge branch 'working-ppc64'Paul Moore2015-08-051-1/+59
|\ \ | |/ |/| | | | | | | Mike Strosaker <strosake@linux.vnet.ibm.com> reports that the working-ppc64 branch is working for both 'make check' and './regression -T live'.
| * arch: add a ppc syscall tableBogdan Purcareata2015-02-171-1/+30
| | | | | | | | | | | | Signed-off-by: Bogdan Purcareata <bogdan.purcareata@freescale.com> [PM: slight reordering of ppc/ppc64 in header files and makefiles] Signed-off-by: Paul Moore <pmoore@redhat.com>
| * ppc64: correct the ppc64 syscall table and validation scriptPaul Moore2015-02-101-1/+1
| | | | | | | | | | | | | | | | We didn't correctly take into account the __powerpc64__ define when generating the ppc64 syscall table. This patch also updates the syscall table to match Linux v3.19. Signed-off-by: Paul Moore <pmoore@redhat.com>
| * arch: add a ppc64 syscall tablePaul Moore2015-02-061-1/+30
| | | | | | | | Signed-off-by: Paul Moore <pmoore@redhat.com>
* | arch: add the ability to dump the sycall definitions in arch-syscall-validatePaul Moore2015-07-011-23/+42
| | | | | | | | | | | | Also do some minor cleanup while we are touching the file. Signed-off-by: Paul Moore <pmoore@redhat.com>
* | arch: update the syscall validate script to reflect changes in x86Paul Moore2015-07-011-3/+3
| | | | | | | | Signed-off-by: Paul Moore <pmoore@redhat.com>
* | arm: add some missing syscallsPaul Moore2015-05-061-12/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Add the following syscalls to the ARM arch/ABI and update the syscall validation script. * breakpoint() * cacheflush() * usr26() * usr32() * set_tls() Reported-by: Purcareata Bogdan <b43198@freescale.com> Signed-off-by: Paul Moore <pmoore@redhat.com>
* | arm: fix some problems with the syscall tablePaul Moore2015-04-101-1/+1
|/ | | | | | | | | | | | | | | | | | | | | | | The 32-bit ARM syscall table mistakenly included syscall definitions for the syscalls below. This patch redefines those syscalls to libseccomp's pseudo-syscall numbers and corrects the arch-syscall-validate to correctly list the 32-bit ARM syscalls. * time * umount * stime * alarm * utime * getrlimit * select * readdir * mmap * socketcall * syscall * ipc Reported-by: Andreas Farber <afaerber@suse.de> Signed-off-by: Paul Moore <pmoore@redhat.com>
* arch: Add AArch64 supportMarcin Juszkiewicz2014-08-271-1/+47
| | | | | | | | This patch adds support for AArch64 (64-bit ARM) architecture. Signed-off-by: Marcin Juszkiewicz <mjuszkiewicz@redhat.com> (Additional fixes/corrections/etc.) Signed-off-by: Paul Moore <pmoore@redhat.com>
* arch: add mips64n32 to the defaults in arch-syscall-validatePaul Moore2014-08-211-1/+1
| | | | Signed-off-by: Paul Moore <pmoore@redhat.com>
* arch: fix the arch-syscall-validate script for x86/x86_64/x32Paul Moore2014-08-201-9/+9
| | | | | | | Don't rely on the header files for x86/x86_64/x32, check the syscall source tables directly. Signed-off-by: Paul Moore <pmoore@redhat.com>
* arch: add mips64n32 supportPaul Moore2014-08-201-0/+39
| | | | Signed-off-by: Paul Moore <pmoore@redhat.com>
* arch: add mips64 supportPaul Moore2014-08-201-1/+40
| | | | Signed-off-by: Paul Moore <pmoore@redhat.com>
* tests: provide a simple syscall validation toolPaul Moore2014-06-241-0/+323
Signed-off-by: Paul Moore <pmoore@redhat.com>