-
Notifications
You must be signed in to change notification settings - Fork 165
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
new(modern_bpf): add support for open
family syscalls
#503
Conversation
evt_test->assert_numeric_param(2, (int64_t)PPM_AT_FDCWD); | ||
|
||
/* Parameter 3: name (type: PT_FSPATH) */ | ||
evt_test->assert_charbuf_param(3, pathname); | ||
|
||
/* Parameter 4: flags (type: PT_FLAGS32) */ | ||
evt_test->assert_numeric_param(4, (uint32_t)PPM_O_RDWR | PPM_O_TMPFILE | PPM_O_DIRECTORY); | ||
|
||
/* Parameter 5: mode (type: PT_UINT32) */ | ||
evt_test->assert_numeric_param(5, (uint32_t)how.mode); | ||
|
||
/* Parameter 6: resolve (type: PT_FLAGS32) */ | ||
evt_test->assert_numeric_param(6, (uint32_t)PPM_RESOLVE_BENEATH | PPM_RESOLVE_NO_MAGICLINKS); |
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.
Still asking myself if it makes sense to assert these parameters also in the failure case... On one side we ensure that also in case of failure we have all the correct parameters, but right now the bpf code is shared apart from the return value which is obviously different in case of failure. It is quite redundant but it could be useful if we change something on the bpf side 🤔 WDYT? (Same for other syscalls where we have more than one test)
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.
I think it is a great thing to test also failure cases, therefore big 👍 from me (even if it will increase verbosity...)
|
||
/*=============================== ASSERT PARAMETERS ===========================*/ | ||
|
||
evt_test->assert_num_params_pushed(6); |
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.
Also here, this could be checked just in one test, it is not necessary to have it in all tests for this event... WDYT?
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.
If the tests can be self-sufficient, all the better IMHO.
test/modern_bpf/test_suites/syscall_exit_suite/open_by_handle_at_x.cpp
Outdated
Show resolved
Hide resolved
5576734
to
c4f28b8
Compare
@hbrueckner: changing LGTM is restricted to collaborators In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
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.
Nice 👍 Some minor nits only
|
||
/*=============================== ASSERT PARAMETERS ===========================*/ | ||
|
||
evt_test->assert_num_params_pushed(6); |
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.
If the tests can be self-sufficient, all the better IMHO.
@FedeDP @hbrueckner sorry if bother you again but maybe I found a solution for the mount points, I took inspiration from the original kernel function obviously we cannot reproduce it in the same way :( Let me know if it looks good for you! I've tested it on |
Hi @Andreagit97
Here are my test results on s390x:
Running directly in /tmp worked fine. Running it locally it failed as well as in this scenario:
Some good news are that I could isolate this issue by creating an additional test that creates a temporary mount point in /tmp:
See update(modern_bpf): add open_by_handle_at mount point test and feel free to try it out or cherry-pick. |
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.
This is fantastic Andrea!
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.
/approve
LGTM label has been added. Git tree hash: 6f8f0331e57bb342b41e3eaa70b8f13a75b6fc7a
|
3afc138
to
906b52a
Compare
Signed-off-by: Andrea Terzolo <andrea.terzolo@polito.it>
Signed-off-by: Andrea Terzolo <andrea.terzolo@polito.it>
Signed-off-by: Andrea Terzolo <andrea.terzolo@polito.it>
…ponent Signed-off-by: Andrea Terzolo <andrea.terzolo@polito.it>
Signed-off-by: Andrea Terzolo <andrea.terzolo@polito.it>
Signed-off-by: Andrea Terzolo <andrea.terzolo@polito.it> Co-authored-by: Hendrik Brueckner <brueckner@de.ibm.com>
Signed-off-by: Andrea Terzolo <andrea.terzolo@polito.it> Co-authored-by: Hendrik Brueckner <brueckner@de.ibm.com>
Signed-off-by: Andrea Terzolo <andrea.terzolo@polito.it>
Signed-off-by: Andrea Terzolo <andrea.terzolo@polito.it>
Signed-off-by: Andrea Terzolo <andrea.terzolo@polito.it> Co-authored-by: Grzegorz Nosek <grzegorz.nosek@sysdig.com>
Signed-off-by: Hendrik Brueckner <brueckner@de.ibm.com>
`__NR_open` is not defined in ARM64, replace it with `__NR_openat` Signed-off-by: Andrea Terzolo <andrea.terzolo@polito.it> Co-authored-by: Hendrik Brueckner <brueckner@de.ibm.com>
Agree! |
Hi @Andreagit97 ,
Make sense.
Thanks a lot!
That's true.. I have (not yet tested) version of the "workaround commit" excluding s390x: f30d50ed703
Agreed! And I think it is best to track it separately not holding back your pending other PRs. Thanks a lot! |
I'll admit I don't understand why we need different code for s390x, so I just defer to the smarter people in the room ;) |
use a final version of the `auxmap__store_path_from_fd` that correctly works on all supported architectures Signed-off-by: Andrea Terzolo <andrea.terzolo@polito.it> Co-authored-by: Hendrik Brueckner <brueckner@de.ibm.com> Co-authored-by: Federico Di Pierro <nierro92@gmail.com>
bee4e7b
to
4296c71
Compare
I left all the commits just to keep the history of our choices and I've done what we agreed! Now we should be ready 🚀 Don't worry @gnosek i will open another PR/issue to explain better what is going on here and how we could solve it :) |
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.
/approve
LGTM label has been added. Git tree hash: 076dc95a6e41f9639ddb387283eebaa02afbdcef
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: Andreagit97, FedeDP, hbrueckner The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Here is a relevant thread where people discuss the first attempt to upstream a Apparently |
Hi @Andreagit97 , @FedeDP
Quick update on the some progress for self-hosted runner support on |
This is crazy! Thank you very much for your effort :) |
Thank you very much, guys!! |
What type of PR is this?
/kind feature
Any specific area of the project related to this PR?
/area driver-modern-bpf
/area libpman
/area tests
Does this PR require a change in the driver versions?
What this PR does / why we need it:
This PR is part of a series #513, the final aim is to support the most important syscalls also in the new probe. This PR introduces:
open
openat
openat2
open_by_handle_at
Which issue(s) this PR fixes:
Special notes for your reviewer:
Does this PR introduce a user-facing change?: