Skip to content

[do-not-merge] Test latest changes to custom probe #1073

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

Closed
wants to merge 21 commits into from

Conversation

Molter73
Copy link
Collaborator

Description

This PR is a mirror of #1072 meant for testing only. It will not be merged and reviews should be redirected to the previously mentioned PR.

Checklist

  • Investigated and inspected CI test results
  • Updated documentation accordingly

Automated testing

  • Added unit tests
  • Added integration tests
  • Added regression tests

If any of these don't apply, please comment below.

Testing Performed

TODO(replace-me)
Use this space to explain how you tested your PR, or, if you didn't test it, why you did not do so. (Valid reasons include "CI is sufficient" or "No testable changes")
In addition to reviewing your code, reviewers must also review your testing instructions, and make sure they are sufficient.

For more details, ref the Confluence page about this section.

@openshift-ci
Copy link

openshift-ci bot commented Mar 29, 2023

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@github-actions
Copy link

github-actions bot commented Mar 29, 2023

Kernel Method Without Collector Time (secs) With Collector Time (secs) Baseline median (secs) Collector median (secs) PValue
rhel.rhel-8 ebpf 249.81 259.026 204.92 213.7 🟢
rhel.rhel-8 module 235.127 412.543 187.91 285.98 🟢
ubuntu-os.ubuntu-1804-lts ebpf 244.959 229.209 206.11 213.49 🟢
ubuntu-os.ubuntu-1804-lts module 242.783 421.153 199.27 291.54 🟢
ubuntu-os.ubuntu-2004-lts ebpf 261.364 273.94 236.1 234.97 🟢
ubuntu-os.ubuntu-2004-lts module 252.646 426.553 232.85 321.36 🟢
ubuntu-os.ubuntu-2204-lts ebpf 259.812 259.471 222.56 229.05 🟢
ubuntu-os.ubuntu-2204-lts module 277.572 458.174 213.37 287.88 🟢

hbrueckner and others added 20 commits April 19, 2023 10:05
Install the sched/ tracepoints only if the respective capture
symbolic constant is defined.  Also w/o BPF_SUPPORTS_RAW_TRACEPOINTS,
the `schred_process_fork` tracepoint cannot be used and, hence,
disable it.

Signed-off-by: Hendrik Brueckner <[email protected]>
The Falco libs BPF driver is designed to catch all syscalls through
the sys_enter and sys_exit tracepoints.  The collector custom
probe attaches to particular system calls only.  In that case,
the tracepoint context depends on the syscall with a syscall-specific
format (structure).

This commit converts the syscall-specific format into the format
sys enter format expected by Falco's BPF driver and filler programs.
Previously, the custom probe copied data from beyond the tracepoint
context. This resulted in offset check failure and a permission denied
when attaching BPF probe (see also notes in the custom probe).

This is the sys enter path.  For the sys exit path, the syscall-specific
exit format (which is identical for direct attached syscalls) needs
to be aligned (wrt. to offsets) with the 'catch-all' sys exit format.

Signed-off-by: Hendrik Brueckner <[email protected]>
Introduce a symbolic constant to determine if custom collector
probe or the legacy collector probe (RHEL-7 / "catch-all") is
used.

Note that this is also required to align the syscall tracepoint
formats on the exit event of direct vs. generic syscall exit.

Signed-off-by: Hendrik Brueckner <[email protected]>
For s390x, glibc, Golang use the "socketcall" syscall to multiplex
socket calls (e.g. connect, accept, ...).  This commit provides
the necessary entry/exit path to handle socketcalls.

Respective socketcall handling is also required in the Falco BPF
driver.  For the collector custom probe, additional changes are
required because BPF_SUPPORTS_RAW_TRACEPOINTS is not used.  Also
the socketcall implementation filters socket calls according to
the defined collector syscalls (on enter and exit syscall path).
For the syscall enter, also do pre-filtering in the custom probe
because of direct access to the socketcall arguments.

Signed-off-by: Hendrik Brueckner <[email protected]>
Co-authored-by: Giles Hutton <[email protected]>
Signed-off-by: Hendrik Brueckner <[email protected]>
Suggested-by: Hendrik Brueckner <[email protected]>
Signed-off-by: Mauro Ezequiel Moltrasio <[email protected]>
Co-authored-by: Hendrik Brueckner <[email protected]>
Signed-off-by: Mauro Ezequiel Moltrasio <[email protected]>
@Molter73 Molter73 force-pushed the mauro/kcrane-collector-rebase branch from 3f6ffeb to 72e7eaa Compare April 19, 2023 08:05
@Molter73 Molter73 closed this Jun 23, 2023
@Molter73 Molter73 deleted the mauro/kcrane-collector-rebase branch August 9, 2023 13:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants