-
Notifications
You must be signed in to change notification settings - Fork 912
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
Also copy ruleset when copying falco source #2271
Conversation
In the copy constructor and assignment operator for falco_source, also copy the ruleset along with factories/name. Signed-off-by: Mark Stemm <[email protected]>
@jasondellaluce -- I noticed a crash in falco_engine::complete_rule_loading (https://github.com/falcosecurity/falco/blob/master/userspace/engine/falco_engine.cpp#L544) when loading rules files and tracked it down to this bug. I'm confused on how rules loading would work without this fix though. Seems like the (NULL) ruleset would be dereferenced all the time, wouldn't it? |
I understand why falco itself is okay, the ruleset for the source is created from the factory in load_rules(): https://github.com/falcosecurity/falco/blob/master/userspace/engine/falco_engine.cpp#L194. A ruleset for the source is also created in add_source: https://github.com/falcosecurity/falco/blob/master/userspace/engine/falco_engine.cpp#L406, but that one is not copied properly. I think this crash can only occur if you call complete_rule_loading without ever calling load_rules(). So not a real problem, but would still be a good corner case to fix. |
/milestone 0.34.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
LGTM label has been added. Git tree hash: 16b859fa2bf399788877da8c0dd76bf15d349eec
|
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, jasondellaluce, mstemm 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 |
In the copy constructor and assignment operator for falco_source, also copy the ruleset along with factories/name.
Signed-off-by: Mark Stemm [email protected]
What type of PR is this?
/kind bug
Any specific area of the project related to this PR?
/area engine
What this PR does / why we need it:
Which issue(s) this PR fixes:
Fixes #
Special notes for your reviewer:
Does this PR introduce a user-facing change?: