Project

General

Profile

Actions

Security #5851

open

rust: handle allocation failures

Added by Philippe Antoine almost 2 years ago. Updated 11 days ago.

Status:
New
Priority:
Normal
Assignee:
Target version:
Affected Versions:
Label:
CVE:
Git IDs:
Severity:
MODERATE
Disclosure Date:

Description

Not sure of the category...

Currently, an allocation failure leads to panic and process ending, C handles it better...
cf https://www.crowdstrike.com/blog/dealing-with-out-of-memory-conditions-in-rust/

Faking alloc failure, I get for instance

#7 0x10ea2ebd8 in std::process::abort::hfaff54524d62d81b process.rs:2130
    #8 0x10e90b90f in std::alloc::rust_oom::h528a44886fdbddcd alloc.rs:356
    #9 0x10e90b918 in __rg_oom alloc.rs:351
    #10 0x10e930048 in alloc::alloc::handle_alloc_error::rt_error::h65041dc22fa5f060 alloc.rs:385
    #11 0x10ea2f598 in alloc::alloc::handle_alloc_error::h11ee487ccdadf939 alloc.rs:389
    #12 0x10e5ee8fa in alloc::raw_vec::RawVec$LT$T$C$A$GT$::reserve_for_push::ha39039a3af63f40e raw_vec.rs:298
    #13 0x10e4bc836 in suricata::jsonbuilder::JsonBuilder::open_object::hf1475c5793fa381e jsonbuilder.rs:232
    #14 0x10e4c02f7 in jb_open_object jsonbuilder.rs:715
    #15 0x10e325945 in JsonAnomalyLogger output-json-anomaly.c:279


Related issues 3 (1 open2 closed)

Related to Suricata - Security #5701: Suricata crashes while processing FTPClosedPhilippe AntoineActions
Related to Suricata - Bug #6057: rust/jsonbuilder: better handling of memory allocation errorsClosedJason IshActions
Copied to Suricata - Security #6187: DetectEngineReload: handle allocation failuresAssignedPhilippe AntoineActions
Actions #1

Updated by Philippe Antoine almost 2 years ago

  • Related to Security #5701: Suricata crashes while processing FTP added
Actions #2

Updated by Philippe Antoine over 1 year ago

  • Related to Bug #6057: rust/jsonbuilder: better handling of memory allocation errors added
Actions #3

Updated by Philippe Antoine over 1 year ago

  • Copied to Security #6187: DetectEngineReload: handle allocation failures added
Actions #4

Updated by Victor Julien 4 months ago

  • Subject changed from Rust: handle allocation failures to rust: handle allocation failures
Actions #5

Updated by Philippe Antoine 11 days ago

Hard part : external crates !

Actions

Also available in: Atom PDF