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

libpod: addHosts() prevent nil deref #24578

Merged
merged 1 commit into from
Nov 18, 2024

Conversation

Luap99
Copy link
Member

@Luap99 Luap99 commented Nov 15, 2024

In theory RootlessNetnsInfo() should never return nil here. However that was actually only true when the rootless netns was set up before and wrote the right cache file with the ip addresses.

Given this cache file is a new feature just added in 5.3 if you updated from 5.2 or earlier the file will not exists thus cause failures for all following started containers.
The fix for this is to stop all containers and make sure the rootless-netns was removed so the next start creates it new with the proper 5.3 cache file. However as there is no way to rely on users doing that and it is also not requirement so simply handle the nil deref here.

The only way to test this would be to run the old version then the new version which we cannot really do in CI. We do have upgrade test for that but they are root only and likely need a lot more work to get them going rootless but certainly worth to explore to prevent such problems in the future.

Fixes: a1e6603 ("libpod: make use of new pasta option from c/common")
Fixes: #24566

Does this PR introduce a user-facing change?

Fixed a bug in 5.3.0 that caused rootless containers using the bridge networking mode to cause a nil pointer dereference and thus fail to start.

In theory RootlessNetnsInfo() should never return nil here. However that
was actually only true when the rootless netns was set up before and
wrote the right cache file with the ip addresses.

Given this cache file is a new feature just added in 5.3 if you updated
from 5.2 or earlier the file will not exists thus cause failures for all
following started containers.
The fix for this is to stop all containers and make sure the
rootless-netns was removed so the next start creates it new with the
proper 5.3 cache file. However as there is no way to rely on users doing
that and it is also not requirement so simply handle the nil deref here.

The only way to test this would be to run the old version then the new
version which we cannot really do in CI. We do have upgrade test for
that but they are root only and likely need a lot more work to get them
going rootless but certainly worth to explore to prevent such problems
in the future.

Fixes: a1e6603 ("libpod: make use of new pasta option from c/common")
Fixes: containers#24566

Signed-off-by: Paul Holzinger <[email protected]>
@openshift-ci openshift-ci bot added release-note approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Nov 15, 2024
@Luap99 Luap99 added No New Tests Allow PR to proceed without adding regression tests 5.3 labels Nov 15, 2024
@mheon
Copy link
Member

mheon commented Nov 15, 2024

/cherry-pick v5.3

@openshift-cherrypick-robot
Copy link
Collaborator

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

In response to this:

/cherry-pick v5.3

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.

@mheon
Copy link
Member

mheon commented Nov 15, 2024

LGTM

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

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Nov 18, 2024
Copy link
Contributor

openshift-ci bot commented Nov 18, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: giuseppe, Luap99

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-merge-bot openshift-merge-bot bot merged commit e195177 into containers:main Nov 18, 2024
77 of 78 checks passed
@openshift-cherrypick-robot
Copy link
Collaborator

@mheon: new pull request created: #24594

In response to this:

/cherry-pick v5.3

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
5.3 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. No New Tests Allow PR to proceed without adding regression tests release-note
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Temporary failure in name resolution for service name when using docker compose with podman
4 participants