Project

General

Profile

Actions

Bug #8318

open

SIGSEGV in ndpi.c

Added by Antoine abf 2 days ago.

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

Description

Environment
- Suricata 8.0.2 + nDPI 4.14
- AArch64 / NixOS

After applying the fix from https://github.com/OISF/suricata/pull/14847, Suricata still crashes with SIGSEGV in StorageGetById. The crash now occurs in OnFlowUpdate and potentially in EveCallback, rather than in DetectnDPIProtocolPacketMatch.

https://github.com/OISF/suricata/pull/14847 fixed the NULL p->flow case, however there are additional crash paths where the flow exists but f->storage is NULL.

I have a branch with a fix addressing all cases: https://github.com/antoineaboufayssal/suricata/tree/ndpi/v3. I can open a PR for it if you want.

(sorry you guys must hate me, 2 ndpi bugs in 1 week)

           PID: 2433980 (Suricata-Main)
           UID: 0 (root)
           GID: 0 (root)
        Signal: 11 (SEGV)
     Timestamp: Mon 2026-02-23 20:17:35 UTC
  Command Line: /nix/store/4jdc5hyisvm448qn9ywbhg0ra2l3w8fs-suricata-8.0.2/bin/suricata -v -c /var/lib/suricata/suricata-nix.yaml -q 0
    Executable: /nix/store/4jdc5hyisvm448qn9ywbhg0ra2l3w8fs-suricata-8.0.2/bin/suricata

Stack trace of thread 356710:
#0  0x0000aaaac334f6ac in StorageGetById ()
#1  0x0000ffff96ab66f8 in OnThreadInit () from /var/lib/ndpi.so
#2  0x0000aaaac338ebc0 in DetectEngineInspectRulePacketMatches ()
#3  0x0000aaaac3392394 in DetectEnginePktInspectionRun ()
#4  0x0000aaaac33cbc24 in DetectRulePacketRules ()
#5  0x0000aaaac33cc880 in DetectRun ()
#6  0x0000aaaac33ce328 in Detect ()
#7  0x0000aaaac33d5b18 in FlowWorker ()
#8  0x0000aaaac33328f4 in TmThreadsSlotVarRun ()
#9  0x0000aaaac3334654 in TmThreadsSlotVar ()
#10 0x0000ffff971d01ec in start_thread ()
#11 0x0000ffff9724034c in thread_start ()

x0  = 0x118  (offset into NULL base — f->storage dereference)
x19 = 0x0    (NULL pointer)
pc  = StorageGetById+12

No data to display

Actions

Also available in: Atom PDF