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

[llvm-special-case-list-fuzzer] fix off-by-one read #73888

Merged
merged 1 commit into from
Dec 28, 2023

Conversation

DavidKorczynski
Copy link
Contributor

@DavidKorczynski DavidKorczynski commented Nov 30, 2023

The current fuzzer relies on MemoryBuffer to hold the fuzz data. However, the fuzzer runs into an OOB instantly because the MemoryBuffer interface guarantees that "In addition to basic access to the characters in the file, this interface guarantees you can read one character past the end of the file, and that this character will read as '\0'." ref, which the fuzzer fails to satisfy. As such, it runs into an OOB on this line.

Consequently, the OSS-Fuzz set up is not running since the build is declared failing as the fuzzer fails on the first run. See here for links to build logs https://introspector.oss-fuzz.com/project-profile?project=llvm and specifically at the bottom of this build log.

This change fixes the fuzzer and should solve the OSS-Fuzz build as well.

CC @mmdriley

The current fuzzer relies on MemoryBuffer to hold the fuzz data.
However, the fuzzer currently runs into an OOB instantly because
the MemoryBuffer interface guarantees that "In addition to basic access
to the characters in the file, this interface guarantees you can read
one character past the end of the file, and that this character will
read as '\0'."
The fuzzer as written atm is currently not supporting this, and,
consequently the current OSS-Fuzz set up is not running since the builds
is declared failing as the fuzzer fails on the first run. See here for
links to build logs
https://introspector.oss-fuzz.com/project-profile?project=llvm

This change fixes the fuzzer and should solve the OSS-Fuzz build as
well.

Signed-off-by: David Korczynski <david@adalogics.com>
@DavidKorczynski
Copy link
Contributor Author

@nikic could you help review this one?

@nikic nikic merged commit 7f69c8b into llvm:main Dec 28, 2023
3 checks passed
@DavidKorczynski
Copy link
Contributor Author

Thanks @nikic !

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