-
Notifications
You must be signed in to change notification settings - Fork 275
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
Fixup libafl_fuzzbench-based fuzzers #2032
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
b7e7853
fixup libafl_fuzzbench based fuzzers
addisoncrump a5aea5e
restore mruby bug benchmark
addisoncrump 3d01e86
include in CI
addisoncrump b5027cf
update fuzzers to fix linkage
addisoncrump 2536841
rename to convention and update benchmark type
addisoncrump 10aa006
oops, looks like the CI ignores missing benchmarks
addisoncrump File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# Copyright 2019 Google Inc. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
# | ||
################################################################################ | ||
|
||
FROM gcr.io/oss-fuzz-base/base-builder@sha256:87ca1e9e19235e731fac8de8d1892ebe8d55caf18e7aa131346fc582a2034fdd | ||
RUN apt-get update && apt-get install -y build-essential ruby bison ninja-build \ | ||
cmake zlib1g-dev libbz2-dev liblzma-dev | ||
RUN git clone \ | ||
https://github.com/mruby/mruby | ||
RUN git clone --depth 1 https://github.com/bshastry/mruby_seeds.git mruby_seeds | ||
WORKDIR mruby | ||
COPY build.sh *.c *.options *.dict $SRC/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
commit: 8c8bbd94dce3b3eabcf72c674e690516c075b0ee | ||
commit_date: 2023-02-03T04:41:10+0000 | ||
fuzz_target: mruby_fuzzer | ||
project: mruby | ||
type: bug | ||
unsupported_fuzzers: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
#!/bin/bash -eu | ||
# Copyright 2019 Google Inc. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
# | ||
################################################################################ | ||
|
||
# Instrument mruby | ||
( | ||
cd $SRC/mruby | ||
export LD=$CC | ||
export LDFLAGS="$CFLAGS -fPIE" | ||
|
||
# No you cannot overwrite CC/CXX, otherwise afl++, libafl, etc. wont work! | ||
#LD=/usr/local/bin/clang CC=/usr/local/bin/clang CXX=/usr/local/bin/clang++ rake -m || true | ||
rake -m || true | ||
|
||
test -f $SRC/mruby/build/host/lib/libmruby.a | ||
|
||
# build fuzzers | ||
FUZZ_TARGET=$SRC/mruby_fuzzer.c | ||
name=$(basename $FUZZ_TARGET .c) | ||
$CC -c $CFLAGS -Iinclude \ | ||
${FUZZ_TARGET} -o $OUT/${name}.o | ||
$CXX $CXXFLAGS $OUT/${name}.o $LIB_FUZZING_ENGINE -lm \ | ||
$SRC/mruby/build/host/lib/libmruby.a -o $OUT/${name} | ||
rm -f $OUT/${name}.o | ||
) | ||
|
||
# dict | ||
cp $SRC/mruby.dict $OUT/mruby_fuzzer.dict | ||
|
||
# seeds | ||
zip -rq $OUT/mruby_fuzzer_seed_corpus $SRC/mruby_seeds |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,105 @@ | ||
keyword___ENCODING__="__ENCODING__" | ||
keyword___FILE__="__FILE__" | ||
keyword___LINE__="__LINE__" | ||
keyword_BEGIN="BEGIN" | ||
keyword_END="END" | ||
keyword_alias="alias" | ||
keyword_and="and" | ||
keyword_begin="begin" | ||
keyword_break="break" | ||
keyword_case="case" | ||
keyword_class="class" | ||
keyword_def="def" | ||
keyword_do="do" | ||
keyword_else="else" | ||
keyword_elsif="elsif" | ||
keyword_end="end" | ||
keyword_ensure="ensure" | ||
keyword_false="false" | ||
keyword_for="for" | ||
keyword_if="if" | ||
keyword_in="in" | ||
keyword_module="module" | ||
keyword_next="next" | ||
keyword_nil="nil" | ||
keyword_not="not" | ||
keyword_or="or" | ||
keyword_redo="redo" | ||
keyword_rescue="rescue" | ||
keyword_retry="retry" | ||
keyword_return="return" | ||
keyword_self="self" | ||
keyword_super="super" | ||
keyword_then="then" | ||
keyword_true="true" | ||
keyword_undef="undef" | ||
keyword_unless="unless" | ||
keyword_until="until" | ||
keyword_when="when" | ||
keyword_while="while" | ||
keyword_yield="yield" | ||
|
||
operator_a=" !" | ||
operator_b=" ~" | ||
operator_c=" +" | ||
operator_d=" -" | ||
operator_e=" []" | ||
operator_f=" []=" | ||
operator_g=" *" | ||
operator_h=" /" | ||
operator_i=" %" | ||
operator_j=" +-" | ||
operator_k=" >>" | ||
operator_l=" <<" | ||
operator_m=" &" | ||
operator_n=" ^" | ||
operator_o=" |" | ||
operator_p=" <=" | ||
operator_q=" <>" | ||
operator_r=" >=" | ||
operator_s=" <=>" | ||
operator_t=" ==" | ||
operator_u=" ===" | ||
operator_v=" !=" | ||
operator_w=" =~" | ||
operator_x=" !~" | ||
operator_y=" &&" | ||
operator_z=" ||" | ||
operator_aa=" .." | ||
operator_ab=" ..." | ||
operator_ac=" ?" | ||
operator_ad=" :" | ||
operator_ae=" =" | ||
operator_af=" %=" | ||
operator_ag=" /=" | ||
operator_ah=" -=" | ||
operator_ai=" +=" | ||
operator_aj=" |=" | ||
operator_ak=" &=" | ||
operator_al=" >>=" | ||
operator_am=" <<=" | ||
operator_an=" *=" | ||
operator_ao=" &&=" | ||
operator_ap=" ||=" | ||
operator_aq=" **=" | ||
operator_ar=" ^=" | ||
operator_as=" not" | ||
operator_at=" or" | ||
operator_au=" and" | ||
operator_av=" if" | ||
operator_aw=" unless" | ||
operator_ax=" while" | ||
operator_ay=" until" | ||
operator_az=" begin" | ||
operator_ba=" end" | ||
|
||
snippet_1eq1=" 1=1" | ||
snippet_dollar=" $1" | ||
snippet_at=" @a" | ||
snippet_symbol=" :a" | ||
snippet_array=" [1,2]" | ||
snippet_block=" 1.times{|x| x}" | ||
snippet_multi=" 1*1" | ||
|
||
string_single_q=" 'a'" | ||
string_dbl_q=" \"a\"" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#include <stdlib.h> | ||
#include <string.h> | ||
#include <mruby.h> | ||
#include <mruby/compile.h> | ||
|
||
int LLVMFuzzerTestOneInput(uint8_t *Data, size_t size) { | ||
if (size < 1) { | ||
return 0; | ||
} | ||
char *code = malloc(size+1); | ||
memcpy(code, Data, size); | ||
code[size] = '\0'; | ||
mrb_state *mrb = mrb_open(); | ||
mrb_load_string(mrb, code); | ||
mrb_close(mrb); | ||
free(code); | ||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
allowed_benchmarks: | ||
- quickjs_eval-2020-01-05 | ||
- php_php-fuzz-execute | ||
- mruby-2018-05-23 | ||
- mruby_mruby_fuzzer_8c8bbd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
allowed_benchmarks: | ||
- quickjs_eval-2020-01-05 | ||
- php_php-fuzz-execute | ||
- mruby-2018-05-23 | ||
- mruby_mruby_fuzzer_8c8bbd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
allowed_benchmarks: | ||
- quickjs_eval-2020-01-05 | ||
- php_php-fuzz-execute | ||
- mruby-2018-05-23 | ||
- mruby_mruby_fuzzer_8c8bbd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
allowed_benchmarks: | ||
- quickjs_eval-2020-01-05 | ||
- php_php-fuzz-execute | ||
- mruby-2018-05-23 | ||
- mruby_mruby_fuzzer_8c8bbd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@DonggeLiu Maybe something worth noting: the CI will not fail if the benchmark doesn't exist!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wow, I did not know this, thanks!
I reckon this is low priority because it does not affect checking fuzzers or running experiments.
WDYT?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I reckon it's low priority as well, but maybe something to keep in mind since it might inadvertently mark a fuzzer as "working" for a non-existent benchmark.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, created this: #2037