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

possibility of nil deref in handleReadyMembers #467

Closed
joel-bluedata opened this issue Apr 30, 2021 · 0 comments
Closed

possibility of nil deref in handleReadyMembers #467

joel-bluedata opened this issue Apr 30, 2021 · 0 comments
Assignees
Labels
Priority: High Project: Cluster Reconcile beyond simple xlate of model to K8s spec Type: Bug

Comments

@joel-bluedata
Copy link
Member

In the member state detail, LastConnectionVersion (a new thing introduced in recent KD versions) is declared as a pointer-to-int, so if it is not present in the doc then it will be nil in the code.

This field is entirely handled within members.go.

It's first set in handleCreatingMembers.

Later, it's dereferenced in handleReadyMembers -- either directly, or by calling getConnectionVersion (which calls getDefaultConnectionVersion). This dereference is not protected against a possibility of a nil value.

Since creating status comes before ready status, that's not a problem in the normal way of things. However I'm concerned about what will happen if KD is updated to the latest operator version while previously-created kdclusters exist. kdclusters created under old versions of KD will not have this field in their member state yet, and so it looks like we would get a nil deref whenever we first try to do handleReadyMembers on such a kdcluster.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Priority: High Project: Cluster Reconcile beyond simple xlate of model to K8s spec Type: Bug
Projects
None yet
Development

No branches or pull requests

3 participants