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
Machine ID: Handle Kernel Version check failing more gracefully #34780
Machine ID: Handle Kernel Version check failing more gracefully #34780
Conversation
minKernel := semver.New(Openat2MinKernel) | ||
version, err := utils.KernelVersion() | ||
if err != nil { | ||
return false, trace.Wrap(err) | ||
log.WithError(err).Info("Failed to determine kernel version. It will be assumed secure write support is not available.") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we only ever call this once? It's gonna be annoying if we end up accidentally calling this in a loop.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yup - this is only called on initialisation at the mo.
@strideynet See the table below for backport results.
|
Previously, if this check failed,
tbot
would crash out, e.g:This occurred in a restricted container environment where much of
/proc/sys
is not available (Spacelift).It makes more sense to gracefully degrade to not using kernel features we expect from newer versions.
Closes #34390
changelog: fix
tbot
crashing when used in environments where the kernel version cannot be queried.