Project

General

Profile

Actions

Bug #3902

closed

flow/bypass: SEGV src/flow.c:1158:9 in FlowUpdateState

Added by Peter Manev over 4 years ago. Updated over 4 years ago.

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

Description

Affected version - latest master as per the build-info output below.
Stable (5.x) is not affected.


/usr/local/bin/suricata --af-packet -c /etc/suricata/suricata-pevma-test1.yaml --pidfile /var/run/suricata.pid -vvv 
..
...

[18190] 3/9/2020 -- 14:35:52 - (source-af-packet.c:1784) <Perf> (AFPComputeRingParamsV3) -- AF_PACKET V3 RX Ring params: block_size=1048576 block_nr=1270 frame_size=1664 frame_nr=800100 (mem: 1331691520)
[18191] 3/9/2020 -- 14:35:52 - (source-af-packet.c:1784) <Perf> (AFPComputeRingParamsV3) -- AF_PACKET V3 RX Ring params: block_size=1048576 block_nr=1270 frame_size=1664 frame_nr=800100 (mem: 1331691520)
[18191] 3/9/2020 -- 14:35:53 - (source-af-packet.c:507) <Info> (AFPPeersListReachedInc) -- All AFP capture threads are running.
AddressSanitizer:DEADLYSIGNAL
=================================================================
==16470==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000038 (pc 0x00000092232c bp 0x7f5f92d6ea90 sp 0x7f5f92d6e9d0 T40)
==16470==The signal is caused by a WRITE memory access.
==16470==Hint: address points to the zero page.
AddressSanitizer:DEADLYSIGNAL
AddressSanitizer:DEADLYSIGNAL
    #0 0x92232b in FlowUpdateState /opt/suricata/src/flow.c:1158:9
    #1 0x6accca in PacketBypassCallback /opt/suricata/src/decode.c:432:13
    #2 0xaaec4f in StreamTcpPacket /opt/suricata/src/stream-tcp.c:4931:17
    #3 0xab8e9c in StreamTcp /opt/suricata/src/stream-tcp.c:5197:11
    #4 0x95a587 in FlowWorkerStreamTCPUpdate /opt/suricata/src/flow-worker.c:364:5
    #5 0x95c131 in FlowWorkerFlowTimeout /opt/suricata/src/flow-worker.c:401:5
    #6 0x95c05d in FlowFinish /opt/suricata/src/flow-worker.c:154:5
    #7 0x95b613 in CheckWorkQueue /opt/suricata/src/flow-worker.c:183:27
    #8 0x95af20 in FlowWorkerProcessInjectedFlows /opt/suricata/src/flow-worker.c:447:9
    #9 0x959997 in FlowWorker /opt/suricata/src/flow-worker.c:570:5
    #10 0xb6876e in TmThreadsSlotVarRun /opt/suricata/src/tm-threads.c:117:21
    #11 0xa89732 in TmThreadsSlotProcessPkt /opt/suricata/src/./tm-threads.h:192:17
    #12 0xa82620 in AFPParsePacketV3 /opt/suricata/src/source-af-packet.c:1113:9
    #13 0xa80c97 in AFPWalkBlock /opt/suricata/src/source-af-packet.c:1128:15
    #14 0xa785c0 in AFPReadFromRingV3 /opt/suricata/src/source-af-packet.c:1178:15
    #15 0xa76197 in ReceiveAFPLoop /opt/suricata/src/source-af-packet.c:1571:17
    #16 0xb75fcf in TmThreadsSlotPktAcqLoop /opt/suricata/src/tm-threads.c:312:13
    #17 0x7f6005830fa2 in start_thread (/lib/x86_64-linux-gnu/libpthread.so.0+0x7fa2)
    #18 0x7f60047844ce in clone (/lib/x86_64-linux-gnu/libc.so.6+0xf94ce)

AddressSanitizer can not provide additional info.
SUMMARY: AddressSanitizer: SEGV /opt/suricata/src/flow.c:1158:9 in FlowUpdateState
Thread T40 (W#08-ens4np0) created by T0 (Suricata-Main) here:
    #0 0x53ed8d in pthread_create (/usr/local/bin/suricata+0x53ed8d)
    #1 0xb70094 in TmThreadSpawn /opt/suricata/src/tm-threads.c:1721:14
    #2 0xc8dd99 in RunModeSetLiveCaptureWorkersForDevice /opt/suricata/src/util-runmodes.c:323:13
    #3 0xc8d55c in RunModeSetLiveCaptureWorkers /opt/suricata/src/util-runmodes.c:353:9
    #4 0xa56962 in RunModeIdsAFPWorkers /opt/suricata/src/runmode-af-packet.c:901:11
    #5 0xa6d939 in RunModeDispatch /opt/suricata/src/runmodes.c:391:5
    #6 0xb51311 in SuricataMain /opt/suricata/src/suricata.c:2806:5
    #7 0x58564e in main /opt/suricata/src/main.c:22:12
    #8 0x7f60046af09a in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2409a)

==16470==ABORTING

/usr/local/bin/suricata --build-info
This is Suricata version 6.0.0-dev (3a3a9e135 2020-09-01)
Features: PCAP_SET_BUFF AF_PACKET HAVE_PACKET_FANOUT LIBCAP_NG LIBNET1.1 HAVE_HTP_URI_NORMALIZE_HOOK PCRE_JIT HAVE_NSS HAVE_LUA HAVE_LUAJIT HAVE_LIBJANSSON TLS TLS_C11 MAGIC RUST 
SIMD support: SSE_4_2 SSE_4_1 SSE_3 
Atomic intrinsics: 1 2 4 8 16 byte(s)
64-bits, Little-endian architecture
GCC version 4.2.1 Compatible Clang 7.0.1 (tags/RELEASE_701/final), C version 201112
compiled with _FORTIFY_SOURCE=0
L1 cache line size (CLS)=64
thread local storage method: _Thread_local
compiled with LibHTP v0.5.33, linked against LibHTP v0.5.33

Suricata Configuration:
  AF_PACKET support:                       yes
  eBPF support:                            yes
  XDP support:                             yes
  PF_RING support:                         no
  NFQueue support:                         no
  NFLOG support:                           no
  IPFW support:                            no
  Netmap support:                          no 
  DAG enabled:                             no
  Napatech enabled:                        no
  WinDivert enabled:                       no

  Unix socket enabled:                     yes
  Detection enabled:                       yes

  Libmagic support:                        yes
  libnss support:                          yes
  libnspr support:                         yes
  libjansson support:                      yes
  hiredis support:                         no
  hiredis async with libevent:             no
  Prelude support:                         no
  PCRE jit:                                yes
  LUA support:                             yes, through luajit
  libluajit:                               yes
  GeoIP2 support:                          yes
  Non-bundled htp:                         no
  Old barnyard2 support:                   
  Hyperscan support:                       yes
  Libnet support:                          yes
  liblz4 support:                          yes

  Rust support:                            yes
  Rust strict mode:                        yes
  Rust compiler path:                      /root/.cargo/bin/rustc
  Rust compiler version:                   rustc 1.46.0 (04488afe3 2020-08-24)
  Cargo path:                              /root/.cargo/bin/cargo
  Cargo version:                           cargo 1.46.0 (149022b1d 2020-07-17)
  Cargo vendor:                            yes

  Python support:                          yes
  Python path:                             /usr/bin/python3
  Python distutils                         yes
  Python yaml                              yes
  Install suricatactl:                     yes
  Install suricatasc:                      yes
  Install suricata-update:                 not bundled

  Profiling enabled:                       no
  Profiling locks enabled:                 no

  Plugin support (experimental):           yes

Development settings:
  Coccinelle / spatch:                     no
  Unit tests enabled:                      no
  Debug output enabled:                    no
  Debug validation enabled:                no

Generic build parameters:
  Installation prefix:                     /usr/local
  Configuration directory:                 /usr/local/etc/suricata/
  Log directory:                           /usr/local/var/log/suricata/

  --prefix                                 /usr/local
  --sysconfdir                             /usr/local/etc
  --localstatedir                          /usr/local/var
  --datarootdir                            /usr/local/share

  Host:                                    x86_64-pc-linux-gnu
  Compiler:                                clang (exec name) / g++ (real)
  GCC Protect enabled:                     no
  GCC march native enabled:                yes
  GCC Profile enabled:                     no
  Position Independent Executable enabled: no
  CFLAGS                                   -ggdb3 -O0 -Werror -Wchar-subscripts -Wshadow -Wall -Wextra -Werror -Wno-unused-parameter -Wno-unused-function -fno-strict-aliasing -fstack-protector-all -fsanitize=address -fno-omit-frame-pointer -Wno-unused-parameter -Wno-unused-function -std=c11 -march=native -I${srcdir}/../rust/gen -I${srcdir}/../rust/dist
  PCAP_CFLAGS                               -I/usr/include
  SECCFLAGS   


Related issues 1 (0 open1 closed)

Related to Suricata - Bug #3861: flow: check flow bypass handlingClosedEric LeblondActions
Actions #1

Updated by Victor Julien over 4 years ago

  • Status changed from New to Assigned
  • Target version set to 6.0.0rc1
  • Affected Versions 6.0.0beta1 added
Actions #2

Updated by Victor Julien over 4 years ago

  • Related to Bug #3861: flow: check flow bypass handling added
Actions #3

Updated by Victor Julien over 4 years ago

  • Subject changed from AddressSanitizer: SEGV /opt/suricata/src/flow.c:1158:9 in FlowUpdateState to flow/bypass: SEGV src/flow.c:1158:9 in FlowUpdateState
Actions

Also available in: Atom PDF