You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have only been able to reproduce this on a console. Container images run with --cap-add or k8s pods with proper security context still produce stacktraces. strace shows a giant empty buffer being written to stderr when the problem manifests.
The text was updated successfully, but these errors were encountered:
This is because when a Go programs runs in secure mode, it acts as though GOTRACEBACK=none is set in the environment. That causes a panic to not print a stack trace. This is intended to be a security measure. See #60272.
I understand, and we can leave the issue closed. But what is the difference in vulnerability exposure that allows this behavior in containers? Even those using the host process namespace.
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
I'll provide in line examples, because I am unable to reproduce on go play. Take the following simple program that panics immediately.
Run it with
go run
Run it with a built executable with no changes
Now (on Linux) grant the binary permissions to perform net administration.
$ sudo setcap cap_net_admin=eip ./test $ ./test panic: OH NO!
Stack traces are gone.
What did you expect to see?
A stack trace
What did you see instead?
Nothing.
Other considerations
I have only been able to reproduce this on a console. Container images run with
--cap-add
or k8s pods with proper security context still produce stacktraces.strace
shows a giant empty buffer being written to stderr when the problem manifests.The text was updated successfully, but these errors were encountered: