+
Skip to content

server: filter sysctls passed through CRI if host namespace #5610

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

Merged
merged 2 commits into from
Feb 9, 2022

Conversation

haircommander
Copy link
Member

What type of PR is this?

/kind bug

What this PR does / why we need it:

fixes GHSA-w2j5-3rcx-vx7x

Which issue(s) this PR fixes:

Special notes for your reviewer:

Does this PR introduce a user-facing change?

Fix a bug where a pod given a host IPC or network namespace could configure sysctls on the host

Signed-off-by: Peter Hunt <pehunt@redhat.com>
Signed-off-by: Peter Hunt <pehunt@redhat.com>
@openshift-ci openshift-ci bot added dco-signoff: yes Indicates the PR's author has DCO signed all their commits. release-note Denotes a PR that will be considered when it comes time to generate release notes. kind/bug Categorizes issue or PR as related to a bug. labels Feb 8, 2022
@openshift-ci openshift-ci bot requested a review from giuseppe February 8, 2022 16:59
@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Feb 8, 2022
@haircommander
Copy link
Member Author

running CI here to make sure nothing unexpected fails

@codecov
Copy link

codecov bot commented Feb 8, 2022

Codecov Report

Merging #5610 (82b8cef) into main (d0df46c) will decrease coverage by 0.02%.
The diff coverage is 0.00%.

❗ Current head 82b8cef differs from pull request most recent head 7287318. Consider uploading reports for the commit 7287318 to get more accurate results

@@            Coverage Diff             @@
##             main    #5610      +/-   ##
==========================================
- Coverage   43.24%   43.22%   -0.03%     
==========================================
  Files         123      123              
  Lines       12220    12224       +4     
==========================================
- Hits         5285     5284       -1     
- Misses       6427     6432       +5     
  Partials      508      508              

@haircommander
Copy link
Member Author

/test integration_rhel

@haircommander
Copy link
Member Author

/retest-required

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

although I am not sure about the security implications. For using a host namespace, the container is already privileged. AFAIK, runc has already the same check and it was added to the last release of crun as well.

Copy link
Contributor

@fgiudici fgiudici left a comment

Choose a reason for hiding this comment

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

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Feb 9, 2022
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Feb 9, 2022

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: fgiudici, giuseppe, haircommander

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:
  • OWNERS [giuseppe,haircommander]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-bot
Copy link

/retest-required

Please review the full test history for this PR and help us cut down flakes.

1 similar comment
@openshift-bot
Copy link

/retest-required

Please review the full test history for this PR and help us cut down flakes.

@haircommander
Copy link
Member Author

although I am not sure about the security implications. For using a host namespace, the container is already privileged. AFAIK, runc has already the same check and it was added to the last release of crun as well.

yeah I waiver between this being moderate and low severity. most kubernetes clusters don't do anything to prevent users from using host namespaces (until updated PSP, which is fairly new), which makes it more nefarious for upstream consumers (OCP has SCC, which mitigates this). However, the underlying principle is that a container affects the host in a way that wasn't really intended, which does feel like a container breakout

@haircommander
Copy link
Member Author

/cherry-pick release-1.23

@openshift-cherrypick-robot

@haircommander: once the present PR merges, I will cherry-pick it on top of release-1.23 in a new PR and assign it to you.

In response to this:

/cherry-pick release-1.23

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.

@openshift-bot
Copy link

/retest-required

Please review the full test history for this PR and help us cut down flakes.

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Feb 9, 2022

@haircommander: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/openshift-jenkins/e2e_crun_cgroupv2 7287318 link false /test e2e_cgroupv2

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.

@haircommander
Copy link
Member Author

/override ci/prow/e2e-agnostic

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Feb 9, 2022

@haircommander: Overrode contexts on behalf of haircommander: ci/prow/e2e-agnostic

In response to this:

/override ci/prow/e2e-agnostic

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.

@haircommander
Copy link
Member Author

/override ci/openshift-jenkins/integration_rhel

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Feb 9, 2022

@haircommander: Overrode contexts on behalf of haircommander: ci/openshift-jenkins/integration_rhel

In response to this:

/override ci/openshift-jenkins/integration_rhel

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.

@openshift-merge-robot openshift-merge-robot merged commit 9ad033b into cri-o:main Feb 9, 2022
@openshift-cherrypick-robot

@haircommander: new pull request created: #5615

In response to this:

/cherry-pick release-1.23

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.

@haircommander
Copy link
Member Author

/cherry-pick release-1.22

@openshift-cherrypick-robot

@haircommander: new pull request created: #5616

In response to this:

/cherry-pick release-1.22

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.

@haircommander
Copy link
Member Author

/cherry-pick release-1.21

@openshift-cherrypick-robot

@haircommander: #5610 failed to apply on top of branch "release-1.21":

Applying: server: skip sysctls that would affect the host
Using index info to reconstruct a base tree...
M	server/sandbox_run_linux.go
Falling back to patching base and 3-way merge...
Auto-merging server/sandbox_run_linux.go
CONFLICT (content): Merge conflict in server/sandbox_run_linux.go
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
Patch failed at 0001 server: skip sysctls that would affect the host
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".

In response to this:

/cherry-pick release-1.21

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. dco-signoff: yes Indicates the PR's author has DCO signed all their commits. kind/bug Categorizes issue or PR as related to a bug. lgtm Indicates that a PR is ready to be merged. release-note Denotes a PR that will be considered when it comes time to generate release notes.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants
点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载