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
Reject negative destination offsets in 'blit' #160
Conversation
this looks good to me -- there's a small inconsistency though: I agree that the solution in here is correct, and maybe we should adapt it to the other |
LGTM, but can we get some AFL fuzz tests for this library? I suspect it would find all of these bugs in seconds. (I can add some crowbar tests if you want) |
That's a great idea! |
When running the tests individually, it: - Found mirage#160 in 17s. - Found an overflow in of_bigarray in 1s. - Found an overflow in sub in 1s.
When running the tests individually, it: - Found mirage#160 in 17s. - Found an overflow in of_bigarray in 1s. - Found an overflow in sub in 1s.
When running the tests individually, it: - Found mirage#160 in 17s. - Found an overflow in of_bigarray in 1s. - Found an overflow in sub in 1s.
When running the tests individually, it: - Found mirage#160 in 17s. - Found an overflow in of_bigarray in 1s. - Found an overflow in sub in 1s.
When running the tests individually, it: - Found mirage#160 in 17s. - Found an overflow in of_bigarray in 1s. - Found an overflow in sub in 1s.
(fuzzing added in #164) |
-- - Fix arithmetic overflow in `Cstruct.lenv` and `copyv` (mirage/ocaml-cstruct#159 by @yallop) - Reject negative destination offsets in `blit` (mirage/ocaml-cstruct#160 by @yallop) - Add AFL fuzz tests using Crowbar, which independently discovered mirage/ocaml-cstruct#160 and also an overflow in `of_bigarray` and `sub`, now bith fixed (mirage/ocaml-cstruct#164 by @talex5) - Improve performance of several allocation functions by eliminating an unnecessary buffer zero step (mirage/ocaml-cstruct#158 by @hannesm) - Compile the source tree with stricter flags, including dead variable detection and deprecation warnings (mirage/ocaml-cstruct#157 by @samoht) - Bump the required minimum OCaml version up to 4.03.0 (due to mirage/ocaml-cstruct#157).
Before:
After: