-
Notifications
You must be signed in to change notification settings - Fork 382
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
v1.0 backport: bpf: fix bugs in the prepend_name function #1956
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mtardy
added
area/bpf
This is related to BPF code
release-note/bug
This PR fixes an issue in a previous release of Tetragon.
labels
Jan 10, 2024
mtardy
changed the title
bpf: fix bugs in the prepend_name function
v1.0 backport: bpf: fix bugs in the prepend_name function
Jan 10, 2024
mtardy
added
the
kind/backport
This PR provides functionality previously merged into master.
label
Jan 10, 2024
[ upstream commit ea914b6 ] In order to make BPF_PROG_RUN work with BPF_PROG_TYPE_RAW_TRACEPOINT in cilium/ebpf. Signed-off-by: Mahe Tardy <[email protected]>
[ upstream commit 0e242c4 ] It looked like this particular function presented some bugs: - It would not return -ENAMETOOLONG when the buffer was filled "best-effort" because the name was not fitting. - It would never fill the first byte of the buffer, thus reducing the maximum size written by one. - It would not fill "best-effort" correctly. E.g, previously in a buffer of 4, "pizza" would have been "/piz" (when ignoring previous bug) instead of "izza". Now it tries to write the "end" of the name without a wrong "/" char. - It would behave unexpectedly when filled with more data than size of buffer. BPF unit tests were put under bpf/tests, as more can be added there in the future. The Makefile was updated so that we can share variable definition between the bpf/Makefile and the bpf/tests/Makefile file. This separation allows us not compile the test program along the rest of the BPF progs, and not ship them in the released images/archives. Signed-off-by: Mahe Tardy <[email protected]>
[ upstream commit c8bcf64 ] BPF units tests are not backported to v1.0 but this still ports the bug fix in the prepend_name function as this can affect users via events. Signed-off-by: Mahe Tardy <[email protected]>
[ upstream commit f08c16f ] Signed-off-by: Mahe Tardy <[email protected]>
mtardy
force-pushed
the
pr/mtardy/backport/prepend-name-fix
branch
from
January 12, 2024 12:30
64c6a35
to
e8ee5c9
Compare
Complete backport ready with tests as well @kkourt |
kkourt
approved these changes
Jan 15, 2024
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.
Thanks!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
area/bpf
This is related to BPF code
kind/backport
This PR provides functionality previously merged into master.
release-note/bug
This PR fixes an issue in a previous release of Tetragon.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Backport of the bugfix and tests of #1902.