Skip to content
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

Fix seccomp notify inconsistencies #1096

Merged
merged 2 commits into from
Mar 19, 2021

Conversation

rata
Copy link
Contributor

@rata rata commented Mar 18, 2021

In PR #1074 I missed some consts, sorry!

Funny thing is we didn't catch them even when we used this in runc and containerd patches because containerd just passes a string (see commit for a detailed explanation) and runc doesn't use these constants (again, full explanation in the commit msg).

cc @vbatts @giuseppe as you LGTM to #1074.

@rata rata changed the title Rata seccomp listenerpath Fix seccomp notify inconsistencies Mar 18, 2021
This wasn't catched before, even though we had working patches for
containerd and runc in advance, as neither containerd nor runc really
use these consts.

In the spec this field is a string[1] and therefore when containerd
parses with json.Unmarshall[2] it works just fine. With runc is not used
either, as it uses a different struct in the libcontainer directory[3].

Therefore, even with patches using this change, this const definition
was missed as it is not used by the patches.

[1]: https://github.com/opencontainers/runtime-spec/blob/a8c4a9ee0f6b5a0b994c5c23c68725394e2b0d9d/specs-go/config.go#L641
[2]: https://github.com/containerd/containerd/blob/8dbe53a2a930af3631229e4d92cf839b64ee5a38/contrib/seccomp/seccomp.go#L36-L40
[3]: https://github.com/opencontainers/runc/pull/2682/files#diff-9915e69bab45a993d366aad4a7d47459d73ec4304b7c33942f197dd221673376R51
[4]: https://github.com/opencontainers/runtime-spec/blob/a8c4a9ee0f6b5a0b994c5c23c68725394e2b0d9d/specs-go/config.go#L614

Signed-off-by: Rodrigo Campos <rodrigo@kinvolk.io>
Copy link
Member

@giuseppe giuseppe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Commit "Add Seccomp Notify support"
(58798e7) just added
SECCOMP_FILTER_FLAG_NEW_LISTENER to the schema and not to the list of
flags in config-linux.md. However, it was a mistake to add them to the
schema, as the user will never really need to specify that flag.

Signed-off-by: Rodrigo Campos <rodrigo@kinvolk.io>
@rata rata force-pushed the rata_seccomp_listenerpath branch from 8b43023 to 0f84938 Compare March 18, 2021 16:32
@rata rata requested a review from giuseppe March 18, 2021 16:33
@rata
Copy link
Contributor Author

rata commented Mar 18, 2021

@giuseppe Thanks! Pushed another fix to another inconsistency, removing SECCOMP_FILTER_FLAG_NEW_LISTENER from the valid flags. That should have never been added there in the first place 🙈

Copy link
Member

@giuseppe giuseppe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@vbatts
Copy link
Member

vbatts commented Mar 19, 2021

LGTM

Approved with PullApprove

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants