Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This pull request introduces support for string-based filtering in syscall hooks, adds robust string comparison helpers, and ensures proper memory management for dynamically allocated filter patterns. Additionally, it includes minor type and variable declaration improvements in the portal subsystem for clarity and correctness.
Syscall hook filtering improvements:
enum value_filter_type, enabling exact match, contains, startswith, and endswith comparisons for syscall argument and return value filtering.struct value_filterto include apatternpointer and its length for string comparisons.value_matches_filterto handle the new string filter types, invoking the appropriate helper for each.String comparison helpers:
check_str_exact,check_str_startswith,check_str_endswith,check_str_contains) to safely compare user-space strings from kernel space, minimizing stack usage and handling large strings.Memory management:
Portal subsystem improvements:
portal_get_vma_nameto avoid shadowing and improve clarity; switched some types toconst char *where appropriate. [1] [2] [3] [4]copy_sizeinhandle_op_copy_buf_guesttouint64_tfor correctness and usedmin_tfor type safety.Other minor changes:
<linux/uaccess.h>insyscalls_hc.hto support user-space memory access in the new helpers.int i) indo_unregister_syscall_hook.