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

encoder: add compact fuzz tests and fix bugs related to unhandled event types #2819

Merged
merged 6 commits into from
Aug 16, 2024

Conversation

willfindlay
Copy link
Contributor

Description

We've been burned recently by unhandled event types in the compact encoder's code path. Introduce a new fuzz test for the compact encoder to ensure that we don't miss any in the future. A subsequent PR will introduce a new CI job that fuzzes for a little bit on every PR to try and catch any new cases that come up. For now, we use a static corpus.

The first fuzzing run found two unhandled event types:

  • TEST events (which really probably don't need to be handled, but for completion let's just add a simple handler)
  • uprobe events

Add an implementation for both of the above in the compact encoder.

Changelog

Fix missing cases in the compact encoder for tetra.

This is needed to debug cases where the encoder fails to encode an unhandled event.

Signed-off-by: William Findlay <[email protected]>
We have envountered issues with unhandled types slipping through the cracks in the compact
encoder. Let's add a fuzz test that should help catch these cases in the future.

Signed-off-by: William Findlay <[email protected]>
@willfindlay willfindlay requested a review from a team as a code owner August 16, 2024 15:27
Copy link

netlify bot commented Aug 16, 2024

Deploy Preview for tetragon ready!

Name Link
🔨 Latest commit b8701cc
🔍 Latest deploy log https://app.netlify.com/sites/tetragon/deploys/66bf6fdf7f12df00084210fb
😎 Deploy Preview https://deploy-preview-2819--tetragon.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@willfindlay willfindlay changed the title Pr/willfindlay/fuzz encoder encoder: add compact fuzz tests and fix bugs related to unhandled event types Aug 16, 2024
@willfindlay willfindlay added the release-note/bug This PR fixes an issue in a previous release of Tetragon. label Aug 16, 2024
Copy link
Member

@mtardy mtardy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh wow that's nice, are we sure we want to check in the corpus in the main repo though?

@willfindlay
Copy link
Contributor Author

are we sure we want to check in the corpus in the main repo though

Do you have an alternative suggestion? I'd like to have these cases exercised in CI even under the normal go test command (without -fuzz).

Copy link
Contributor

@jrfastab jrfastab left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please for future at least put something in the commit msg body. Generally title without any details is slightly frowned on. Otherwise nice!

@jrfastab jrfastab merged commit 4b689be into main Aug 16, 2024
44 of 46 checks passed
@jrfastab jrfastab deleted the pr/willfindlay/fuzz-encoder branch August 16, 2024 21:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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.

3 participants