-
Notifications
You must be signed in to change notification settings - Fork 55
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
ocicni: fix checkNetwork() to use the right Result version for uncached results #109
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
openshift-ci
bot
added
dco-signoff: yes
Indicates the PR's author has DCO signed all their commits.
do-not-merge/release-note-label-needed
Indicates that a PR should not merge because it's missing one of the release note labels.
labels
Jun 8, 2022
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: dcbw 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 |
openshift-ci
bot
added
the
approved
Indicates a PR has been approved by an approver from all required OWNERS files.
label
Jun 8, 2022
…ed results The cniVersion of the result must be compatible with the Go struct that implements it. In this case, the incoming config is 0.3.1 but the network has no cached result, so checkNetwork() creates a 1.0.0 Result type but mistakenly sets the result's internal version string to the incoming config version (0.3.1). libcni's internal Convert() function looks up converters based on the internal Result version string, in this case 0.3.1. That ends up calling the 1.0.0's convertFrom04x() which, of course, expects the incoming result object to be a 040 Go Result struct, but because checkNetwork() created a 100 Go Result struct, it clearly isn't, and the type assertion fails and it panics. Fixes: cri-o/cri-o#5889 May 17 11:45:59 node1 crio[26471]: time="2022-05-17 11:45:59.130078469+08:00" level=info msg="Checking CNI network multus-cni-network (config version=0.3.1) nsManager=&{/usr/bin/nsenter}" May 17 11:45:59 node1 crio[26471]: panic: interface conversion: types.Result is *types100.Result, not *types040.Result May 17 11:45:59 node1 crio[26471]: goroutine 1 [running]: May 17 11:45:59 node1 crio[26471]: panic({0x1d69d60, 0xc000480630}) May 17 11:45:59 node1 crio[26471]: /usr/lib/go-1.18/src/runtime/panic.go:941 +0x397 fp=0xc0008f6640 sp=0xc0008f6580 pc=0x441137 May 17 11:45:59 node1 crio[26471]: runtime.panicdottypeE(...) May 17 11:45:59 node1 crio[26471]: /usr/lib/go-1.18/src/runtime/iface.go:262 May 17 11:45:59 node1 crio[26471]: runtime.panicdottypeI(0x0?, 0x1dbf180, 0x1dac900) May 17 11:45:59 node1 crio[26471]: /usr/lib/go-1.18/src/runtime/iface.go:272 +0x7c fp=0xc0008f6668 sp=0xc0008f6640 pc=0x41649c May 17 11:45:59 node1 crio[26471]: github.com/cri-o/cri-o/vendor/github.com/containernetworking/cni/pkg/types/100.convertFrom04x({0x238ab10?, 0xc000445e40?}, {0x200e65a?, 0xc0006683f0?}) May 17 11:45:59 node1 crio[26471]: /usr/src/packages/BUILD/src/github.com/cri-o/cri-o/vendor/github.com/containernetworking/cni/pkg/types/100/types.go:126 +0x9c5 fp=0xc0008f67b8 sp=0xc0008f6668 pc=0xf92745 May 17 11:45:59 node1 crio[26471]: github.com/cri-o/cri-o/vendor/github.com/containernetworking/cni/pkg/types/internal.Convert({0x238ab10, 0xc000445e40}, {0x200e65a, 0x5}) May 17 11:45:59 node1 crio[26471]: /usr/src/packages/BUILD/src/github.com/cri-o/cri-o/vendor/github.com/containernetworking/cni/pkg/types/internal/convert.go:73 +0x1a5 fp=0xc0008f6868 sp=0xc0008f67b8 pc=0xf8b825 May 17 11:45:59 node1 crio[26471]: github.com/cri-o/cri-o/vendor/github.com/containernetworking/cni/pkg/types/100.(*Result).GetAsVersion(0xc000481650?, {0x200e65a?, 0xc0003e4c00?}) May 17 11:45:59 node1 crio[26471]: /usr/src/packages/BUILD/src/github.com/cri-o/cri-o/vendor/github.com/containernetworking/cni/pkg/types/100/types.go:211 +0x65 fp=0xc0008f6898 sp=0xc0008f6868 pc=0xf93385 May 17 11:45:59 node1 crio[26471]: github.com/cri-o/cri-o/vendor/github.com/containernetworking/cni/pkg/types/100.GetResult({0x238ab10?, 0xc000445e40?}) May 17 11:45:59 node1 crio[26471]: /usr/src/packages/BUILD/src/github.com/cri-o/cri-o/vendor/github.com/containernetworking/cni/pkg/types/100/types.go:65 +0x37 fp=0xc0008f68d0 sp=0xc0008f6898 pc=0xf91c37 May 17 11:45:59 node1 crio[26471]: github.com/cri-o/cri-o/server.(*Server).getSandboxIPs(0xc000246e00, 0xc000842000) May 17 11:45:59 node1 crio[26471]: /usr/src/packages/BUILD/src/github.com/cri-o/cri-o/server/sandbox_network.go:146 +0x178 fp=0xc0008f6b00 sp=0xc0008f68d0 pc=0x1b51058 May 17 11:45:59 node1 crio[26471]: github.com/cri-o/cri-o/server.(*Server).restore(0xc000246e00, {0x238a480?, 0xc0003c4840}) May 17 11:45:59 node1 crio[26471]: /usr/src/packages/BUILD/src/github.com/cri-o/cri-o/server/server.go:280 +0xe6d fp=0xc0008f7558 sp=0xc0008f6b00 pc=0x1b64e0d May 17 11:45:59 node1 crio[26471]: github.com/cri-o/cri-o/server.New({0x238a480?, 0xc0003c4840}, {0x23723f8, 0xc0004fa000}) May 17 11:45:59 node1 crio[26471]: /usr/src/packages/BUILD/src/github.com/cri-o/cri-o/server/server.go:442 +0x598 fp=0xc0008f77f8 sp=0xc0008f7558 pc=0x1b66278 Signed-off-by: Dan Williams <[email protected]>
dcbw
force-pushed
the
check-uses-wrong-version
branch
from
June 8, 2022 17:15
0bf947b
to
63e28e3
Compare
dcbw
removed
the
do-not-merge/release-note-label-needed
Indicates that a PR should not merge because it's missing one of the release note labels.
label
Jun 8, 2022
/lgtm |
openshift-ci
bot
added
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.
labels
Jun 8, 2022
Pull Request Test Coverage Report for Build 2463196378
💛 - Coveralls |
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.
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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The cniVersion of the result must be compatible with the Go struct
that implements it. In this case, the incoming config is 0.3.1 but
the network has no cached result, so checkNetwork() creates a
1.0.0 Result type but mistakenly sets the result's internal version
string to the incoming config version (0.3.1).
libcni's internal Convert() function looks up converters based on
the internal Result version string, in this case 0.3.1. That
ends up calling the 1.0.0's convertFrom04x() which, of course,
expects the incoming result object to be a 040 Go Result struct,
but because checkNetwork() created a 100 Go Result struct,
it clearly isn't, and the type assertion fails and it panics.
Fixes: cri-o/cri-o#5889
Signed-off-by: Dan Williams [email protected]