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

[4.4] fix regression with runc --privileged rootless containers #17301

Merged
merged 1 commit into from Feb 1, 2023

Conversation

giuseppe
Copy link
Member

Closes: https://bugzilla.redhat.com/show_bug.cgi?id=2165875

Does this PR introduce a user-facing change?


@openshift-ci
Copy link
Contributor

openshift-ci bot commented Jan 31, 2023

Adding the "do-not-merge/release-note-label-needed" label because no release-note block was detected, please follow our release note process to remove it.

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-ci openshift-ci bot added the do-not-merge/release-note-label-needed Enforce release-note requirement, even if just None label Jan 31, 2023
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Jan 31, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: giuseppe

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:

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

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jan 31, 2023
@mheon
Copy link
Member

mheon commented Jan 31, 2023

LGTM

@edsantiago
Copy link
Collaborator

The PR being reverted is #17127 but there's no explanation of why it's being reverted

@giuseppe
Copy link
Member Author

I am not sure yet whether the issue is in Podman or in runc, I've found it out with git bisect. Since these two commits are quite new, I think it is safer to revert for now and fix it upstream first.

* for backwards compatibility.
*/
if d.Path == "/dev/ptmx" || isVirtualConsoleDevice(d.Path) {
if d.Path == "/dev/ptmx" || strings.HasPrefix(d.Path, "/dev/tty") {
Copy link
Contributor

Choose a reason for hiding this comment

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

The cause could be that isVirtualConsoleDevice evaluates to false for /dev/tty before strings.HasPrefix(d.Path, "/dev/tty") evaluated to true for it.

Copy link
Contributor

Choose a reason for hiding this comment

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

This might also cause an issue in non-privileged mode that has the same change (it's not reverted in this PR).

Copy link
Member Author

Choose a reason for hiding this comment

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

@fho would you mind opening a PR for upstream?

Perhaps I can just cherry-pick the fix if that proves to be obvious

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm hesitant to create a PR, to skip mounting /dev/tty because I don't know how to reason it.
Why must /dev/tty not be mounted and why mounting it would cause an error like: merged/dev/tty: no such device or address?
/dev/tty is not a pseudo terminal. We actually even had a short discussion about it when that change was introduced: #17055 (comment).
https://systemd.io/CONTAINER_INTERFACE/, #15878 and dcermak@5a2405a does not mention that /dev/tty must not be mounted. Am I missing something?

I also tried to reproduce the bug locally with podman e787872 but could not:
bin/podman run --rm -d --privileged quay.io/libpod/testimage:20221018 top works fine. The container starts and keeps running.
I'm using crun 1.7.2 locally, not the runc version from the bug report though.
Is that maybe an incompatibility with runc or a bug in that runc version?

@fho
Copy link
Contributor

fho commented Jan 31, 2023

Reverting 579c5dc should not be needed, if using isVirtualConsoleDevice in the kept for the non-privileged codepath

@giuseppe giuseppe marked this pull request as draft January 31, 2023 18:02
@openshift-ci openshift-ci bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jan 31, 2023
@mupuf
Copy link
Contributor

mupuf commented Jan 31, 2023

@giuseppe: Sorry for introducing the regression...

I sent an alternate PR (#17304) to address this regression, without reverting the fixes @fho and I worked on to address the regression that came in podman 4.3...

Would that be acceptable? I can write more tests tomorrow to make sure regressions like this won't happen again.

Reverting 579c5dc should not be needed, if using isVirtualConsoleDevice in the kept for the non-privileged codepath

Agreed.

[NO NEW TESTS NEEDED]

Closes: https://bugzilla.redhat.com/show_bug.cgi?id=2165875
Signed-off-by: Martin Roukala (né Peres) <martin.roukala@mupuf.org>
(cherry picked from commit d10860a)
@giuseppe giuseppe marked this pull request as ready for review January 31, 2023 21:59
@openshift-ci openshift-ci bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jan 31, 2023
@giuseppe
Copy link
Member Author

giuseppe commented Feb 1, 2023

cherry picked the fix instead of reverting the feature

@mupuf
Copy link
Contributor

mupuf commented Feb 1, 2023

cherry picked the fix instead of reverting the feature

Glad it fixed the issue, and sorry again for the regression!

@giuseppe
Copy link
Member Author

giuseppe commented Feb 1, 2023

cherry picked the fix instead of reverting the feature

Glad it fixed the issue, and sorry again for the regression!

no reason to be sorry! Issues happen all the time, that is why we have release branches :-)

@mupuf
Copy link
Contributor

mupuf commented Feb 1, 2023

Looking forward to integrating podman 4.4 in boot2container :)

@giuseppe
Copy link
Member Author

giuseppe commented Feb 1, 2023

@vrothberg PTAL

@baude
Copy link
Member

baude commented Feb 1, 2023

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Feb 1, 2023
@ashley-cui ashley-cui removed the do-not-merge/release-note-label-needed Enforce release-note requirement, even if just None label Feb 1, 2023
@vrothberg
Copy link
Member

Sorry, this slipped through my mails.

@openshift-merge-robot openshift-merge-robot merged commit cd73289 into containers:v4.4 Feb 1, 2023
@github-actions github-actions bot added the locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. label Sep 12, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 12, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

9 participants