-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
detect/content: Consider distance in validation #6846
Conversation
Ticket: 2982 This commit validates that the content usage in a rule will not exceed the dsize value. Values of distance that cause the right edge to be exceeded are considered an error and the signature will be rejected.
This commit replaces a SCMalloc/memset with SCCalloc
Codecov Report
@@ Coverage Diff @@
## master #6846 +/- ##
==========================================
- Coverage 77.70% 77.69% -0.02%
==========================================
Files 628 628
Lines 187247 187281 +34
==========================================
+ Hits 145503 145508 +5
- Misses 41744 41773 +29
Flags with carried forward coverage won't be shown. Click here to find out more. |
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.
Minor comment inline.
I guess the bigger issue is to work with QA (and perhaps ET?) to get all checks to pass...
@@ -402,6 +400,17 @@ bool DetectContentPMATCHValidateCallback(const Signature *s) | |||
|
|||
uint32_t max_right_edge = (uint32_t)max_right_edge_i; | |||
|
|||
int min_dsize_required = SigParseMaxRequiredDsize(s); | |||
if (min_dsize_required >= 0) { | |||
SCLogNotice("min_dsize %d; max_right_edge %d", min_dsize_required, max_right_edge); |
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.
debug
ERROR: Invalid Signature config error in tlpr1_asan_cfg QA test ERROR: QA failed on tlpr1_asan_cfg. Pipeline 5887 |
Continued in #6939 |
Continuation of #6838
This commit modifies the validation callback to include the distance
during validation.
Values of distance that cause the right edge to be exceeded are
considered an error and the signature will be rejected.
Link to redmine ticket: 2982
Describe changes:
Updates:
suricata-verify-pr: 673
#suricata-verify-repo:
#suricata-verify-branch:
#suricata-update-pr:
#suricata-update-repo:
#suricata-update-branch:
#libhtp-pr:
#libhtp-repo:
#libhtp-branch: