Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Turn on FuzzHTTP fuzzer on trafficserver project #10460

Merged
merged 7 commits into from Jun 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
14 changes: 11 additions & 3 deletions projects/trafficserver/build.sh
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
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