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

bpf: fix verification error in bpf_execve_event #1454

Merged
merged 1 commit into from
Sep 12, 2023
Merged

Conversation

kkourt
Copy link
Contributor

@kkourt kkourt commented Sep 12, 2023

This patch fixes a verification error in a 4.18.0-477.21.1.el8_8.x86_64 kernel.

The error was reported in issue #1442.

The patch simplifies the code: it eliminates a common expression, and it changes some values from int to long to avoid generated code for the implicit casting.

It also fixes a issue. bpf_probe_read_str may return 0, and in this case the old code will underflow. And even though we mask the size, the size value would have been wrong in this case:
(gdb) printf "0x%zx\n", (0-1) & 0x7fff
0x7fff

@kkourt kkourt requested a review from a team as a code owner September 12, 2023 09:36
@mtardy mtardy linked an issue Sep 12, 2023 that may be closed by this pull request
@kkourt kkourt added release-note/bug This PR fixes an issue in a previous release of Tetragon. needs-backport/0.11 labels Sep 12, 2023
This patch fixes a verification error in a 4.18.0-477.21.1.el8_8.x86_64
kernel.

The error was reported in issue 1442.

The patch simplifies the code: it eliminates a common expression, and it
changes some values from int to long to avoid generated code for the
implicit casting.

It also fixes a issue. bpf_probe_read_str may return 0, and in this case
the old code will underflow. And even though we mask the size, the size
value would have been wrong in this case:
(gdb) printf "0x%zx\n", (0-1) & 0x7fff
0x7fff

Signed-off-by: Kornilios Kourtis <kornilios@isovalent.com>
@kkourt kkourt merged commit a7205fc into main Sep 12, 2023
@kkourt kkourt deleted the data-event-fix branch September 12, 2023 15:42
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.

Tetragon v0.11.0 eBPF verifier fail on Rocky Linux 8.6 kernel 4.18
4 participants