Skip to content

Commit

Permalink
Turn on FuzzHTTP fuzzer on trafficserver project (#10460)
Browse files Browse the repository at this point in the history
Co-authored-by: Oliver Chang <[email protected]>
  • Loading branch information
shukitchan and oliverchang authored Jun 8, 2023
1 parent 6bd67d0 commit 0d99caf
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 7 deletions.
14 changes: 11 additions & 3 deletions projects/trafficserver/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,29 @@
# limitations under the License.
#
################################################################################

# don't use __cxa_atexit for coverage sanitizer
if [[ $SANITIZER = coverage ]]
then
export CXXFLAGS="$CXXFLAGS -fno-use-cxa-atexit"
fi

autoreconf -if
./configure --enable-debug
./configure --enable-debug --enable-malloc-allocator
make -j$(nproc) --ignore-errors

pushd fuzzer/
make
cp FuzzEsi $OUT/FuzzEsi
#cp FuzzHTTP $OUT/FuzzHTTP
cp FuzzHTTP $OUT/FuzzHTTP
popd

pushd $SRC/oss-fuzz-bloat/trafficserver/
cp FuzzEsi_seed_corpus.zip $OUT/FuzzEsi_seed_corpus.zip
cp FuzzHTTP_seed_corpus.zip $OUT/FuzzHTTP_seed_corpus.zip
popd

mkdir $OUT/lib
mkdir -p $OUT/lib
cp lib/swoc/.libs/libtsswoc*.so* $OUT/lib/.
cp src/tscore/.libs/libtscore.so* $OUT/lib/.
cp src/tscpp/util/.libs/libtscpputil.so* $OUT/lib/.
8 changes: 4 additions & 4 deletions projects/trafficserver/fuzzer/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,14 @@ HttpINC=\
$(INCDIR)/iocore/net/quic \
$(INCDIR)/iocore/utils \
$(INCDIR)/lib \
$(INCDIR)/lib/swoc/include \
$(INCDIR)/proxy/api \
$(INCDIR)/proxy/hdrs \
$(INCDIR)/proxy/http

CoreLib=$(LIB_FUZZING_ENGINE) \
$(LIBDIR)/lib/yamlcpp \
$(LIBDIR)/lib/swoc/.libs/ -ltsswoc \
$(LIBDIR)/proxy/hdrs -lhdrs \
$(LIBDIR)/proxy/http -lhttp \
$(LIBDIR)/src/tscore/.libs/ -ltscore \
Expand All @@ -51,8 +53,6 @@ CoreLib=$(LIB_FUZZING_ENGINE) \
$(LIBDIR)/src/tscpp/util/.libs/ -ltscpputil \
$(LIBDIR)/iocore/eventsystem/ -linkevent \
$(LIBDIR)/src/records/ -lrecords_p \
$(LIBDIR)/mgmt/.libs/ -lmgmt_p \
$(LIBDIR)/proxy/shared/ -lUglyLogStubs \
-Wl,-rpath=lib/

all: $(TARGET)
Expand All @@ -61,8 +61,8 @@ $(TARGET):
$(CXX) $(CXXFLAGS) $(AM_CXXFLAGS) $(MACROS) $(EsiINC) -c $(EsiEXE).cc
$(CXX) $(CXXFLAGS) $(AM_CXXFLAGS) -o $(EsiEXE) $(EsiEXE).o $(EsiLIB)

#$(CXX) $(CXXFLAGS) $(AM_CXXFLAGS) $(MACROS) $(HttpINC) -c $(HttpEXE).cc
#$(CXX) $(CXXFLAGS) $(AM_CXXFLAGS) -o $(HttpEXE) $(HttpEXE).o $(CoreLib)
$(CXX) $(CXXFLAGS) $(AM_CXXFLAGS) $(MACROS) $(HttpINC) -c $(HttpEXE).cc
$(CXX) $(CXXFLAGS) $(AM_CXXFLAGS) -o $(HttpEXE) $(HttpEXE).o $(CoreLib)

clean:
rm $(EsiEXE) $(HttpEXE) *.o
Expand Down

0 comments on commit 0d99caf

Please sign in to comment.