Skip to content

[do-not-merge] Test s390x eBPF changes on x86 #950

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 10 commits into from

Conversation

Molter73
Copy link
Collaborator

Description

DO NOT MERGE!! This is a local copy of #949, meant to allow GHA to run with the appropriate credentials.

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 Dec 21, 2022

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

@Molter73 Molter73 force-pushed the mauro/s390x-collector-2022-12-20 branch from f617f60 to 16dc4c3 Compare December 21, 2022 12:07
@Molter73 Molter73 force-pushed the mauro/s390x-collector-2022-12-20 branch 2 times, most recently from 05a815d to 119ede3 Compare January 13, 2023 10:12
@Molter73 Molter73 force-pushed the mauro/s390x-collector-2022-12-20 branch 2 times, most recently from 928afd3 to 71a13d9 Compare January 26, 2023 09:24
hbrueckner and others added 10 commits February 6, 2023 12:17
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/s390x-collector-2022-12-20 branch from 531ef45 to daf5fb6 Compare February 6, 2023 11:18
@Molter73 Molter73 closed this Jul 3, 2023
@Molter73 Molter73 deleted the mauro/s390x-collector-2022-12-20 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.

2 participants