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

don't segfault if invalid data is returned from metadata server #90

Open
flokli opened this issue Feb 5, 2023 · 0 comments
Open

don't segfault if invalid data is returned from metadata server #90

flokli opened this issue Feb 5, 2023 · 0 comments

Comments

@flokli
Copy link

flokli commented Feb 5, 2023

NixOS packages the google-oslogin in nixpkgs. Because our setup is a bit more complicated (as we have to use ns(n)cd), we ship an (isolated) integration test, spinning up a mock metadata server.

We didn't implement the /computeMetadata/v1/oslogin/groups endpoint in there (probably because it didn't exist at the time), and observed a bunch of segfaults in the code that loads the oslogin NSS module (in our case, in the ns(n)cd daemon, without that in all client applications). Adding that endpoint in our mock implementation made the segfaults go away.

While "the real" metadata server(s) in GCP might not return 404 on that endpoint, segfautling seems to be a sign of insufficient error handling.

Can you make sure these paths are properly handled without segfautling? Other paths in the code return a NSS_STATUS_NOTFOUND, maybe that or another bad status code could be used.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant