-
Notifications
You must be signed in to change notification settings - Fork 308
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
seccomp: move generation out of cgroup and do not fail on unknown syscalls #211
seccomp: move generation out of cgroup and do not fail on unknown syscalls #211
Conversation
Needs rebase. |
generate the seccomp profile in the parent process, not from init while running with cgroups configured. The reason is that seccomp generation might require more memory than it is configured in the cgroups. crun memory consumption is more predictable now, and can run with less than 500Kb of memory in the cgroup (I've tested that it runs reliably with 250Kb and never hit any OOM). Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
when a syscall that is not known to libseccomp is specified, ignore it instead of failing. It makes easier to use newer seccomp policies on systems using an older libseccomp. It is possible to keep the previous behavior using the "run.oci.seccomp_fail_unknown_syscall=1" annotation. Closes: containers#156 Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
5618453
to
4bf2698
Compare
@giuseppe Could you fix the issue that @haircommander pointed out in this PR. |
int libcrun_generate_and_load_seccomp (libcrun_container_t *container, int outfd, char **flags, size_t flags_len, libcrun_error_t *err); | ||
enum | ||
{ | ||
LIBCRUN_SECCOMP_FAIL_UNKNOWN_SYSCALL = 1 << 0, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why shift by 0? or am I misreading here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no misreading, it is really a shift by 0 :-) It is a nop but it makes clear it is a bitmask
LGTM |
two separate changes I've put together on the same PR to avoid rebasing:
The first one is to move seccomp generation out of the init process. It improves memory usage for the init process and now containers (assuming the init process doesn't need more) can run with 250K memory max configured in the cgroup.
The second one is to not fail on unknown syscalls specified to seccomp. An annotation is added too keep the previous behaviour.
More details are in the commit messages.
Signed-off-by: Giuseppe Scrivano gscrivan@redhat.com