| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
Signed-off-by: Paul Moore <pmoore@redhat.com>
|
|
|
|
|
|
|
|
|
| |
This patch doesn't completely disable the python bindings, but it
makes it much harder to enable them. I'm doing this because I'm
not quite comfortable yet with shipping these without having at least
one user to point to and say, "yes, these bindings are reasonable."
Signed-off-by: Paul Moore <pmoore@redhat.com>
|
|
|
|
| |
Signed-off-by: Paul Moore <pmoore@redhat.com>
|
|
|
|
|
|
|
|
| |
It turns out that it is fairly common for people to use SCMP_SYS() as
a constant/initializer so the change to have it point at a function
breaks a few things.
Signed-off-by: Paul Moore <pmoore@redhat.com>
|
|
|
|
|
| |
Reported-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Paul Moore <pmoore@redhat.com>
|
|
|
|
|
|
|
|
| |
The new syscall resolver program which leverages the internal syscall
tables is much better suited to our mult-arch capabilities so were
just going to drop this script.
Signed-off-by: Paul Moore <pmoore@redhat.com>
|
|
|
|
|
|
|
|
|
| |
The 14-reset test on x86 wasn't correctly skipping the "write" sycall
(number 4). This moves the ranges over by one to line up correctly. Without
this, "regression -b 14-reset -s 007" would always fail.
Signed-off-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Paul Moore <pmoore@redhat.com>
|
|
|
|
| |
Signed-off-by: Paul Moore <pmoore@redhat.com>
|
|
|
|
| |
Signed-off-by: Paul Moore <pmoore@redhat.com>
|
|
|
|
| |
Signed-off-by: Paul Moore <pmoore@redhat.com>
|
|
|
|
|
|
| |
This patch ensures that you can create non-native filters using
syscalls not present in the native architecture.
Signed-off-by: Paul Moore <pmoore@redhat.com>
|
|
|
|
| |
Signed-off-by: Paul Moore <pmoore@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
| |
Random changes, including but not limited to:
- Fix test numbering, again, as I screwed it up a bit last time
- Use $(...) consistently for sub-shells
- Comment tweaks
- Added some verify_deps checks
- Cleaned up some of the output formatting in the test functions
Signed-off-by: Paul Moore <pmoore@redhat.com>
|
|
|
|
| |
Signed-off-by: Paul Moore <pmoore@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
| |
Normally sys_resolver does not translate syscalls which means that in
some cases, e.g. socket() on x86, the returned syscall number could be
a negative number (__PNR_socket). This patch adds a new option, '-t',
which causes sys_resolver to attempt to do the translation and return
the translated syscall number instead, e.g. socketcall() for socket() on
x86.
Signed-off-by: Paul Moore <pmoore@redhat.com>
|
|
|
|
| |
Signed-off-by: Paul Moore <pmoore@redhat.com>
|
|
|
|
| |
Signed-off-by: Paul Moore <pmoore@redhat.com>
|
|
|
|
|
|
| |
Also remove some dead code while we are in there making changes.
Signed-off-by: Paul Moore <pmoore@redhat.com>
|
|
|
|
| |
Signed-off-by: Paul Moore <pmoore@redhat.com>
|
|
|
|
|
|
| |
The ">> INFO: ..." messages aren't needed in verbose builds.
Signed-off-by: Paul Moore <pmoore@redhat.com>
|
|
|
|
| |
Signed-off-by: Paul Moore <pmoore@redhat.com>
|
|
|
|
| |
Signed-off-by: Paul Moore <pmoore@redhat.com>
|
|
|
|
| |
Signed-off-by: Paul Moore <pmoore@redhat.com>
|
|
|
|
|
|
|
|
| |
Similar to the existing seccomp_syscall_resolve_name() function, but
they work for arbitrary architectures (assuming libseccomp support of
course) and not just the native architecture.
Signed-off-by: Paul Moore <pmoore@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Fix the following problem:
Traceback (most recent call last):
File "./16-arch-basic.py", line 47, in <module>
ctx = test(args)
File "./16-arch-basic.py", line 33, in test
if not Arch.system() == Arch.X86:
TypeError: descriptor 'system' of 'seccomp.Arch' object needs an argument
Signed-off-by: Paul Moore <pmoore@redhat.com>
|
|
|
|
| |
Signed-off-by: Paul Moore <pmoore@redhat.com>
|
|
|
|
| |
Signed-off-by: Paul Moore <pmoore@redhat.com>
|
|
|
|
|
| |
Signed-off-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Paul Moore <pmoore@redhat.com>
|
|
|
|
|
| |
Signed-off-by: Thiago Marcos P. Santos <thiago.santos@intel.com>
Signed-off-by: Paul Moore <pmoore@redhat.com>
|
|
|
|
|
|
|
| |
In C we add seccomp_arch_native(void), in Python we add Arch.system().
Both functions return an architecture token value.
Signed-off-by: Paul Moore <pmoore@redhat.com>
|
|
|
|
|
|
|
| |
Correct all of the i386 ipc syscalls using glibc sources as a
reference.
Signed-off-by: Paul Moore <pmoore@redhat.com>
|
|
|
|
|
|
|
| |
Correct all of the i386 socket syscalls via the socketcall() syscall
using the glibc and kernel sources as a reference.
Signed-off-by: Paul Moore <pmoore@redhat.com>
|
|
|
|
| |
Signed-off-by: Paul Moore <pmoore@redhat.com>
|
|\
| |
| |
| |
| | |
Conflicts:
src/gen_bpf.c
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
In some cases when generating BPF filters, if a particular argument chain
did not match, the filter would fall through to the default action for the
architecture instead of checking on other argument chains for the same
syscall. This patch corrects this problem by ensuring that all argument
chains are evaluated.
Signed-off-by: Paul Moore <pmoore@redhat.com>
|
|/
|
|
|
|
|
|
|
|
| |
In some cases when generating BPF filters, if a particular argument chain
did not match, the filter would fall through to the default action for the
architecture instead of checking on other argument chains for the same
syscall. This patch corrects this problem by ensuring that all argument
chains are evaluated.
Signed-off-by: Paul Moore <pmoore@redhat.com>
|
|
|
|
| |
Signed-off-by: Paul Moore <pmoore@redhat.com>
|
|
|
|
| |
Signed-off-by: Paul Moore <pmoore@redhat.com>
|
|
|
|
|
|
|
|
| |
The existing test is too large to fit within the standard Linux Kernel BPF
size limit if generated correctly so shrink it so we don't run into size
problems.
Signed-off-by: Paul Moore <pmoore@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
| |
Support running non-native architecture tests buy prefixing the
architecture with a "+" in the test file. Example:
test type: bpf-sim
00-test +x86 read N N N N N N
00-test +x86_64 read N N N N N N
Signed-off-by: Paul Moore <pmoore@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
In order to test non-native architectures using our existing regression
test infrastructure and BPF simulator we need to be able to resolve
syscall names on arbitrary architectures.
This patch moves aside the existing bash script and replaces it with a
small C progream which uses some internal libseccomp routines to resolve
the syscall.
Signed-off-by: Paul Moore <pmoore@redhat.com>
|
|
|
|
| |
Signed-off-by: Paul Moore <pmoore@redhat.com>
|
|
|
|
| |
Signed-off-by: Paul Moore <pmoore@redhat.com>
|
|
|
|
|
|
|
|
| |
This patch adds Python bindings using Cython, see http://www.cython.org
for more information. There are also some minor tweaks to the build
macros while we are mucking around in macros.mk; nothing major.
Signed-off-by: Paul Moore <pmoore@redhat.com>
|
|
|
|
|
|
| |
seccomp_merge() API
Signed-off-by: Paul Moore <pmoore@redhat.com>
|
|
|
|
| |
Signed-off-by: Paul Moore <pmoore@redhat.com>
|
|
|
|
|
|
|
|
|
| |
Add the seccomp_arch_add() and seccomp_arch_remove() functions to add
and remove architectures from the filter. This patch also adds the
seccomp_merge() function which merges two filter contexts together
assuming there is no architecture conflicts.
Signed-off-by: Paul Moore <pmoore@redhat.com>
|
|
|
|
|
|
|
|
| |
Certain operations don't make sense with multiple architectures so
we disable them only when more than one architecture has been added
to the given filter.
Signed-off-by: Paul Moore <pmoore@redhat.com>
|
|
|
|
|
|
|
|
| |
Add support for multiple architectures/filters to the PFC filter
generation code. This patch also cleans up the PFC output a bit in
hopes of making it more readable and consistent.
Signed-off-by: Paul Moore <pmoore@redhat.com>
|
|
|
|
|
|
|
| |
Since only _gen_bpf_chain() called _gen_bpf_chain_lvl() move the
function inside _gen_bpf_chain().
Signed-off-by: Paul Moore <pmoore@redhat.com>
|