Skip to content
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

fix(schema): make OPENAT2_E DIRFD_PARAM point to the right param #2084

Merged
merged 1 commit into from
Sep 30, 2024

Conversation

gnosek
Copy link
Contributor

@gnosek gnosek commented Sep 27, 2024

What type of PR is this?

Uncomment one (or more) /kind <> lines:

/kind bug

/kind cleanup

/kind design

/kind documentation

/kind failing-test

/kind feature

Any specific area of the project related to this PR?

Uncomment one (or more) /area <> lines:

/area API-version

/area build

/area CI

/area driver-kmod

/area driver-bpf

/area driver-modern-bpf

/area libscap-engine-bpf

/area libscap-engine-gvisor

/area libscap-engine-kmod

/area libscap-engine-modern-bpf

/area libscap-engine-nodriver

/area libscap-engine-noop

/area libscap-engine-source-plugin

/area libscap-engine-savefile

/area libscap

/area libpman

/area libsinsp

/area tests

/area proposals

Does this PR require a change in the driver versions?

/version driver-API-version-major

/version driver-API-version-minor

/version driver-API-version-patch

/version driver-SCHEMA-version-major

/version driver-SCHEMA-version-minor

/version driver-SCHEMA-version-patch

What this PR does / why we need it:

DIRFD_PARAM is supposed to contain a reference to the corresponding dirfd parameter for a particular relative path param. For OPENAT2_E, the dirfd param refers back to the name param, which is clearly wrong.

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:

Does this PR introduce a user-facing change?:

NONE

@gnosek
Copy link
Contributor Author

gnosek commented Sep 27, 2024

cc @jasondellaluce

@FedeDP
Copy link
Contributor

FedeDP commented Sep 27, 2024

/milestone next-driver

@poiana poiana added this to the next-driver milestone Sep 27, 2024
Copy link
Contributor

@FedeDP FedeDP left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/approve

@poiana
Copy link
Contributor

poiana commented Sep 27, 2024

LGTM label has been added.

Git tree hash: 076484401690ab854f1485ce50b0c689e59da672

@poiana
Copy link
Contributor

poiana commented Sep 27, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: FedeDP, gnosek

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Copy link

Perf diff from master - unit tests

    11.35%     -1.31%  [.] sinsp_parser::reset
     4.67%     -1.10%  [.] gzfile_read
     7.72%     -1.08%  [.] sinsp::next
     3.21%     +0.84%  [.] sinsp_thread_manager::get_thread_ref
     2.88%     -0.52%  [.] sinsp_thread_manager::find_thread
     0.38%     +0.45%  [.] sinsp_parser::parse_clone_exit_child
     0.82%     +0.45%  [.] std::_Hashtable<long, std::pair<long const, std::shared_ptr<sinsp_threadinfo> >, std::allocator<std::pair<long const, std::shared_ptr<sinsp_threadinfo> > >, std::__detail::_Select1st, std::equal_to<long>, std::hash<long>, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits<false, false, true> >::find
     1.20%     -0.44%  [.] scap_event_has_large_payload
     0.11%     +0.40%  [.] sinsp_threadinfo::get_fd
     1.73%     -0.38%  [.] 0x00000000000e9380

Heap diff from master - unit tests

peak heap memory consumption: 0B
peak RSS (including heaptrack overhead): 0B
total memory leaked: 0B

Heap diff from master - scap file

peak heap memory consumption: 0B
peak RSS (including heaptrack overhead): 0B
total memory leaked: 0B

Benchmarks diff from master

Comparing gbench_data.json to /root/actions-runner/_work/libs/libs/build/gbench_data.json
Benchmark                                                         Time             CPU      Time Old      Time New       CPU Old       CPU New
----------------------------------------------------------------------------------------------------------------------------------------------
BM_sinsp_split_mean                                            -0.0018         -0.0018           149           148           149           148
BM_sinsp_split_median                                          -0.0051         -0.0051           149           148           149           148
BM_sinsp_split_stddev                                          +1.3807         +1.3814             1             1             1             1
BM_sinsp_split_cv                                              +1.3849         +1.3856             0             0             0             0
BM_sinsp_concatenate_paths_relative_path_mean                  +0.1082         +0.1082            56            62            56            62
BM_sinsp_concatenate_paths_relative_path_median                +0.1148         +0.1149            56            62            56            62
BM_sinsp_concatenate_paths_relative_path_stddev                +1.8052         +1.8030             0             1             0             1
BM_sinsp_concatenate_paths_relative_path_cv                    +1.5314         +1.5294             0             0             0             0
BM_sinsp_concatenate_paths_empty_path_mean                     -0.0042         -0.0042            24            24            24            24
BM_sinsp_concatenate_paths_empty_path_median                   -0.0041         -0.0040            24            24            24            24
BM_sinsp_concatenate_paths_empty_path_stddev                   -0.2889         -0.2892             0             0             0             0
BM_sinsp_concatenate_paths_empty_path_cv                       -0.2859         -0.2862             0             0             0             0
BM_sinsp_concatenate_paths_absolute_path_mean                  +0.1370         +0.1370            55            63            55            63
BM_sinsp_concatenate_paths_absolute_path_median                +0.1418         +0.1418            55            63            55            63
BM_sinsp_concatenate_paths_absolute_path_stddev                -0.6271         -0.6273             1             0             1             0
BM_sinsp_concatenate_paths_absolute_path_cv                    -0.6720         -0.6722             0             0             0             0
BM_sinsp_split_container_image_mean                            -0.0353         -0.0353           405           391           405           391
BM_sinsp_split_container_image_median                          -0.0367         -0.0367           405           390           405           390
BM_sinsp_split_container_image_stddev                          +0.3192         +0.3235             1             2             1             2
BM_sinsp_split_container_image_cv                              +0.3675         +0.3720             0             0             0             0

Copy link

codecov bot commented Sep 27, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 73.58%. Comparing base (73bcad2) to head (fb72c43).
Report is 1 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #2084   +/-   ##
=======================================
  Coverage   73.58%   73.58%           
=======================================
  Files         253      253           
  Lines       31869    31869           
  Branches     5654     5637   -17     
=======================================
+ Hits        23451    23452    +1     
+ Misses       8418     8408   -10     
- Partials        0        9    +9     
Flag Coverage Δ
libsinsp 73.58% <ø> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

gnosek added a commit to falcosecurity/plugin-sdk-rs that referenced this pull request Sep 29, 2024
Instead of a const generic param that's not really possible to use
(we don't have methods to access params by index), generate an actual
method to get the dirfd corresponding to a PT_FSRELPATH from an event.

The WIP part is manually patching the event schema for an upstream bug:
falcosecurity/libs#2084
@poiana poiana merged commit 8baec4b into falcosecurity:master Sep 30, 2024
57 of 59 checks passed
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.

4 participants