Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork937
Add graceful handling of expected exceptions in fuzz_submodule.py#1922
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Merged
Byron merged 5 commits intogitpython-developers:mainfromDaveLak:fix-fuzz-submodule-expected-exceptions-handlingMay 31, 2024
Merged
Add graceful handling of expected exceptions in fuzz_submodule.py#1922
Byron merged 5 commits intogitpython-developers:mainfromDaveLak:fix-fuzz-submodule-expected-exceptions-handlingMay 31, 2024
Uh oh!
There was an error while loading.Please reload this page.
Conversation
This file contains hidden or 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
Fixes:https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=69350**`IsADirectoryError`**Fuzzer provided input data can sometimes produce filenames that looklike directories and raise `IsADirectoryError` exceptions which crashthe fuzzer. This commit catches those cases and returns -1 to instructlibfuzzer that the inputs are not valuable to add to the corpus.**`FileExistsError`**Similar to the above, this is a possible exception case produced by thefuzzed data and not a bug so its handled the same.
Adds a utility function to limit the maximum file name legnth producedby the fuzzer to a max size dictated by the host its run on.
The fuzzer was having trouble analyzing `fuzz_submodule.py` when usingthe `atheris.instrument_imports()` context manager. Switching to`atheris.instrument_all()` instead slightly increases the startup timefor the fuzzer, but significantly improves the fuzzing engines abilityto identify new coverage.The changes here also disable warnings that are logged to `stdout` fromthe SUT. These warnings are expected to happen with some inputs andclutter the fuzzer output logs. They can be optionally re-enabled fordebugging by passing a flag o the Python interpreter command line orsetting the `PYTHONWARNINGS` environment variable.
Byron approved these changesMay 31, 2024
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.
Thanks a lot for the swift fix, it's much appreciated!
8502efe
intogitpython-developers:main 26 checks passed
Uh oh!
There was an error while loading.Please reload this page.
DaveLak added a commit to DaveLak/GitPython that referenced this pull requestAug 9, 2024
Fixes a bug in the `fuzz_submodule` harness where the fuzzed data canproduce file names that exceed the maximum size allowed byt the OS. Thisissue came up previously and was fixed ingitpython-developers#1922, but the submodule filename fixed here was missed in that PR.Fixes:https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=69456
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
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.
Fixes:https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=69350 (See7b684cd)
Also:
fuzz_submodule.py
coverage & efficacy (2a2294f)