Skip to content

Commit

Permalink
chore: remove make fuzz and AFL fuzz (#4808)
Browse files Browse the repository at this point in the history
  • Loading branch information
jouho authored Oct 8, 2024
1 parent ffe0bf4 commit 1329b07
Show file tree
Hide file tree
Showing 13 changed files with 31 additions and 391 deletions.
16 changes: 0 additions & 16 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -72,22 +72,6 @@ valgrind: bin
pedantic_valgrind: bin
$(MAKE) -C tests pedantic_valgrind

.PHONY : fuzz
ifeq ($(shell uname),Linux)
fuzz : fuzz-linux
else
fuzz : fuzz-osx
endif

.PHONY : fuzz-osx
fuzz-osx :
@echo "\033[33;1mSKIPPED\033[0m Fuzzing is not supported on \"$$(uname -mprs)\" at this time."

.PHONY : fuzz-linux
fuzz-linux : export S2N_UNSAFE_FUZZING_MODE = 1
fuzz-linux : bin
$(MAKE) -C tests fuzz

.PHONY : coverage
coverage: run-lcov run-genhtml

Expand Down
6 changes: 0 additions & 6 deletions codebuild/bin/install_default_dependencies.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,6 @@ if [[ "$TESTS" == "fuzz" || "$TESTS" == "ALL" || "$LATEST_CLANG" == "true" ]]; t
codebuild/bin/install_clang.sh "$(mktemp -d)" "$LATEST_CLANG_INSTALL_DIR" "$OS_NAME" > /dev/null ;
fi

# Download and Install LibFuzzer with latest clang
if [[ "$TESTS" == "fuzz" || "$TESTS" == "ALL" ]]; then
mkdir -p "$LIBFUZZER_INSTALL_DIR" || true
PATH=$LATEST_CLANG_INSTALL_DIR/bin:$PATH codebuild/bin/install_libFuzzer.sh "$(mktemp -d)" "$LIBFUZZER_INSTALL_DIR" "$OS_NAME" ;
fi

# Download and Install Openssl 1.1.1
if [[ ("$S2N_LIBCRYPTO" == "openssl-1.1.1") || ( "$TESTS" == "integrationv2" || "$TESTS" == "ALL" ) ]]; then
if [[ ! -x "$OPENSSL_1_1_1_INSTALL_DIR/bin/openssl" ]]; then
Expand Down
55 changes: 0 additions & 55 deletions codebuild/bin/install_libFuzzer.sh

This file was deleted.

2 changes: 0 additions & 2 deletions codebuild/bin/s2n_codebuild.sh
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,6 @@ if [[ "$TESTS" == "ALL" || "$TESTS" == "integrationv2" ]]; then run_integration_
if [[ "$TESTS" == "ALL" || "$TESTS" == "crt" ]]; then ./codebuild/bin/build_aws_crt_cpp.sh $(mktemp -d) $(mktemp -d); fi
if [[ "$TESTS" == "ALL" || "$TESTS" == "sharedandstatic" ]]; then ./codebuild/bin/test_install_shared_and_static.sh $(mktemp -d); fi
if [[ "$TESTS" == "ALL" || "$TESTS" == "dynamicload" ]]; then ./codebuild/bin/test_dynamic_load.sh $(mktemp -d); fi
# This can be removed after CI starts using buildspec_fuzz.yml
if [[ "$TESTS" == "ALL" || "$TESTS" == "fuzz" ]]; then (make clean && make fuzz) ; fi
if [[ "$TESTS" == "sawHMAC" ]] && [[ "$OS_NAME" == "linux" ]]; then make -C tests/saw/ tmp/verify_HMAC.log ; fi
if [[ "$TESTS" == "sawDRBG" ]]; then make -C tests/saw tmp/verify_drbg.log ; fi
if [[ "$TESTS" == "ALL" || "$TESTS" == "tls" ]]; then make -C tests/saw tmp/verify_handshake.log ; fi
Expand Down
52 changes: 0 additions & 52 deletions codebuild/spec/buildspec_ubuntu_fuzz_afl.yml

This file was deleted.

45 changes: 0 additions & 45 deletions codebuild/spec/buildspec_ubuntu_fuzz_artifacts.yml

This file was deleted.

4 changes: 0 additions & 4 deletions lib/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,6 @@ all: libs2n.a libs2n.so libs2n.dylib

include ../s2n.mk

ifeq ($(FUZZ_COVERAGE), true)
FUZZCOV_FLAGS = -fprofile-instr-generate -fcoverage-mapping
endif

libs2n.a: ${OBJS}
$(AR) cru libs2n.a ${OBJS}
$(RANLIB) libs2n.a
Expand Down
38 changes: 0 additions & 38 deletions s2n.mk
Original file line number Diff line number Diff line change
Expand Up @@ -57,23 +57,6 @@ COVERAGE_CFLAGS = -fprofile-arcs -ftest-coverage
COVERAGE_LDFLAGS = --coverage
LDFLAGS = -z relro -z now -z noexecstack

FUZZ_CFLAGS = -fsanitize-coverage=trace-pc-guard -fsanitize=address,undefined,leak

# Define FUZZ_COVERAGE - to be used for generating coverage reports on fuzz tests
# !!! NOT COMPATIBLE WITH S2N_COVERAGE !!!
ifeq ($(FUZZ_COVERAGE), true)
FUZZ_CFLAGS += -fprofile-instr-generate -fcoverage-mapping
else
ifeq ($(S2N_COVERAGE), true)
DEFAULT_CFLAGS += ${COVERAGE_CFLAGS}
LIBS += ${COVERAGE_LDFLAGS}
endif
endif

ifdef FUZZ_TIMEOUT_SEC
DEFAULT_CFLAGS += -DS2N_FUZZ_TESTING=1
endif

# Add a flag to disable stack protector for alternative libcs without
# libssp.
ifneq ($(NO_STACK_PROTECTOR), 1)
Expand Down Expand Up @@ -134,27 +117,6 @@ endif

LLVM_GCOV_MARKER_FILE=${COVERAGE_DIR}/use-llvm-gcov.tmp

ifeq ($(S2N_UNSAFE_FUZZING_MODE),1)
# Override compiler to clang if fuzzing, since gcc does not support as many sanitizer flags as clang
CC=clang

# Create a marker file so that later invocations of make can pick the right COV_TOOL by default
$(shell touch "${LLVM_GCOV_MARKER_FILE}")

# Turn on debugging and fuzzing flags when S2N_UNSAFE_FUZZING_MODE is enabled to give detailed stack traces in case
# an error occurs while fuzzing.
CFLAGS += ${DEFAULT_CFLAGS} ${DEBUG_CFLAGS} ${FUZZ_CFLAGS}

# Filter out the visibility settings if we are fuzzing
CFLAGS := $(filter-out -fvisibility=hidden,$(CFLAGS))
CFLAGS := $(filter-out -DS2N_EXPORTS,$(CFLAGS))
DEFAULT_CFLAGS := $(filter-out -fvisibility=hidden,$(DEFAULT_CFLAGS))
DEFAULT_CFLAGS := $(filter-out -DS2N_EXPORTS,$(DEFAULT_CFLAGS))
CPPFLAGS := $(filter-out -fvisibility=hidden,$(CPPFLAGS))
CPPFLAGS := $(filter-out -DS2N_EXPORTS,$(CPPFLAGS))

endif

# Disable strict-prototypes check in clang
ifneq '' '$(findstring clang,$(CC))'
CFLAGS += -Wno-strict-prototypes
Expand Down
6 changes: 0 additions & 6 deletions tests/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,6 @@ libs:
integrationv2:
${MAKE} -C integrationv2

.PHONY : fuzz
fuzz:
${MAKE} -C testlib
${MAKE} -C fuzz

.PHONY : viz
viz:
${MAKE} -C viz
Expand All @@ -59,7 +54,6 @@ clean: decruft
${MAKE} -C testlib decruft
${MAKE} -C LD_PRELOAD decruft
${MAKE} -C unit clean
${MAKE} -C fuzz clean
${MAKE} -C viz clean
${MAKE} -C saw decruft

31 changes: 0 additions & 31 deletions tests/fuzz/LD_PRELOAD/Makefile

This file was deleted.

Loading

0 comments on commit 1329b07

Please sign in to comment.