Project

General

Profile

Actions

Bug #6120

closed

streaming-buffer: exceeds limit when downloading large file with file-store enabled

Added by Jason Ish 11 months ago. Updated 11 months ago.

Status:
Closed
Priority:
Normal
Assignee:
Target version:
Affected Versions:
Effort:
Difficulty:
Label:

Description

When downloading a large file over http and using a configuration tuned for larger file extraction, the StreamingBuffer will exceed its maximum size of 1GB.

Warning: streaming-buffer: StreamingBuffer::GrowRegionToSize() tried to alloc 1074011072 bytes, exceeds limit of 1073741824 [GrowRegionToSize:util-streaming-buffer.c:592]

My test case was a 9GB Linux ISO, but I have created a truncated version of the pcap that stops just after 1GB of data: https://codemonkey.net/tmp/iso-truncated.pcap.xz

To reproduce, use a rule like the following:

alert http any any -> any any (msg:"ISO"; flow:established,to_client; content:"Operating system load error"; filestore; classtype:policy-violation; sid:9000000; rev:1;)

Then in suricata.yaml:
- Enable file-store.
- Comment out stream.reassembly.depth or set to 0 or some number over 1gb (like 1.1gb)

Then run Suricata (unfortunately -k none is required):

./src/suricata -k none -l ./log -c ./suricata.yaml -r ~/iso-truncated.pcap -S ./test.rules

Output:

Notice: suricata: This is Suricata version 7.0.0-rc2-dev (6154bab49f 2023-06-02) running in USER mode [LogVersion:suricata.c:1153]
Notice: threads: Threads created -> RX: 1 W: 20 FM: 1 FR: 1   Engine started. [TmThreadWaitOnThreadRunning:tm-threads.c:1886]
Warning: streaming-buffer: StreamingBuffer::GrowRegionToSize() tried to alloc 1074011072 bytes, exceeds limit of 1073741824 [GrowRegionToSize:util-streaming-buffer.c:592]
Error: pcap: error code -1 truncated dump file; tried to read 26130 captured bytes, only got 5024 for /home/jason/iso-truncated.pcap [PcapFileDispatch:source-pcap-file-helper.c:156]
Notice: suricata: Signal Received.  Stopping engine. [SuricataMainLoop:suricata.c:2827]
Notice: pcap: read 0 files, 389566 packets, 1140641880 bytes [ReceivePcapFileThreadExitStats:source-pcap-file.c:388]

Related issues 2 (0 open2 closed)

Related to Suricata - Bug #6170: streaming-buffer: exceeds limit when downloading large file with file-store enabled and inspecing file_data contentClosedOISF DevActions
Related to Suricata - Bug #5868: filestore: not saving files when filestore enabled by rule matching on file_data (instead saves 0 bytes)ClosedJeff LucovskyActions
Actions #1

Updated by Jason Ish 11 months ago

Some other notes:
- 6.0.x: Produces the same error if the rule contains file_data and PR 8954 is not applied
- 6.0.x: Works as expected using the version of the rule without file_data.
- master: Error is produced with or without the file_data keyword on the rule.

Actions #2

Updated by Victor Julien 11 months ago

  • Status changed from New to In Progress
  • Assignee changed from OISF Dev to Victor Julien
  • Target version changed from TBD to 7.0.0-rc2
Actions #3

Updated by Victor Julien 11 months ago

  • Status changed from In Progress to Resolved
  • Label Needs backport to 6.0 added

https://github.com/OISF/suricata/pull/9009

6.0.x will need separate analysis and fix.

Actions #4

Updated by OISF Ticketbot 11 months ago

  • Subtask #6148 added
Actions #5

Updated by OISF Ticketbot 11 months ago

  • Label deleted (Needs backport to 6.0)
Actions #6

Updated by Jason Ish 11 months ago

  • Related to Bug #6170: streaming-buffer: exceeds limit when downloading large file with file-store enabled and inspecing file_data content added
  • Related to Bug #5868: filestore: not saving files when filestore enabled by rule matching on file_data (instead saves 0 bytes) added
Actions #7

Updated by Jason Ish 11 months ago

  • Subtask deleted (#6148)
Actions #8

Updated by Jason Ish 11 months ago

  • Status changed from Resolved to Closed

Closing, as #6148 has been reparented to #6170.

Actions

Also available in: Atom PDF