summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
...
* build: fix 'make distcheck'Paul Moore2017-02-062-3/+2
| | | | Signed-off-by: Paul Moore <paul@paul-moore.com>
* build: update the Travis CI configurationPaul Moore2017-02-051-11/+13
| | | | | | | | Two major changes: don't require sudo (allows the use of the Travis container infrastructure) and run the clang static analyzer as one of the tests. Signed-off-by: Paul Moore <paul@paul-moore.com>
* doc: add reporting information to README.mdPaul Moore2017-02-051-1/+7
| | | | Signed-off-by: Paul Moore <paul@paul-moore.com>
* build: add a Travis CI status badge to the README.mdPaul Moore2017-02-051-0/+1
| | | | Signed-off-by: Paul Moore <paul@paul-moore.com>
* build: add initial support for Travis CIPaul Moore2017-02-031-0/+43
| | | | Signed-off-by: Paul Moore <paul@paul-moore.com>
* python: add support for Python 3.xPaul Moore2017-02-036-10/+31
| | | | | | | | | | | This patch adds the necessary tweaks to support building against Python v2.x and v3.x. In the process we also fix some problems with the Python live tests; it is unclear when they broke, but they are working now. Tested on Python v2.7.13 and v3.6.0. Signed-off-by: Paul Moore <paul@paul-moore.com>
* doc: fixed seccomp_rule_add(3) manpage examplevaloq2017-02-021-0/+9
| | | | | | Signed-off-by: valoq <valoq@mailbox.org> [PM: subject line tweak and whitespace fixes] Signed-off-by: Paul Moore <paul@paul-moore.com>
* doc: refined header comment of `seccomp_arch_add`.Jay Guo2017-02-021-2/+2
| | | | | | | | | | Refined `seccomp_arch_add` to be more verbose about return code `-EEXIST` in case of existing arch in filter. Adding this information helps developers write code to safely ignore the ret code in this case. Signed-off-by: Jiannan Guo <guojiannan1101@gmail.com> [PM: tweaked subject line] Signed-off-by: Paul Moore <paul@paul-moore.com>
* doc: fix typo in reference: "seccom_merge"Vladimir Rutsky2017-02-021-1/+1
| | | | | Signed-off-by: Vladimir Rutsky <vladimir@rutsky.org> Signed-off-by: Paul Moore <paul@paul-moore.com>
* arch: removed unnecessary call in `seccomp_add_arch`.Jiannan Guo2017-02-021-4/+2
| | | | | | | | | Some logic in the implementation of `seccomp_add_arch` can never be reached and `arch_def_lookup` was called redundantly. Signed-off-by: Jiannan Guo <guojiannan1101@gmail.com> [PM: update subject line] Signed-off-by: Paul Moore <paul@paul-moore.com>
* arch: update the syscall tables to 4.10-rc6+Paul Moore2017-02-023-10/+10
| | | | Signed-off-by: Paul Moore <paul@paul-moore.com>
* all: update the syscall validation code/scripts for January 2017Paul Moore2017-01-2530-185/+157
| | | | | | | | 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: update syscalls for Linux 4.9Justin Cormack2017-01-2514-12/+92
| | | | | | | | | | | Add support for the following syscalls added in Linux v4.9: - preadv2 and pwritev2 - pkey_mprotect, pkey_alloc, pkey_free Signed-off-by: Justin Cormack <justin.cormack@docker.com> [PM: update subject line, description, and some whitespace] Signed-off-by: Paul Moore <paul@paul-moore.com>
* doc: add the CII Best Practices badge to the READMEPaul Moore2017-01-131-0/+2
| | | | Signed-off-by: Paul Moore <paul@paul-moore.com>
* doc: convert the README to Markdown for better use on GitHubPaul Moore2017-01-131-9/+9
| | | | Signed-off-by: Paul Moore <paul@paul-moore.com>
* man: clarify SCMP_FLTATR_CTL_NNP semanticLuca Bruno2016-06-201-3/+4
| | | | | | | | | Clarify that the zero value results in a no-op on libseccomp side, and applications will need to have to have proper caps or set NO_NEW_PRIVS by themself. Signed-off-by: Luca Bruno <lucab@debian.org> Signed-off-by: Paul Moore <paul@paul-moore.com>
* tests: sort out simulation blacklist/whitelistLuca Bruno2016-06-028-27/+182
| | | | | | | | This commit sorts out a mismatch between simulation tests, properly laying down a blacklist and a whitelist simulation. Signed-off-by: Luca Bruno <lucab@debian.org> Signed-off-by: Paul Moore <paul@paul-moore.com>
* arch: Add parisc architecture supportHelge Deller2016-05-2518-1/+656
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch (v4) adds support for the parisc and parisc64 architectures to libseccomp. I didn't split up the patch, because it's pretty trivial. Those parisc-specific files gets added: src/arch-parisc-syscalls.c src/arch-parisc.c src/arch-parisc.h src/arch-parisc64.c All other changes are trivial because they simply add parisc-specific case statements in variouse switch statements. I did ran a "make check" on x86-64 and parisc and all testcases succeeded. All live testcases succeed as well when running "./regression -T live". The patch applies cleanly to current libseccomp git head. Changes between v4 and v3 of this patch: - Added parisc arch to arch-syscall-check.c and fixup syscall table as needed - Fixed copyright notices in parisc files as suggested by Mike Frysinger Changes between v3 and v2 of this patch: - Stripped out patch which reports if a check was skipped because valgrind isn't installed. - Added tuxcall pseudo syscall for 19-sim-missing_syscalls testcase - Added sysmips pseudo syscall for 29-sim-pseudo_syscall testcase Changes between v2 and v1 of this patch: - Enabled seccomp mode 2 regression tests on parisc. Kernel support for hppa was added in kernel 4.6-rc1 and backported into the kernel v4.5.2 stable series. Signed-off-by: Helge Deller <deller@gmx.de> [PM: corrected a number or errors from 'make check-syntax'] Signed-off-by: Paul Moore <paul@paul-moore.com>
* doc: fix typo in seccomp_merge.3Luca Bruno2016-05-241-1/+1
| | | | | Signed-off-by: Luca Bruno <lucab@debian.org> Signed-off-by: Paul Moore <paul@paul-moore.com>
* tools: add missing ALU operations in bpf.hDavid Drysdale2016-05-052-0/+9
| | | | | | | | | The disassembler and local constants are missing the xor and mod operations. Unlikely to occur, but it's nice to be complete. Signed-off-by: David Drysdale <drysdale@google.com> Signed-off-by: Paul Moore <paul@paul-moore.com>
* doc: update the CHANGELOG for the v2.3.1 releasePaul Moore2016-04-201-1/+6
| | | | | Signed-off-by: Paul Moore <paul@paul-moore.com> (imported from commit 578dc996b9738c30493bf49884d442413f09642a)
* arch: fix the multiplexed ipc() syscallsPaul Moore2016-04-203-6/+6
| | | | | | | | Unfortunately we were only properly handling some of the multiplexed ipc() syscalls, this patch correctly handles all of the ipc() syscalls. Signed-off-by: Paul Moore <paul@paul-moore.com>
* s390: handle multiplexed syscalls correctlyPaul Moore2016-04-2012-13/+979
| | | | | | | | | | It turns out the socket and ipc related syscalls are also multiplexed on s390/s390x much like they are on 32-bit x86. Further making things difficult is that starting with Linux 4.3 the socket syscalls are also available as directly wired versions, much like 32-bit x86. This patch attempts to fix all those problems. Signed-off-by: Paul Moore <paul@paul-moore.com>
* tests: replace socket syscall references in 15-basic-resolverPaul Moore2016-04-192-7/+7
| | | | | | | | On 32-bit x86 the resolved socket syscall() doesn't always resolve to the __NR_socket value due to the direct wired socket syscall so replace it with the read() syscall to ensure the test doesn't fail. Signed-off-by: Paul Moore <paul@paul-moore.com>
* tests: always display skipped testsPaul Moore2016-04-181-3/+7
| | | | Signed-off-by: Paul Moore <paul@paul-moore.com>
* tests: Report if test was skipped because of missing valgrindHelge Deller2016-04-181-0/+1
| | | | | | | | | | | | Print a message if a regression test was skipped just because valgrind isn't installed. This additional info is useful for architectures (e.g. parisc) which aren't as fast as x86_64. On parisc it seemed that the whole testcase was hanging, now people know what's actually happening. Signed-off-by: Helge Deller <deller@gmx.de> Signed-off-by: Paul Moore <paul@paul-moore.com>
* arch: fix a number of 32-bit x86 failures related to socket syscallsPaul Moore2016-04-083-5/+105
| | | | | | | | | | | | | | It turns out there was still a few bugs with the 32-bit x86 socket syscalls, especially on systems with older kernel headers installed. This patch corrects these problems and perhaps more importantly, returns the resolver API functions to returning the negative pseudo syscall numbers in the case of 32-bit x86, this helps ensure things continue to work as they did before as the API does not change. It it important to note that libseccomp still generates filter code for both multiplexed and direct socket syscalls regardless. Signed-off-by: Paul Moore <paul@paul-moore.com>
* doc: update the CHANGELOG for the v2.3.0 releasePaul Moore2016-02-261-0/+10
| | | | Signed-off-by: Paul Moore <paul@paul-moore.com>
* python: update the bindings metadataPaul Moore2016-02-261-1/+1
| | | | Signed-off-by: Paul Moore <paul@paul-moore.com>
* build: swap '()' for '{}' in Makefiles for consistencyPaul Moore2016-02-262-2/+2
| | | | Signed-off-by: Paul Moore <paul@paul-moore.com>
* system: update the ABI whitelist for the seccomp() syscallPaul Moore2016-02-261-0/+6
| | | | | | | | | | Special thanks to those on the "Reported-by" line who helped test this. Reported-by: Marcin Juszkiewicz <mjuszkiewicz@redhat.com> Reported-by: than <than@redhat.com> Reported-by: Heiko Carstens <heiko.carstens@de.ibm.com> Signed-off-by: Paul Moore <paul@paul-moore.com>
* doc: update the CREDITS filePaul Moore2016-02-251-0/+5
| | | | Signed-off-by: Paul Moore <paul@paul-moore.com>
* system: fix the SECCOMP_SET_MODE_STRICT definePaul Moore2016-02-241-8/+1
| | | | | Reported-by: Jan Engelhardt <jengelh@inai.de> Signed-off-by: Paul Moore <paul@paul-moore.com>
* tests: create a simple live test to verify we can set the TSYNC attributePaul Moore2016-02-225-3/+165
| | | | Signed-off-by: Paul Moore <paul@paul-moore.com>
* all: use the seccomp() syscall whenever possible for tested ABIsPaul Moore2016-02-224-34/+96
| | | | | | | | | | | | | The seccomp() syscall was first added in Linux 3.17 so most systems should now support this syscall. Most importantly, the use of the seccomp() syscall enabled the thread sync functionality which isn't possible with prctl(); although callers still need to enable the flag per-filter as the thread sync default is disabled. This patch also unified the return values of the sys_chk_*() functions. Signed-off-by: Paul Moore <paul@paul-moore.com>
* python: update the python bindings to match the C versionPaul Moore2016-02-222-1/+18
| | | | Signed-off-by: Paul Moore <paul@paul-moore.com>
* arch: update the syscall tables to 4.5-rc4+Paul Moore2016-02-1912-13/+37
| | | | 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>
* api: add a seccomp_version() API callPaul Moore2016-02-189-4/+210
| | | | | | | | This will allow callers to dynamically query the libseccomp library to determine the version information. We do not currently plan on exposing this API via any of the supported language bindings. Signed-off-by: Paul Moore <paul@paul-moore.com>
* all: update my email addressPaul Moore2016-02-11122-122/+122
| | | | | | | 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>
* build: fix a 'make dist' problem caused by a missing 00-test.c filePaul Moore2016-02-101-0/+1
| | | | | Reported-by: Marcus Meissner <meissner@suse.de> Signed-off-by: Paul Moore <paul@paul-moore.com>
* system: use sys/prctl.h instead of linux/prctl.hPaul Moore2016-02-101-1/+1
| | | | | | | | This should help on systems that use alternate libc implementations. Reported-by: anarchpenguin Reported-by: Kylie McClain somasis@exherbo.org Signed-off-by: Paul Moore <paul@paul-moore.com>
* Attempt to fix the following problem:Paul Moore2016-02-101-5/+15
| | | | | | | | | | | | | | | In file included from system.c:26:0: ../include/seccomp.h:1250:0: warning: "__NR_cacheflush" redefined #define __NR_cacheflush __PNR_cacheflush ^ In file included from ../include/seccomp.h:27:0, from system.c:26: /usr/mips64-unknown-linux-gnu/usr/include/asm/unistd.h:934:0: note: this is the location of the previous definition #define __NR_cacheflush (__NR_Linux + 197) Reported-by: Mike Frysinger <vapier@gmail.com> Signed-off-by: Paul Moore <paul@paul-moore.com>
* tests: add a test for the different types of socket syscallsPaul Moore2016-02-095-3/+170
| | | | | | | | We need to test that we are generating filters that can handle both the legacy multiplexed socket syscalls as well as the new direct wired socket syscalls. Signed-off-by: Paul Moore <paul@paul-moore.com>
* arch: generate both multiplexed and direct socket syscall rulesPaul Moore2016-02-097-99/+231
| | | | | | | | | Linux 4.3 added direct-wired socket syscalls in addition to the multiplexed socket syscalls available via socketcall(). This patch causes libseccomp to generate filters for socket syscall methods on x86 systems. Signed-off-by: Paul Moore <paul@paul-moore.com>
* arch: enable more involved arch/ABI specific rule creationPaul Moore2016-02-0915-99/+41
| | | | | | | Create the infrastructure for arch/ABI specific rule creation that allows us much more involved arch/ABI customization. Signed-off-by: Paul Moore <pmoore@redhat.com>
* arch: move the low level filter rule addition code into the arch layerPaul Moore2016-02-0917-80/+140
| | | | | | | | | | | | | The arch specific filter rewrite code is going to need to become more complex so move the low level rule addition code directly into the arch layer instead of the db layer, but still keep the tree manipulation code in the db layer. This patch also creates a new arch specific rule_add() function table entry and allows for this function to create multiple rules from a single rule. Signed-off-by: Paul Moore <pmoore@redhat.com>
* arch: make use of function tables instead of switch statementsPaul Moore2016-02-0915-75/+84
| | | | Signed-off-by: Paul Moore <pmoore@redhat.com>
* db: introduce transaction supportPaul Moore2016-02-092-2/+187
| | | | | | | | | | | | This patch adds basic transaction support to the db layer. The db transactions allow callers to checkpoint a filter collection at the current point in time and later rollback the filter collection if necessary. There will be some overhead at the start of the transaction to generate the checkpoint, but transaction commit and abort rollbacks are guaranteed to succeed. Transactions may be nested. Signed-off-by: Paul Moore <pmoore@redhat.com>