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

fix msan-problems in fuzzer-environment #129

Merged
merged 1 commit into from
Dec 12, 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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .clusterfuzzlite/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
FROM gcr.io/oss-fuzz-base/base-builder:v1

ENV CLUSTERFUZZLITE=TRUE
RUN apt-get update && apt-get install -y bison libssl-dev libevent-dev libsystemd-dev
RUN apt-get update && apt-get install -y bison libssl-dev libevent-dev
COPY . $SRC/openiked-portable
WORKDIR openiked-portable
COPY .clusterfuzzlite/build.sh $SRC/
2 changes: 1 addition & 1 deletion .clusterfuzzlite/build.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash -eu

# build project
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -DCLUSTERFUZZ=ON
cmake -S . -B build -DCMAKE_BUILD_TYPE=DEBUG -DCLUSTERFUZZ=ON
cmake --build build

# copy binary and dict to $OUT
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,7 @@ if(CLUSTERFUZZ)
add_subdirectory(regress/parser-libfuzzer)
if (NOT DEFINED ENV{CLUSTERFUZZLITE})
set(CMAKE_C_COMPILER clang)
string(APPEND CMAKE_C_FLAGS " -g -O1 -fsanitize=fuzzer-no-link")
string(APPEND CMAKE_C_FLAGS " -g -O0 -fsanitize=fuzzer-no-link")
endif()
endif()
add_subdirectory(compat)
Expand Down
2 changes: 2 additions & 0 deletions regress/parser-libfuzzer/common.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

#include <event.h>
#include <limits.h>
#include <string.h>

#include "iked.h"
#include "types.h"
Expand Down Expand Up @@ -162,6 +163,7 @@ ssize_t
ikev2_nat_detection(struct iked *env, struct iked_message *msg,
void *ptr, size_t len, u_int type, int frompeer)
{
bzero(ptr, len);
return (0);
}

Expand Down
1 change: 1 addition & 0 deletions regress/parser-libfuzzer/run_test.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/bin/sh

# script to run the parser-fuzzer for 5 minutes with the right options
# use repo github.com/openiked/openiked-fuzzing/corpus/test_libfuzzer as corpus for faster results

# ASAN-option to help finding the source of memory leaks
export ASAN_OPTIONS=fast_unwind_on_malloc=0
Expand Down
Loading