-
Notifications
You must be signed in to change notification settings - Fork 168
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(driver): update exit events PPME_SYSCALL_READ_X
and PPME_SYSCALL_PREAD_X
with enter params
#2176
Conversation
Signed-off-by: Andrea Terzolo <[email protected]>
Signed-off-by: Andrea Terzolo <[email protected]>
Signed-off-by: Andrea Terzolo <[email protected]>
We cannot rely anymore on the event number to search an event since we could filter some enter events in the middle Signed-off-by: Andrea Terzolo <[email protected]>
Signed-off-by: Andrea Terzolo <[email protected]>
Signed-off-by: Andrea Terzolo <[email protected]>
Signed-off-by: Andrea Terzolo <[email protected]>
~400 lines are tests |
@@ -1 +1 @@ | |||
2.23.0 | |||
3.0.0 |
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.
As discussed here #2068 (comment) we need a major bump in the SCHEMA VERSION because we are adding a new filler for pread64
. This should be an isolated case
Perf diff from master - unit tests
Heap diff from master - unit tests
Heap diff from master - scap file
Benchmarks diff from master
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #2176 +/- ##
==========================================
+ Coverage 75.07% 75.29% +0.22%
==========================================
Files 256 259 +3
Lines 33690 33836 +146
Branches 5768 5769 +1
==========================================
+ Hits 25293 25478 +185
+ Misses 8397 8358 -39
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Signed-off-by: Andrea Terzolo <[email protected]>
Signed-off-by: Andrea Terzolo <[email protected]>
6080c16
to
3c1bba3
Compare
8543b8f
to
c85f219
Compare
Signed-off-by: Andrea Terzolo <[email protected]>
1fbbe87
to
74eba84
Compare
// This writes len + the param | ||
static void push_default_parameter(scap_evt *evt, uint16_t *params_offset, uint8_t param_num) { | ||
// Please ensure that `new_evt->type` is already the final type you want to obtain. | ||
// Otherwise we will access the wrong entry in the event table. | ||
const struct ppm_event_info *event_info = &(g_event_info[evt->type]); | ||
uint16_t len = scap_get_size_bytes_from_type(event_info->params[param_num].type); | ||
uint16_t len = get_size_bytes_from_type(event_info->params[param_num].type); | ||
uint16_t lens_offset = sizeof(scap_evt) + param_num * sizeof(uint16_t); |
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.
Shouldn't we manage EF_LARGE_PAYLOAD
here? (scap_event_has_large_payload(evt)
)
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.
Yes, but I would add it only if we really need a conversion for at least one EF_LARGE_PAYLOAD
event in order to not increase complexity without reason. Maybe I can add an exception so that at the time we will need a conversion for an EF_LARGE_PAYLOAD
event we will face a clear exception
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.
It should not be that hard to implement (2-3 locs?) but i am fine with throwing an exception too. Whatever you feel more comfortable with; no syscall-based plugin will ever need a large payload i guess, but i'd like to at least get notified if we ever fall in that issue.
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.
yep I added the error, the point is that looking at our table today we don't have EF_LARGE_PAYLOAD
events to convert and I'm not sure we will ever have them in future
Signed-off-by: Andrea Terzolo <[email protected]>
/hold we need to complete the gvisor changes |
/unhold after looking a little bit into it the current gvisor changes are enough. The exit event always contains the same parameters of the enter one + the return value. See this method https://github.com/google/gvisor/blob/b78f2ee7c4c393990a84298dd0f200e927b18dab/pkg/sentry/kernel/task_syscall.go#L84 |
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 for checking the gvisor change!
LGTM label has been added. Git tree hash: cf498b2293b1b8b24bf80f42980c0e032deadc79
|
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
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: Andreagit97, FedeDP 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 |
What type of PR is this?
/kind feature
Any specific area of the project related to this PR?
/area driver-kmod
/area driver-bpf
/area driver-modern-bpf
/area libscap-engine-gvisor
/area libscap
/area libsinsp
/area tests
Does this PR require a change in the driver versions?
/version driver-SCHEMA-version-major
What this PR does / why we need it:
This PR is part of #2068. We update the first 2 exit events
PPME_SYSCALL_READ_X
andPPME_SYSCALL_PREAD_X
with enter params. This is still a big PR because it enables the conversion in the scap-file engine and adds tests for scap-files at sinsp level. All the following PRs should only contain the code related to the event conversion no more scaffolding.Which issue(s) this PR fixes:
Special notes for your reviewer:
Does this PR introduce a user-facing change?: