appneta / tcpreplay

Pcap editing and replay tools for *NIX and Windows - Users please download source from
http://tcpreplay.appneta.com/wiki/installation.html#downloads
1.15k stars 268 forks source link

[Bug] Reachable abort in tcpprep, packet2tree, src/tree.c:746 #756

Closed 5hadowblad3 closed 1 year ago

5hadowblad3 commented 1 year ago

Describe the bug Hi, there.

There is a reachable abort in tcpprep, packet2tree, src/tree.c:746, in the newest commit 76644c24abde01dcf7f746bb3432b0dcf0b1838a. This issue seems to be related with issue #715 .

To Reproduce Steps to reproduce the behavior:

  1. compiled with
    export CFLAGS="-fsanitize=address -g"
    export CXXFLAGS="-fsanitize=address -g"
    ../configure --disable-local-libopts
  2. run
    tcpprep --auto=bridge --cachefile=/dev/null --pcap=POC

POC.zip (unzip first)

Expected behavior Here is the traces reported by ASAN:

AddressSanitizer:DEADLYSIGNAL
=================================================================
==1295229==ERROR: AddressSanitizer: ABRT on unknown address 0x03ea0013c37d (pc 0x7fa0750c800b bp 0x7fa07523d588 sp 0x7ffcf788e6b0 T0)
    #0 0x7fa0750c800b in raise /build/glibc-SzIz7B/glibc-2.31/signal/../sysdeps/unix/sysv/linux/raise.c:51:1
    #1 0x7fa0750a7858 in abort /build/glibc-SzIz7B/glibc-2.31/stdlib/abort.c:79:7
    #2 0x7fa0750a7728 in __assert_fail_base /build/glibc-SzIz7B/glibc-2.31/assert/assert.c:92:3
    #3 0x7fa0750b8fd5 in __assert_fail /build/glibc-SzIz7B/glibc-2.31/assert/assert.c:101:3
    #4 0x50635a in packet2tree  /benchmark/tcpreplay/build-a/src/../../src/tree.c:746:5
    #5 0x50508c in add_tree_ipv4  /benchmark/tcpreplay/build-a/src/../../src/tree.c:545:15
    #6 0x4facf6 in process_raw_packets  /benchmark/tcpreplay/build-a/src/../../src/tcpprep.c:464:21
    #7 0x4facf6 in main  /benchmark/tcpreplay/build-a/src/../../src/tcpprep.c:144:23
    #8 0x7fa0750a9082 in __libc_start_main /build/glibc-SzIz7B/glibc-2.31/csu/../csu/libc-start.c:308:16
    #9 0x41d57d in _start ( /benchmark/tcpreplay/build-a/src/tcpprep+0x41d57d)

AddressSanitizer can not provide additional info.
SUMMARY: AddressSanitizer: ABRT /build/glibc-SzIz7B/glibc-2.31/signal/../sysdeps/unix/sysv/linux/raise.c:51:1 in raise
==1295229==ABORTING
Aborted

System (please complete the following information):

fklassen commented 1 year ago

Fixed in PR #763 - for 4.3.3