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(userspace/libsinsp): fixed CO_IN filter crafted value. #2019

Merged
merged 1 commit into from
Aug 26, 2024

Conversation

FedeDP
Copy link
Contributor

@FedeDP FedeDP commented Aug 26, 2024

What type of PR is this?

/kind bug

Any specific area of the project related to this PR?

/area libsinsp

Does this PR require a change in the driver versions?

What this PR does / why we need it:

#1904 had a small refactor of the management of CO_IN comparison for PT_CHARBUF fields: https://github.com/falcosecurity/libs/pull/1904/files#diff-1058cd2ebabb1fdd8503ea762a0f06f33af56cf993b3eae8a5f1919f9ef2f5d2L1026
Basically, craft_filter_value is now responsible of returning a correctly-sized item for PT_CHARBUF, but L1041 (https://github.com/falcosecurity/libs/pull/1904/files#diff-1058cd2ebabb1fdd8503ea762a0f06f33af56cf993b3eae8a5f1919f9ef2f5d2L1041) was not updated to use the newly-computed operator len.

Special thanks to @LucaGuerra for spotting the issue and working 4-hands with me on this.

Which issue(s) this PR fixes:

Fixes #2018

Special notes for your reviewer:

The newly added test was double-checked against libs 0.17.3 were it was fully green.

Does this PR introduce a user-facing change?:

fix(userspace/libsinsp): fixed CO_IN filter crafted value.

Signed-off-by: Federico Di Pierro <[email protected]>

Co-authored-by: Luca Guerra <[email protected]>
@FedeDP
Copy link
Contributor Author

FedeDP commented Aug 26, 2024

/milestone 0.18.0

@poiana poiana added this to the 0.18.0 milestone Aug 26, 2024
@poiana poiana added the size/S label Aug 26, 2024
@FedeDP
Copy link
Contributor Author

FedeDP commented Aug 26, 2024

/cc @jasondellaluce @LucaGuerra

Copy link

Perf diff from master - unit tests

     8.22%     -2.52%  [.] sinsp::next
     5.01%     +1.27%  [.] sinsp_evt::get_type
    12.11%     -0.85%  [.] sinsp_parser::reset
     4.07%     +0.82%  [.] sinsp_parser::process_event
     3.41%     -0.69%  [.] sinsp_thread_manager::find_thread
     2.23%     -0.59%  [.] libsinsp::sinsp_suppress::process_event
     0.69%     +0.53%  [.] sinsp_evt::get_direction
     0.11%     +0.49%  [.] libsinsp::runc::match_container_id
     1.12%     -0.45%  [.] std::vector<sinsp_evt_param, std::allocator<sinsp_evt_param> >::emplace_back<sinsp_evt*, unsigned int&, char const*, unsigned long&>
     1.32%     +0.43%  [.] std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_construct<char const*>

Heap diff from master - unit tests

peak heap memory consumption: -403B
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

Copy link

codecov bot commented Aug 26, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 74.22%. Comparing base (839efec) to head (84b459f).
Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2019      +/-   ##
==========================================
+ Coverage   74.14%   74.22%   +0.07%     
==========================================
  Files         253      253              
  Lines       30834    30845      +11     
  Branches     5404     5391      -13     
==========================================
+ Hits        22863    22894      +31     
+ Misses       7946     7923      -23     
- Partials       25       28       +3     
Flag Coverage Δ
libsinsp 74.22% <100.00%> (+0.07%) ⬆️

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.

Copy link
Contributor

@LucaGuerra LucaGuerra left a comment

Choose a reason for hiding this comment

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

This finally unblocks Falco libs bump <3 🚀

Copy link
Member

@Andreagit97 Andreagit97 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 Aug 26, 2024

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

@poiana poiana merged commit d3d43cf into master Aug 26, 2024
46 checks passed
@poiana poiana deleted the fix/co_in_filter_val branch August 26, 2024 13:03
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.

Regression in proc.aname list comparison in libs > 0.17.x
4 participants