fix(ebpf): kernel data filter combine bitmap #4468
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
1. Explain what the PR does
3e7df50 test(filters): kernel data filter
d66134b fix(ebpf): kernel data filter combine bitmap
3e7df50 test(filters): kernel data filter
d66134b fix(ebpf): kernel data filter combine bitmap
2. Explain how to test it
Start Tracee with the following two policies:
Access the following file:
policies.zip
3. Other comments
A bug was identified and reported by @OriGlassman in the new kernel data filter.
security_file_open
:security_file_open
without a filter.security_file_open
with pathname filter (which uses in-kernel filter).res
) only contains the enabled bit for the policy that was matched during the kernel data filter logic.10
, meaning only Policy 2 is enabled.11
, where Policy 1 is also enabled because it does not use a filter.match_scope_filters
) works because it initializes all bits to1
and disables them as needed throughout the code.0
and enabling bits during the filter logic.After completing the filter logic, combine the bitmap for policies without filters to ensure they are correctly enabled in the final result.