simon-git: puzzles (main): Ben Harris

Commits to Tartarus hosted VCS tartarus-commits at lists.tartarus.org
Thu Feb 23 11:34:41 GMT 2023


TL;DR:
  5ba2270 Rough support for fuzzing with libFuzzer
  80de73a Try to clean up fuzzpuzz a bit
  015bd14 Don't give the libFuzzer version of fuzzpuzz a special name

Repository:     https://git.tartarus.org/simon/puzzles.git
On the web:     https://git.tartarus.org/?p=simon/puzzles.git
Branch updated: main
Committer:      Ben Harris <bjh21 at bjh21.me.uk>
Date:           2023-02-23 11:34:41

commit 5ba227031c865aff55fdaf7c9a1b0e8abcbbabc4
web diff https://git.tartarus.org/?p=simon/puzzles.git;a=commitdiff;h=5ba227031c865aff55fdaf7c9a1b0e8abcbbabc4;hp=ecd868ac6e7ab3df4984ff29a16c7158339611a3
Author: Ben Harris <bjh21 at bjh21.me.uk>
Date:   Mon Feb 20 21:51:18 2023 +0000

    Rough support for fuzzing with libFuzzer
    
    For AFL++ and Honggfuzz, our approach is to build a standard fuzzpuzz
    binary with extra hooks for interacting with an external fuzzer.  This
    works well for AFL++ and tolerably for Honggfuzz.  LibFuzzer, though,
    provides its own main() so that the resulting program has a very
    different command-line interface from the normal one.  Also, since
    libFuzzer is a standard part of Clang, we can't decide whether to use it
    based on the behaviour of the compiler.
    
    So what I've done, at least for now, is to have CMake detect when we're
    using Clang and in that case build a separate binary called
    "fuzzpuzz-libfuzzer" which is built with -fsanitize=fuzzer, while the
    ordinary fuzzpuzz is built without.  I'm not sure if this is the right
    approach, though.

 CMakeLists.txt | 10 ++++++++++
 fuzzpuzz.c     | 43 +++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 53 insertions(+)

commit 80de73a6aa4c4e726860c492d2264d4958a56b0d
web diff https://git.tartarus.org/?p=simon/puzzles.git;a=commitdiff;h=80de73a6aa4c4e726860c492d2264d4958a56b0d;hp=5ba227031c865aff55fdaf7c9a1b0e8abcbbabc4
Author: Ben Harris <bjh21 at bjh21.me.uk>
Date:   Mon Feb 20 22:53:33 2023 +0000

    Try to clean up fuzzpuzz a bit
    
    I've separated out the various versions of main(), which has helped a
    little bit.  I've also stopped using fmemopen() since libFuzzer might
    work on Windows.  But I think I probably still have something
    fundamentally wrong in my approach.

 fuzzpuzz.c | 154 ++++++++++++++++++++++++++++++++++++++-----------------------
 1 file changed, 97 insertions(+), 57 deletions(-)

commit 015bd1447472f82a5607ecb5fabaf25bf37cd4e2
web diff https://git.tartarus.org/?p=simon/puzzles.git;a=commitdiff;h=015bd1447472f82a5607ecb5fabaf25bf37cd4e2;hp=80de73a6aa4c4e726860c492d2264d4958a56b0d
Author: Ben Harris <bjh21 at bjh21.me.uk>
Date:   Tue Feb 21 21:04:58 2023 +0000

    Don't give the libFuzzer version of fuzzpuzz a special name
    
    I've changed my mind already.  The other versions of fuzzpuzz all have
    different command-line interfaces anyway, so I think the best approach
    is to just accept that and decide that precisely how fuzzpuzz works
    isn't a defined API.  Fuzzing is inherently not an end-user activity, so
    I think it's acceptable to make it a bit inconsistent.
    
    This means that in Clang builds you get the non-libFuzzer version of
    fuzzpuzz by default (so you can use it with other fuzzers), but if you
    turn on WITH_LIBFUZZER then you'll get the libFuzzer version instead.

 CMakeLists.txt | 17 +++++++----------
 fuzzpuzz.c     |  8 ++++----
 2 files changed, 11 insertions(+), 14 deletions(-)



More information about the tartarus-commits mailing list