Commit ab373bdf by Christian Brauner Committed by GitHub

Merge pull request #1578 from 0x0916/export-seccomp-filter-to-log

seccomp: export the seccomp filter after load it into kernel successful
parents 9795e880 5107af32
...@@ -791,6 +791,18 @@ int lxc_seccomp_load(struct lxc_conf *conf) ...@@ -791,6 +791,18 @@ int lxc_seccomp_load(struct lxc_conf *conf)
ERROR("Error loading the seccomp policy: %s.", strerror(-ret)); ERROR("Error loading the seccomp policy: %s.", strerror(-ret));
return -1; return -1;
} }
/* After load seccomp filter into the kernel successfully, export the current seccomp
* filter to log file */
#if HAVE_SCMP_FILTER_CTX
if ((lxc_log_get_level() <= LXC_LOG_PRIORITY_TRACE || conf->loglevel <= LXC_LOG_PRIORITY_TRACE) &&
lxc_log_fd >= 0) {
ret = seccomp_export_pfc(conf->seccomp_ctx, lxc_log_fd);
/* Just give an warning when export error */
if (ret < 0)
WARN("Failed to export seccomp filter to log file: %s.", strerror(-ret));
}
#endif
return 0; return 0;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment