summaryrefslogtreecommitdiffstats
path: root/src/shared/seccomp-util.h (follow)
Commit message (Collapse)AuthorAgeFilesLines
...
* seccomp-util: move @default to the first positionZbigniew Jędrzejewski-Szmek2016-11-031-1/+2
| | | | Now that the list is user-visible, @default should be first.
* seccomp: add two new syscall groupsLennart Poettering2016-11-021-0/+2
| | | | | | | | | | @resources contains various syscalls that alter resource limits and memory and scheduling parameters of processes. As such they are good candidates to block for most services. @basic-io contains a number of basic syscalls for I/O, similar to the list seccomp v1 permitted but slightly more complete. It should be useful for building basic whitelisting for minimal sandboxes
* seccomp: add test-seccomp test toolLennart Poettering2016-10-241-0/+1
| | | | This validates the system call set table and many of our seccomp-util.c APIs.
* seccomp: add new helper call seccomp_load_filter_set()Lennart Poettering2016-10-241-0/+2
| | | | | This allows us to unify most of the code in apply_protect_kernel_modules() and apply_private_devices().
* seccomp: add new seccomp_init_conservative() helperLennart Poettering2016-10-241-1/+3
| | | | | | | | | | | | | | | | | This adds a new seccomp_init_conservative() helper call that is mostly just a wrapper around seccomp_init(), but turns off NNP and adds in all secondary archs, for best compatibility with everything else. Pretty much all of our code used the very same constructs for these three steps, hence unifying this in one small function makes things a lot shorter. This also changes incorrect usage of the "scmp_filter_ctx" type at various places. libseccomp defines it as typedef to "void*", i.e. it is a pointer type (pretty poor choice already!) that casts implicitly to and from all other pointer types (even poorer choice: you defined a confusing type now, and don't even gain any bit of type safety through it...). A lot of the code assumed the type would refer to a structure, and hence aded additional "*" here and there. Remove that.
* core: rework syscall filter set handlingLennart Poettering2016-10-241-5/+27
| | | | | | | | | | | | | | | | | | | | | | | | A variety of fixes: - rename the SystemCallFilterSet structure to SyscallFilterSet. So far the main instance of it (the syscall_filter_sets[] array) used to abbreviate "SystemCall" as "Syscall". Let's stick to one of the two syntaxes, and not mix and match too wildly. Let's pick the shorter name in this case, as it is sufficiently well established to not confuse hackers reading this. - Export explicit indexes into the syscall_filter_sets[] array via an enum. This way, code that wants to make use of a specific filter set, can index it directly via the enum, instead of having to search for it. This makes apply_private_devices() in particular a lot simpler. - Provide two new helper calls in seccomp-util.c: syscall_filter_set_find() to find a set by its name, seccomp_add_syscall_filter_set() to add a set to a seccomp object. - Update SystemCallFilter= parser to use extract_first_word(). Let's work on deprecating FOREACH_WORD_QUOTED(). - Simplify apply_private_devices() using this functionality
* core: do not fail at step SECCOMP if there is no kernel support (#4004)Felipe Sateler2016-08-221-0/+2
| | | Fixes #3882
* core: add pre-defined syscall groups to SystemCallFilter= (#3053) (#3157)Topi Miettinen2016-06-011-0/+7
| | | | | | Implement sets of system calls to help constructing system call filters. A set starts with '@' to distinguish from a system call. Closes: #3053, #3157
* tree-wide: remove Emacs lines from all filesDaniel Mack2016-02-101-2/+0
| | | | | This should be handled fine now by .dir-locals.el, so need to carry that stuff in every file.
* shared: include what we useThomas Hindoe Paaboel Andersen2015-12-061-0/+1
| | | | | The next step of a general cleanup of our includes. This one mostly adds missing includes but there are a few removals as well.
* seccomp-util.h: make sure seccomp-util.h can be included aloneLennart Poettering2014-12-121-0/+1
|
* seccomp: add helper call to add all secondary archs to a seccomp filterLennart Poettering2014-02-181-0/+2
| | | | | And make use of it where appropriate for executing services and for nspawn.
* core: add SystemCallArchitectures= unit setting to allow disabling of non-nativeLennart Poettering2014-02-131-0/+26
architecture support for system calls Also, turn system call filter bus properties into complex types instead of concatenated strings.