-
Notifications
You must be signed in to change notification settings - Fork 360
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
tetragon: Add support for multi kprobe override #1218
Conversation
a028c22
to
d0f9e19
Compare
d0f9e19
to
804288b
Compare
57ab859
to
26d2862
Compare
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.
Except for some minor comments, overall LGTM, thanks!
In case the override helper is not supported we can get verifier failure when loading kprobe multi object. Adding the code to skip the loading of override program the same way we do for normal kprobes. Fixes: 840b12d ("tetragon: Move override setup into kprobe open/attach functions") Signed-off-by: Jiri Olsa <[email protected]>
We will need to load override program with kprobe.multi interface in following changes. Signed-off-by: Jiri Olsa <[email protected]>
Adding support to load override helper for kprobe.multi attached kprobes. Signed-off-by: Jiri Olsa <[email protected]>
Adding override support for kprobes attached with kprobe.multi interface. Signed-off-by: Jiri Olsa <[email protected]>
Let's use multi object even for single kprobe, the kprobe-multi interface should be faster than generic kprobe attach. Signed-off-by: Jiri Olsa <[email protected]>
Adding verbose out about call being overridden for both single and multi kprobes, like: logcapture.go:25: time="2023-07-25T12:22:44Z" level=info msg="Added multi kprobe" function=__x64_sys_openat override=true return=true logcapture.go:25: time="2023-07-25T12:22:44Z" level=info msg="Added multi kprobe" function=__x64_sys_linkat override=true return=false logcapture.go:25: time="2023-07-25T12:22:44Z" level=info msg="Added multi kprobe" function=__x64_sys_symlinkat override=true return=false logcapture.go:25: time="2023-07-25T12:22:44Z" level=info msg="Added multi kprobe" function=__x64_sys_renameat override=false return=false Signed-off-by: Jiri Olsa <[email protected]>
Add override test for multiple kprobes to verify the kprobe multi interface handles override properly. The test hooks on 4 syscalls and override 3 of them. sys_openat override with -1 sys_linkat override with -2 sys_symlinkat override with -3 sys_renameat no override Signed-off-by: Jiri Olsa <[email protected]>
26d2862
to
0e3cc8b
Compare
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, LGTM!
There is small rant below, as I was trying to understand the code, but nothing obvious to be addressed in this PR.
Adding support to load override helper for kprobe.multi attached
kprobes.