diff options
author | Evgeny Vereshchagin <evvers@ya.ru> | 2016-09-07 06:44:06 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-09-07 06:44:06 +0300 |
commit | c5d5fc91eba8541a3a86ff6b839a2b6e824f4149 (patch) | |
tree | 5ac8a407c10f16e024b07a92a1d14f89b43244c5 /src/nspawn/nspawn-seccomp.c | |
parent | 29272d9e03b85deafe30ff79aa291afe7cceb430 (diff) | |
parent | fd74fa791f95433ac52520764b67e6fb4bda2c0e (diff) |
Merge pull request #4087 from fsateler/detect-seccomp-filter
seccomp: also detect if seccomp filtering is available
Diffstat (limited to 'src/nspawn/nspawn-seccomp.c')
-rw-r--r-- | src/nspawn/nspawn-seccomp.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/nspawn/nspawn-seccomp.c b/src/nspawn/nspawn-seccomp.c index 3ab7160ebe..44a0b397ab 100644 --- a/src/nspawn/nspawn-seccomp.c +++ b/src/nspawn/nspawn-seccomp.c @@ -130,6 +130,11 @@ int setup_seccomp(uint64_t cap_list_retain) { scmp_filter_ctx seccomp; int r; + if (!is_seccomp_available()) { + log_debug("SECCOMP features not detected in the kernel, disabling SECCOMP audit filter"); + return 0; + } + seccomp = seccomp_init(SCMP_ACT_ALLOW); if (!seccomp) return log_oom(); @@ -173,11 +178,6 @@ int setup_seccomp(uint64_t cap_list_retain) { } r = seccomp_load(seccomp); - if (r == -EINVAL) { - log_debug_errno(r, "Kernel is probably not configured with CONFIG_SECCOMP. Disabling seccomp audit filter: %m"); - r = 0; - goto finish; - } if (r < 0) { log_error_errno(r, "Failed to install seccomp audit filter: %m"); goto finish; |