summaryrefslogtreecommitdiff
path: root/src/core/execute.c
diff options
context:
space:
mode:
authorFelipe Sateler <fsateler@debian.org>2016-08-31 10:00:35 -0300
committerFelipe Sateler <fsateler@gmail.com>2016-09-06 20:25:49 -0300
commitd347d9029c7ec6b30eaaab93649105d935061b55 (patch)
tree56eb156c3cc79fb33a6005069e661db255982d06 /src/core/execute.c
parent29272d9e03b85deafe30ff79aa291afe7cceb430 (diff)
seccomp: also detect if seccomp filtering is enabled
In https://github.com/systemd/systemd/pull/4004 , a runtime detection method for seccomp was added. However, it does not detect the case where CONFIG_SECCOMP=y but CONFIG_SECCOMP_FILTER=n. This is possible if the architecture does not support filtering yet. Add a check for that case too. While at it, change get_proc_field usage to use PR_GET_SECCOMP prctl, as that should save a few system calls and (unnecessary) allocations. Previously, reading of /proc/self/stat was done as recommended by prctl(2) as safer. However, given that we need to do the prctl call anyway, lets skip opening, reading and parsing the file. Code for checking inspired by https://outflux.net/teach-seccomp/autodetect.html
Diffstat (limited to 'src/core/execute.c')
-rw-r--r--src/core/execute.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/core/execute.c b/src/core/execute.c
index 55f15d7e49..2026137721 100644
--- a/src/core/execute.c
+++ b/src/core/execute.c
@@ -1077,7 +1077,7 @@ static void rename_process_from_path(const char *path) {
static bool skip_seccomp_unavailable(const Unit* u, const char* msg) {
if (!is_seccomp_available()) {
log_open();
- log_unit_debug(u, "SECCOMP not detected in the kernel, skipping %s", msg);
+ log_unit_debug(u, "SECCOMP features not detected in the kernel, skipping %s", msg);
log_close();
return true;
}