]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
napatech: Fix potential double release of packet
authorPhil Young <py@napatech.com>
Wed, 11 Nov 2020 19:21:39 +0000 (14:21 -0500)
committerVictor Julien <victor@inliniac.net>
Fri, 13 Nov 2020 05:41:59 +0000 (06:41 +0100)
This addresses readmine issue #4018.  There was the potential for a packet
buffer to be released twice in response to an error condition.  This
addresses this by only calling NT_NetRxRelease() when the p->ReleasePacket
is called.

src/source-napatech.c

index c30a4fb213c3ce204b827f141891706db864646e..a18616e512f702e59f535492c2cb1edd45572b24 100644 (file)
@@ -1001,12 +1001,10 @@ TmEcode NapatechPacketLoop(ThreadVars *tv, void *data, void *slot)
 
         if (unlikely(PacketSetData(p, (uint8_t *)NT_NET_GET_PKT_L2_PTR(packet_buffer), NT_NET_GET_PKT_WIRE_LENGTH(packet_buffer)))) {
             TmqhOutputPacketpool(ntv->tv, p);
-            NT_NetRxRelease(ntv->rx_stream, packet_buffer);
             SCReturnInt(TM_ECODE_FAILED);
         }
 
         if (unlikely(TmThreadsSlotProcessPkt(ntv->tv, ntv->slot, p) != TM_ECODE_OK)) {
-            NT_NetRxRelease(ntv->rx_stream, packet_buffer);
             SCReturnInt(TM_ECODE_FAILED);
         }