-
Notifications
You must be signed in to change notification settings - Fork 175
fix(libsinsp): do not reformat input buffer strings while applying arg filters #2214
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(libsinsp): do not reformat input buffer strings while applying arg filters #2214
Conversation
…g filters Signed-off-by: Luca Guerra <luca@guerra.sh>
Signed-off-by: Luca Guerra <luca@guerra.sh>
Perf diff from master - unit tests
Heap diff from master - unit tests
Heap diff from master - scap file
Benchmarks diff from master
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #2214 +/- ##
==========================================
+ Coverage 75.43% 75.44% +0.01%
==========================================
Files 265 265
Lines 34043 34056 +13
Branches 5800 5801 +1
==========================================
+ Hits 25680 25694 +14
+ Misses 8363 8362 -1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
argstr = evt->get_param_as_str(m_argid, | ||
&resolved_argstr, | ||
m_inspector->get_buffer_format()); | ||
argstr = evt->get_param_as_str(m_argid, &resolved_argstr, format); |
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.
Question: is this the only place where the fix applies? What about embedding it inside evt->get_param_as_str()
by passing the additional m_is_compare
boolean? This would enforce any other place to choose the right logic (ie: is a compare? PF_NORMAL, else use the buffer format); or perhaps even better inside:
m_inspector->get_buffer_format(bool is_compare)
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.
I think it's currently clear what the function does: get_param_as_str()
should do one thing, formatting one param as string. The format parameter tells it how it is supposed to be formatted. There may be other things that may affect how that parameter is formatted which are not necessarily the is_compare
flag, for instance, the function is used to format some fields during syscall parsing, testing or other things. Perhaps in some other comparisons we would like to use a different format.
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 the explanation!
/milestone 0.20.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.
/approve
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: FedeDP, LucaGuerra 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 |
LGTM label has been added. Git tree hash: f0704abba5ea077e5d7e0dc76715f19f71f438a2
|
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?
No
What this PR does / why we need it:
See falcosecurity/falco#3437 for a description of the effect of this issue on Falco. Filters should not be affected by the output format.
Which issue(s) this PR fixes:
Fixes #
Special notes for your reviewer:
Does this PR introduce a user-facing change?: