From d44ba395f78b7716dc51c9ce76c1a6a8a433122c Mon Sep 17 00:00:00 2001 From: ronaldfw Date: Fri, 26 Nov 2021 16:45:16 +0100 Subject: [PATCH] Suppress stdout output for fuzzers in projects/orbit (#6909) We recently added a new fuzzer that prints a lot to stdout due to how error messages are handled. With this change we suppress this output. The understanding is that useful output from asan, etc. goes to stderr, which we do not suppress. --- projects/orbit/Dockerfile | 1 + projects/orbit/build.sh | 2 ++ projects/orbit/default.options | 2 ++ 3 files changed, 5 insertions(+) create mode 100644 projects/orbit/default.options diff --git a/projects/orbit/Dockerfile b/projects/orbit/Dockerfile index e4f01c81c..4d408fcaf 100644 --- a/projects/orbit/Dockerfile +++ b/projects/orbit/Dockerfile @@ -23,6 +23,7 @@ RUN mkdir -p $SRC/orbit && tar -xzf $SRC/main.tar.gz \ -C $SRC/orbit/ --strip-components 1; rm -f $SRC/main.tar.gz WORKDIR $SRC/orbit COPY build.sh $SRC/ +COPY default.options $SRC/ # That's a hack. The service needs to have a more recent kernel than what the # container provides. But this code is not going to be called from the fuzz- diff --git a/projects/orbit/build.sh b/projects/orbit/build.sh index a90185fd6..6bedde4d6 100755 --- a/projects/orbit/build.sh +++ b/projects/orbit/build.sh @@ -49,6 +49,8 @@ function copy_fuzzer { cp -v "$1" "$OUT/" patchelf --set-rpath '$ORIGIN/lib' "$OUT/$(basename "$1")" + cp -v "$SRC/default.options" "$OUT/$(basename "$1").options" + ldd "$1" | grep '=>' | cut -d ' ' -f 3 | while read lib; do if [[ -f $lib ]]; then cp -v "$lib" "$OUT/lib/" diff --git a/projects/orbit/default.options b/projects/orbit/default.options new file mode 100644 index 000000000..1c815b33f --- /dev/null +++ b/projects/orbit/default.options @@ -0,0 +1,2 @@ +[libfuzzer] +close_fd_mask=1