-
Notifications
You must be signed in to change notification settings - Fork 176
feat: add PPME_SYSCALL_CONNECT_E params to PPME_SYSCALL_CONNECT_X
#2529
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
Conversation
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: ekoops The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Perf diff from master - unit testsHeap diff from master - unit testsHeap diff from master - scap fileBenchmarks diff from master |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #2529 +/- ##
==========================================
- Coverage 78.42% 78.41% -0.01%
==========================================
Files 292 292
Lines 32001 31990 -11
Branches 4653 4649 -4
==========================================
- Hits 25096 25085 -11
Misses 6905 6905
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
X64 kernel testing matrix
ARM64 kernel testing matrix
|
3344955 to
92ae386
Compare
| if(evt.get_num_params() < 2) { | ||
| switch(evt.get_fd_info()->m_type) { | ||
| case SCAP_FD_IPV4_SOCK: | ||
| evt.get_fd_info()->m_sockinfo.m_ipv4info.m_fields.m_dip = 0; | ||
| evt.get_fd_info()->m_sockinfo.m_ipv4info.m_fields.m_dport = 0; | ||
| break; | ||
| case SCAP_FD_IPV6_SOCK: | ||
| evt.get_fd_info()->m_sockinfo.m_ipv6info.m_fields.m_dip = ipv6addr::empty_address; | ||
| evt.get_fd_info()->m_sockinfo.m_ipv6info.m_fields.m_dport = 0; | ||
| break; | ||
| default: | ||
| break; | ||
| } | ||
| sinsp_utils::sockinfo_to_str(&evt.get_fd_info()->m_sockinfo, | ||
| evt.get_fd_info()->m_type, | ||
| &evt.get_paramstr_storage()[0], | ||
| (uint32_t)evt.get_paramstr_storage().size(), | ||
| m_hostname_and_port_resolution_enabled); | ||
|
|
||
| evt.get_fd_info()->m_name = &evt.get_paramstr_storage()[0]; | ||
| return; | ||
| } |
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 was a special parsing logic handling old scap files' connect enter events not containing any addr parameter. Receiving a 1-parameter connect event event is no longer possible, as I updated the scap converter table to add a default addr parameter value to them. The default addr parameter is now a single-byte containing a PPM_AF_UNSPEC family value, to distinguish it from a 0-length PT_SOCKADDR parameter. Hope to remove this custom logic soon, as we move forwarding and clean the connect event handling. For the moment, we need to keep it, as some tests still rely on this peculiar behaviour in a non-obvious way.
mstemm
left a comment
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.
Just one question about a value pushed in one of the tests.
92ae386 to
5f3cb7c
Compare
Add `PPME_SYSCALL_CONNECT_E` parameters to` PPME_SYSCALL_CONNECT_X` event definition and align all 3 kernel drivers to it. Add new rules to scap file converter table to convert events in old scap files to the new layout. Add/update connect-related drivers, scap converter and sinsp parser tests to account the new layout. For the moment, do not touch userspace connect "enter event"-related logic as it requires additional work to be done on driver's tuple generation logic. Signed-off-by: Leonardo Di Giovanna <[email protected]>
5f3cb7c to
8ad48da
Compare
|
LGTM label has been added. DetailsGit tree hash: 782858bcf07261b082d5a47683d659207715ca2a |
What type of PR is this?
/kind test
/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-engine-savefile
/area libscap
/area libsinsp
/area tests
Does this PR require a change in the driver versions?
/version driver-SCHEMA-version-minor
What this PR does / why we need it:
This PR is part of #2427.
It:
PPME_SYSCALL_CONNECT_Eparameters toPPME_SYSCALL_CONNECT_Xevent definition and aligns all 3 kernel drivers to itFor the moment, this patch does not touch userspace connect "enter event"-related logic as it requires additional work to be done on driver's tuple generation logic.
However, I changed the default value set for
PT_SOCKADDRto a single-byte containingPPM_AF_UNSPEC: this is needed in order to not break the old expected behaviour, but I hope to remove this custom logic as the discussion on how to mitigate TOCTTOU once we drop the enter events reaches some conclusion.Which issue(s) this PR fixes:
Fixes #
Special notes for your reviewer:
/milestone 0.22.0
Does this PR introduce a user-facing change?: