feat(userspace/libsinsp): improve recvmsg SCM_RIGHTS cmsg handling#2262
feat(userspace/libsinsp): improve recvmsg SCM_RIGHTS cmsg handling#2262poiana merged 2 commits intofalcosecurity:masterfrom
recvmsg SCM_RIGHTS cmsg handling#2262Conversation
Signed-off-by: Leonardo Di Giovanna <leonardodigiovanna1@gmail.com>
SCM_RIGHTS cmsg handlingrecvmsg SCM_RIGHTS cmsg handling
|
/milestone 0.21.0 |
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 #2262 +/- ##
==========================================
- Coverage 75.34% 75.29% -0.05%
==========================================
Files 279 279
Lines 34368 34389 +21
Branches 5872 5878 +6
==========================================
- Hits 25894 25893 -1
- Misses 8474 8496 +22
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
|
/hold |
db5ffd2 to
7c9c7e7
Compare
|
/unhold |
|
LGTM label has been added. DetailsGit tree hash: ed418fb1d1833b1bb60fc0d7f582962a9e5720f6 |
|
/hold |
Parse all control messages instead of parsing just the first one. Leverage the new scap_get_fdinfo API to get info only from the file in procfs associated to the file descriptor, instead of scanning each time the entire procfs fd directory. Signed-off-by: Leonardo Di Giovanna <leonardodigiovanna1@gmail.com> Co-authored-by: Roberto Scolaro <roberto.scolaro21@gmail.com>
7c9c7e7 to
3b34a3a
Compare
|
/unhold |
|
LGTM label has been added. DetailsGit tree hash: 582885ca14dccf5450fcef4854563bef35caba4a |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: ekoops, FedeDP 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 |
What type of PR is this?
/kind feature
Any specific area of the project related to this PR?
/area libscap-engine-gvisor
/area libscap
/area libsinsp
Does this PR require a change in the driver versions?
What this PR does / why we need it:
This enhances file descriptor handling in the context of
SCM_RIGHTScontrol message processing forrecvmsgevents. Specifically:cmsghdrand all file descriptors contained inSCM_RIGHTScontrol messages, by selectively call the new API on them, instead of entirely scanning the entire procfs fd directory each time.readlink + sscanfcalls with a single call tostatfor retrieving the inode number of a network namespace inscap_fd_scan_fd_dirandscap_fd_get_fdinfoWhich issue(s) this PR fixes:
Fixes #
Special notes for your reviewer:
Does this PR introduce a user-facing change?: