Rfb max length 8731 v3.6 - #16164
Conversation
Ticket: 8731 Adds a configurable limit to string lengths to avoid to retain too much memory for too long, and avoid producing log events that are too big
And log it with from_utf8_lossy Since we may now cut a too big failure_reason breaking a valid utf-8 string Ticket: 8731
|
AI-generated review posted automatically by Suricata ai-review. Verdict: request changes
|
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #16164 +/- ##
==========================================
- Coverage 83.11% 83.11% -0.01%
==========================================
Files 1004 1004
Lines 277558 277598 +40
==========================================
+ Hits 230692 230725 +33
- Misses 46866 46873 +7
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
|
Information: QA ran without warnings. Pipeline = 33645 |
|
My reviewer flagged another accounting issue, but it's not leading to a panic. So perhaps it can be addressed layer. @suricata-review-bot do you agree with the analysis in that commit? |
Question from @victorjulien:
I agree with the accounting principle, but it is not an outstanding defect at this head. For the linked 5000-byte/1024-byte-cap case, both values are 3976, so the pending skip becomes zero and the following segment is not over-skipped. The suricata-verify PR #3340 scenario is useful regression coverage, but its analysis does not reveal a remaining bug in this revision. |
This is already present in main, independently of this PR, and I am not sure what the behavior should be anyways See OISF/suricata-verify#3340 (comment) Something like diff --git a/rust/src/rfb/rfb.rs b/rust/src/rfb/rfb.rs
index 931d2feace..6d6eebb5f5 100644
--- a/rust/src/rfb/rfb.rs
+++ b/rust/src/rfb/rfb.rs
@@ -740,6 +740,10 @@ impl RFBState {
} else {
debug_validate_fail!("no transaction set at failure reason stage");
}
+ if !rem.is_empty() {
+ current_transaction.set_event(RFBEvent::DataAfterCloseState);
+ return AppLayerResult::err();
+ } |
|
My bot is happy now, but I do think it would be good to use (some of) the tests from OISF/suricata-verify#3340 as well |
|
Replaced by #16177 |
Took one test For the others, they seem to me that they enforce a current behavior of Suricata that is not the expected one (do you want me to create a ticket about it ? ) |
I think this is a tricky effect of these auto-generated tests, they expose existing behavior but offer little guidance on what correct behavior is. I will leave the judgement of adding a ticket with you :) |
At least, these tests were helpful for debugging :-) Not creating the ticket now |
Link to ticket: https://redmine.openinfosecfoundation.org/issues/8731
Describe changes:
SV_BRANCH=OISF/suricata-verify#3342
#16163 with git diff staged and pushed