summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* tests: add a test for the different types of socket syscallsworking-pcmoorePaul 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-096-26/+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>
* db: store the rules used to build the filterPaul Moore2016-02-096-61/+110
| | | | | | | This will be useful in future patches for rebuilding and manipulating the filter. Signed-off-by: Paul Moore <pmoore@redhat.com>
* db: make the individual db filter ops privatePaul Moore2016-02-093-379/+422
| | | | | | | | | | We really should operate only on filter collections so move all the individual DB filter operations out of api.c and into db.c. There are likely other changes that can now be done to further clean the code, but I'll leave that as future work. Signed-off-by: Paul Moore <pmoore@redhat.com>
* arch: basic support for multiplexed and direct socket syscalls on x86Paul Moore2015-11-111-0/+73
| | | | | | | We need better support than this, but this commit should provide the most basic support. Signed-off-by: Paul Moore <pmoore@redhat.com>
* arch: update the syscalls for Linux 4.3Paul Moore2015-11-1112-38/+38
| | | | | | | Some additional testing/work is needed to ensure everything works correctly with the direct wired socket syscalls on x86. Signed-off-by: Paul Moore <pmoore@redhat.com>
* arch: update s390/s390x system call tablesHeiko Carstens2015-11-1113-63/+131
| | | | | | | | | | | | | | | | | | | | s390 and s390x gained quite a few new system calls: - numa related system calls - the separated socket system calls - two more s390 specific pci mmio system calls All architectures got the new membarrier and userfaultfd system calls. This patch updates the s390 specific system call tables and updates other architectures where needed. Also remove some extra whitespace from the s390 specific system call tables. Both 'make check' and './regression -T live' still work for s390 and s390x after this update. Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com> Signed-off-by: Paul Moore <pmoore@redhat.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>
* tests: s390 python test fixJan Willeke2015-09-081-0/+1
| | | | | Signed-off-by: Jan Willeke <willeke@linux.vnet.ibm.com> Signed-off-by: Paul Moore <pmoore@redhat.com>
* tests: remove fuzzing from 28-sim-arch_x86.testsPaul Moore2015-09-012-10/+0
| | | | | | | We forgot that we can't fuzz arch specific tests as the fuzzing only works on the native system. Signed-off-by: Paul Moore <pmoore@redhat.com>
* db: fix a minor style problemPaul Moore2015-09-011-1/+1
| | | | Signed-off-by: Paul Moore <pmoore@redhat.com>
* tools: add the missing s390/s390x support to scmp_bpf_disasmPaul Moore2015-08-291-0/+4
| | | | Signed-off-by: Paul Moore <pmoore@redhat.com>
* api: limit errno values to MAX_ERRNOPaul Moore2015-08-294-1/+22
| | | | | | | | | | It turns out that userspace behaves oddly when given an errno value greater than MAX_ERRNO, so much so that the kernel seccomp mechanism has started blocking filters with bad errno values. Let's try to catch the problem at rule addition time to make things easier to spot and fix. Signed-off-by: Paul Moore <pmoore@redhat.com>
* arch: use private syscall #define offsets to prevent collisionsPaul Moore2015-08-294-1336/+1336
| | | | | Reported-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: Paul Moore <pmoore@redhat.com>
* docs: improve kill/trap documentation text in seccomp_init(3)Mike Frysinger2015-08-281-6/+11
| | | | | | | | | | The current description is fairly light as to the runtime behavior when the filters fail. Expand more to make it clear what happens between the two modes. Signed-off-by: Mike Frysinger <vapier@gentoo.org> [PM: tweaked subject line, changed 'BRm' macro to 'BR'] Signed-off-by: Paul Moore <pmoore@redhat.com>
* pfc: add missing ppc namesMike Frysinger2015-08-281-0/+6
| | | | | Signed-off-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: Paul Moore <pmoore@redhat.com>
* Merge branch 'working-s390' into masterPaul Moore2015-08-2833-49/+1313
|\ | | | | | | Signed-off-by: Paul Moore <pmoore@redhat.com>
| * s390x: fix python testsJan Willeke2015-08-062-0/+3
| | | | | | | | | | | | | | | | The s390 glib c uses more / different syscalls, thus the test have to allow more to work on s390. Signed-off-by: Jan Willeke <willeke@linux.vnet.ibm.com> Signed-off-by: Paul Moore <pmoore@redhat.com>
| * s390x: fix plattform detectionJan Willeke2015-07-132-4/+4
| | | | | | | | | | | | | | | | | | Because on S390x both __s390x__ and __s390__ are defined, the check of __s390x__ must be before __s390__. Signed-off-by: Jan Willeke <willeke@linux.vnet.ibm.com> [PM: subject tweaks] Signed-off-by: Paul Moore <pmoore@redhat.com>
| * python: add s390 and s390x supportPaul Moore2015-07-133-0/+10
| | | | | | | | Signed-off-by: Paul Moore <pmoore@redhat.com>
| * arch: add support for s390Jan Willeke2015-07-1315-6/+603
| | | | | | | | | | | | | | | | 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-1323-5/+640
| | | | | | | | | | | | | | | | 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>
* | tests: fix miniseq and "make distcheck"Paul Moore2015-08-271-1/+14
| | | | | | | | | | | | This is a bit of a hack, but it works; fix it later. Signed-off-by: Paul Moore <pmoore@redhat.com>
* | all: block negative syscall numbers from the filterPaul Moore2015-08-2712-46/+193
| | | | | | | | | | | | | | | | | | | | | | We use negative syscalls numbers to indicate syscalls that aren't supported by a certain arch/ABI and unfortunately there were cases where these bogus syscall values were finding their way into the filter. This patch corrects this and adds a new test to check for this in the future. Reported-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: Paul Moore <pmoore@redhat.com>
* | arch: fix a problem with the rule rewrites in _seccomp_rule_add()Paul Moore2015-08-271-1/+1
| | | | | | | | | | | | | | A typo was causing the return value from arch_fitler_rewrite() to be ignored in cases where -EDOM was returned. Signed-off-by: Paul Moore <pmoore@redhat.com>
* | all: minor tweak to make astyle v2.05.1 happyPaul Moore2015-08-261-1/+0
| | | | | | | | Signed-off-by: Paul Moore <pmoore@redhat.com>
* | build: fix == bashismMike Frysinger2015-08-241-1/+1
| | | | | | | | | | | | | | | | The test tool only has = for comparison, not ==. The latter is accepted by bash and other shells, but is not in POSIX. Signed-off-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: Paul Moore <pmoore@redhat.com>
* | tools: eliminate the shared exit_usage() functionPaul Moore2015-08-124-19/+30
| | | | | | | | | | | | I'm still not quite sure why this was shared in the first place. Signed-off-by: Paul Moore <pmoore@redhat.com>
* | tools: support more LD modes in disassemblerDavid Drysdale2015-08-121-0/+24
| | | | | | | | | | | | | | | | | | Add support for other modes for LD/LDX operations (even though they are rare in seccomp BPF programs), specifically BPF_IMM, BPF_IND, BPF_LEN and BPF_MSH. Signed-off-by: David Drysdale <drysdale@google.com> Signed-off-by: Paul Moore <pmoore@redhat.com>
* | tools: add Dot output option to scmp_bpf_disasmDavid Drysdale2015-08-121-72/+193
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Generate a rough program flowchart when '-d' option specified. This output can be converted into a graph with the Dot tool: % tests/02-sim-basic -b | tools/scmp_bpf_disasm -d | dot -Tpdf > out.pdf Details: - Add '-d' option to generate Dot output rather than listing. - Convert bpf_decode_op() to return string rather than printing, to allow re-use. - Encapsulate action string generation in bpf_decode_action() to allow re-use. Signed-off-by: David Drysdale <drysdale@google.com> Signed-off-by: Paul Moore <pmoore@redhat.com>
* | doc: include some direct subscription links for our mailing listPaul Moore2015-08-051-1/+2
| | | | | | | | | | | | As suggested by Nikos Mavrogiannopoulos. Signed-off-by: Paul Moore <pmoore@redhat.com>
* | arch: update the syscall tables for 4.2-rc5Paul Moore2015-08-0511-11/+34
| | | | | | | | | | | | The only update this time around is "switch_endian" for ppc. Signed-off-by: Paul Moore <pmoore@redhat.com>
* | Merge branch 'working-ppc64'Paul Moore2015-08-0534-11/+1468
|\ \ | | | | | | | | | | | | | | | Mike Strosaker <strosake@linux.vnet.ibm.com> reports that the working-ppc64 branch is working for both 'make check' and './regression -T live'.
| * | tests: add ppc support to the regression testsBogdan Purcareata2015-02-173-2/+6
| | | | | | | | | | | | | | | Signed-off-by: Bogdan Purcareata <bogdan.purcareata@freescale.com> Signed-off-by: Paul Moore <pmoore@redhat.com>
| * | tools: add ppc supportBogdan Purcareata2015-02-174-0/+9
| | | | | | | | | | | | | | | Signed-off-by: Bogdan Purcareata <bogdan.purcareata@freescale.com> Signed-off-by: Paul Moore <pmoore@redhat.com>
| * | arch: add basic initial ppc support to the arch-dependent codeBogdan Purcareata2015-02-173-1/+17
| | | | | | | | | | | | | | | Signed-off-by: Bogdan Purcareata <bogdan.purcareata@freescale.com> Signed-off-by: Paul Moore <pmoore@redhat.com>
| * | arch: add a ppc syscall tableBogdan Purcareata2015-02-178-2/+623
| | | | | | | | | | | | | | | | | | 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>
| * | Merge branch 'master' into working-ppc64Paul Moore2015-02-1211-17/+50
| |\ \
| * | | tests: minor fix in arch-syscall-checkBogdan Purcareata2015-02-111-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Sent against working-ppc64. Signed-off-by: Bogdan Purcareata <bogdan.purcareata@freescale.com> Signed-off-by: Paul Moore <pmoore@redhat.com>
| * | | ppc64: correct the ppc64 syscall table and validation scriptPaul Moore2015-02-102-13/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * | | tests: add ppc64 support to the regression live testsBogdan Purcareata2015-02-101-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Otherwise The live tests will fail with "ERROR arch ppc64 not supported" Send against the working-ppc64 branch. Signed-off-by: Bogdan Purcareata <bogdan.purcareata@freescale.com> [PM: added ppc64le] Signed-off-by: Paul Moore <pmoore@redhat.com>
| * | | tests: add ppc64 support to the regression testsPaul Moore2015-02-067-2/+20
| | | | | | | | | | | | | | | | Signed-off-by: Paul Moore <pmoore@redhat.com>
| * | | tools: add ppc64 supportPaul Moore2015-02-064-0/+20
| | | | | | | | | | | | | | | | Signed-off-by: Paul Moore <pmoore@redhat.com>
| * | | arch: add the basic initial support for ppc64 to the arch-dependent codePaul Moore2015-02-063-0/+30
| | | | | | | | | | | | | | | | Signed-off-by: Paul Moore <pmoore@redhat.com>
| * | | arch: add a ppc64 syscall tablePaul Moore2015-02-0617-7/+739
| | | | | | | | | | | | | | | | Signed-off-by: Paul Moore <pmoore@redhat.com>
* | | | tests: don't link miniseq with any of our librariesPaul Moore2015-07-171-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When merging bfac175ac1222ca59045eeecd8d27df9dd7bab4d ("tests: fix sequence number generation") I mistakenly removed a line from the patch which kept us from linking miniseq with the various libseccomp libraries. Mathias did it correctly, I screwed it up; this patch should put things right. Reported-by: Mathias Krause <minipli@googlemail.com> Signed-off-by: Paul Moore <pmoore@redhat.com>