Open mattyoung101 opened 2 months ago
Also - let me know if these fuzzer issues are just noise and you'd prefer not to see them, as I don't want to be a nuisance (I know people with fuzzers can be like that sometimes). Cheers :)
This is a great example of a useful and responsibly reported issue discovered by fuzzing, actually!
Version
Yosys 0.45+106 (git sha1 c1228fec2, clang++ 18.1.8 -Og -fPIC -O1 -fno-omit-frame-pointer -fno-optimize-sibling-calls -fsanitize=address)
On which OS did this happen?
Linux
Reproduction Steps
The following script,
issue.ys
, will cause a stack buffer overflow and crash when run under AddressSanitizer:(run with
yosys -s issue.ys
).This was found via fuzzing using Honggfuzz as a quick experiment from me (see my setup here: https://github.com/mattyoung101/yosys_honggfuzz_docker, script is a bit ugly sorry) and I manually minimised the issue down to the '%' character in the port name.
I'll also just ping issue #613 since that seems to track fuzzing Yosys, although I'm using Honggfuzz not AFL++.
Expected Behavior
Yosys does not stack buffer overflow when presented with this input.
Actual Behavior
Yosys stack buffer overflows, presumably due to malformed format string. Here is the output of AddressSanitizer: