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
Filter namespace creation args to clone in default seccomp policy #8054
base: main
Are you sure you want to change the base?
Conversation
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: dgl The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Hi @dgl. Thanks for your PR. I'm waiting for a cri-o member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
8c27109
to
eb9d001
Compare
/ok-to-test |
test/clone-ns.c
Outdated
@@ -0,0 +1,17 @@ | |||
#define _GNU_SOURCE |
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.
TESTDATA is test/testdata
, I think that's a better fit for this anyway and moving it there will fix the test as is I think
Currently unshare is filtered by the seccomp policy mutator, but clone isn't. This filters args to clone that can create a namespace, blocking both ways of creating a namespace. This also unfortunately means clone3 has to be entirely disabled, because it's not possible to filter the struct with cBPF. Signed-off-by: David Leadbeater <dgl@dgl.cx>
@dgl: The following tests failed, say
Full PR test history. Your PR dashboard. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
PR needs rebase. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
What type of PR is this?
/kind bug
What this PR does / why we need it:
The default seccomp policy used by cri-o did not previously block
clone()
withCLONE_NEWNS
and other namespace creation flags. This PR blocks those flags. In addition it has to disableclone3
as it is not currently possible to filter a struct argument with seccomp, this matches the approach taken by containerd.Which issue(s) this PR fixes:
Special notes for your reviewer:
I can't actually get the bats test to pass in my environment, but then I don't see some of the existing seccomp tests pass, so not sure what's happening there.
Does this PR introduce a user-facing change?