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

Force at least one unique stack frame per fuzzer #95

Merged
merged 1 commit into from Sep 6, 2022

Conversation

alexcrichton
Copy link
Contributor

This change is an attempt to address the behavior found at
google/oss-fuzz#8389 where two distinct bugs were accidentally
deduplicated into the same bug report. One of the reasons for this is
that the stack traces between the two bugs were almost the same with
only very minor differences. My hope is that by forcing a unique stack
frame per fuzzer this will be less likely since there is guaranteed to
be at least one stack frame per fuzz target which is unique with this
change.

While I was here I wrapped up the generated function by the
fuzz_target! macro in a const _: () = { ... } to avoid adding this
new run function in to the normal module's namespace and accidentally
causing name collisions (e.g. if fuzz targets already have functions
named run)

This change is an attempt to address the behavior found at
google/oss-fuzz#8389 where two distinct bugs were accidentally
deduplicated into the same bug report. One of the reasons for this is
that the stack traces between the two bugs were almost the same with
only very minor differences. My hope is that by forcing a unique stack
frame per fuzzer this will be less likely since there is guaranteed to
be at least one stack frame per fuzz target which is unique with this
change.

While I was here I wrapped up the generated function by the
`fuzz_target!` macro in a `const _: () = { ... }` to avoid adding this
new `run` function in to the normal module's namespace and accidentally
causing name collisions (e.g. if fuzz targets already have functions
named `run`)
Copy link
Member

@fitzgen fitzgen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

run function changes LGTM, question about the const _ tho

src/lib.rs Show resolved Hide resolved
@fitzgen fitzgen merged commit 64ad66a into rust-fuzz:master Sep 6, 2022
alexcrichton added a commit to alexcrichton/wasmtime that referenced this pull request Oct 24, 2022
The `libfuzzer-sys` update in bytecodealliance#5068 included some changes to the
`fuzz_target!` macro which caused a bare `run` function to be shadowed
by the macro-defined `run` function (changed in
rust-fuzz/libfuzzer#95) which meant that some of our fuzz targets were
infinite looping or stack overflowing as the same function was called
indefinitely. This renames the top-level `run` function to something
else in the meantime.
alexcrichton added a commit to alexcrichton/wasmtime that referenced this pull request Oct 24, 2022
The `libfuzzer-sys` update in bytecodealliance#5068 included some changes to the
`fuzz_target!` macro which caused a bare `run` function to be shadowed
by the macro-defined `run` function (changed in
rust-fuzz/libfuzzer#95) which meant that some of our fuzz targets were
infinite looping or stack overflowing as the same function was called
indefinitely. This renames the top-level `run` function to something
else in the meantime.
alexcrichton added a commit to bytecodealliance/wasmtime that referenced this pull request Oct 24, 2022
The `libfuzzer-sys` update in #5068 included some changes to the
`fuzz_target!` macro which caused a bare `run` function to be shadowed
by the macro-defined `run` function (changed in
rust-fuzz/libfuzzer#95) which meant that some of our fuzz targets were
infinite looping or stack overflowing as the same function was called
indefinitely. This renames the top-level `run` function to something
else in the meantime.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants