Skip to content

metrics: Avoid invalid UTF-8 in metric label - #6124

Open
sayboras wants to merge 2 commits into
mainfrom
pr/tammach/invalid-utf8-973
Open

sayboras wants to merge 2 commits into
mainfrom
pr/tammach/invalid-utf8-973

Conversation

@sayboras

Copy link
Copy Markdown
Member

Description

Fixes #973

Changelog

metrics: Avoid invalid UTF-8 in metric label

stringToUTF8() overwrote bytes it had yet to read, so it went out of
bounds on the first invalid byte. Nothing converted the cwd.

Keep the raw bytes for the execve_map and convert the event strings,
as the exec path does.

Signed-off-by: Tam Mach <tam.mach@cilium.io>
The prometheus client panics on a label value that is not valid UTF-8,
and the binary label is a path, which can hold any bytes.

Fixes: #973
Signed-off-by: Tam Mach <tam.mach@cilium.io>
@sayboras sayboras added the release-note/bug This PR fixes an issue in a previous release of Tetragon. label Nov 20, 2026
@sayboras
sayboras marked this pull request as ready for review November 20, 2026 22:47
@sayboras
sayboras requested review from a team and kkourt as code owners November 20, 2026 22:47
@sayboras sayboras added needs-backport/1.6 This PR needs backporting to v1.6 needs-backport/1.7 This PR needs backporting to 1.7 needs-backport/1.8 labels Nov 21, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-backport/1.6 This PR needs backporting to v1.6 needs-backport/1.7 This PR needs backporting to 1.7 needs-backport/1.8 release-note/bug This PR fixes an issue in a previous release of Tetragon.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Invalid UTF-8 in metric label

1 participant