Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Index out of range if version_signature is empty but exist #1086

Closed
2 tasks done
chenliTW opened this issue Jun 16, 2023 · 1 comment · Fixed by #1115
Closed
2 tasks done

Index out of range if version_signature is empty but exist #1086

chenliTW opened this issue Jun 16, 2023 · 1 comment · Fixed by #1115
Labels
kind/bug Something isn't working

Comments

@chenliTW
Copy link
Contributor

chenliTW commented Jun 16, 2023

Is there an existing issue for this?

  • I have searched the existing issues

What happened?

I run k8s in lxc on proxmox, procfs + "/version_signature" exist but empty.
This cause versionStrings with zero length, and a OOB in versionStrings[len(versionStrings)-1].
Pod Failed to start.
It work fine if I add check to length of versionStrings and rebuild myself.

Tetragon Version

tetragon:v0.9.0

Kernel Version

Linux hostname 5.15.107-2-pve #1 SMP PVE 5.15.107-2 (2023-05-10T09:10Z) x86_64 GNU/Linux

Kubernetes Version

v1.26.3

Bugtool

No response

Relevant log output

panic: runtime error: index out of range [-1]

goroutine 1 [running]:
github.com/cilium/tetragon/pkg/kernels.GetKernelVersion({0x0?, 0x18b5c13?}, {0x1f431c2?, 0x2255a08?})
	/go/src/github.com/cilium/tetragon/pkg/kernels/kernels.go:65 +0x1e5
github.com/cilium/tetragon/pkg/kernels.EnableV60Progs()
	/go/src/github.com/cilium/tetragon/pkg/kernels/kernels.go:127 +0x4a
github.com/cilium/tetragon/pkg/sensors/base.ExecObj()
	/go/src/github.com/cilium/tetragon/pkg/sensors/base/base.go:100 +0x17
github.com/cilium/tetragon/pkg/sensors/base.glob..func1()
	/go/src/github.com/cilium/tetragon/pkg/sensors/base/base.go:15 +0x1d
github.com/cilium/tetragon/pkg/sensors/base.init()
	/go/src/github.com/cilium/tetragon/pkg/sensors/base/base.go:21 +0x1d

Anything else?

Should it be fixed and can I fix this ?

Code of Conduct

  • I agree to follow this project's Code of Conduct
@chenliTW chenliTW added the kind/bug Something isn't working label Jun 16, 2023
@mtardy
Copy link
Member

mtardy commented Jun 19, 2023

Hello, thanks for the bug report!

It work fine if I add check to length of versionStrings and rebuild myself.

Would you like to submit your patch? I guess it can be quickly fixed but since you already have something, maybe you want to share it :)

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
kind/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants