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

[release-1.16] chroot: fix handling of errno seccomp rules #2653

Merged
merged 1 commit into from
Sep 26, 2020

Conversation

nalind
Copy link
Member

@nalind nalind commented Sep 25, 2020

What type of PR is this?

/kind bug

What this PR does / why we need it:

When converting seccomp rules from the runtime spec to the structure that we can feed to libseccomp, combine the prescribed errno value with the action when we're mapping the "return an errno" action from one to the other.

How to verify it

Currently, chroot isolation hits an error processing this seccomp rule:

                {
                        "names": [
                                "socket"
                        ],
                        "action": "SCMP_ACT_ERRNO",
                        "args": [
                                {
                                        "index": 0,
                                        "value": 16,
                                        "valueTwo": 0,
                                        "op": "SCMP_CMP_EQ"
                                },
                                {
                                        "index": 2,
                                        "value": 9,
                                        "valueTwo": 0,
                                        "op": "SCMP_CMP_EQ"
                                }
                        ],
                        "comment": "",
                        "includes": {},
                        "excludes": {
                                "caps": [
                                        "CAP_AUDIT_WRITE"
                                ]
                        },
                        "errnoRet": 22
                },

on Fedora 33.

Which issue(s) this PR fixes:

None

Special notes for your reviewer:

Cherry picked from #2644.

Does this PR introduce a user-facing change?

None

When converting seccomp rules from the runtime spec to the structure
that we can feed to libseccomp, combine the prescribed errno value with
the action when we're mapping the "return an errno" action from one to
the other.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
@nalind nalind added the todo-backport-to-1.16 We should do or consider a backport to 1.16. Remove when we either decide not to, or open a PR. label Sep 25, 2020
@rhatdan
Copy link
Member

rhatdan commented Sep 25, 2020

LGTM
bors r+

@rhatdan rhatdan merged commit d568b34 into containers:release-1.16 Sep 26, 2020
@nalind nalind deleted the seccomp-errno-1.16 branch September 28, 2020 13:42
@nalind nalind removed the todo-backport-to-1.16 We should do or consider a backport to 1.16. Remove when we either decide not to, or open a PR. label Nov 9, 2020
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 27, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants