linux/perf.c: fix --linux_perf_bts_block startup case

The failure:
$ honggfuzz -f in/ --linux_perf_bts_block -- /usr/bin/tiff -D ___FILE___
  [2016-11-11T23:11:20+0000][W][5951] arch_perfOpen():223 mmap(mmapAuxBuf) failed,
    try increasing the kernel.perf_event_mlock_kb sysctl (up to even 300000000): Cannot allocate memory
  [2016-11-11T23:11:20+0000][E][5951] arch_perfEnable():261 Cannot set up perf for PID=5953 (_HF_DYNFILE_BTS_BLOCK)
  [2016-11-11T23:11:20+0000][F][5951] arch_prepareChild():248 Couldn't enable perf counters for pid 5953

It seems aux data also needs WRITE permissions.

At least this change fixes startup for me.

Reported-by: Mateusz Lenik
Signed-off-by: Sergei Trofimovich <siarheit@google.com>
1 file changed
tree: ca00ebd147dfdef87ec5cfdd79a1ffeb92769f36
  1. android/
  2. docs/
  3. examples/
  4. libhfuzz/
  5. linux/
  6. mac/
  7. posix/
  8. third_party/
  9. tools/
  10. .gitignore
  11. .gitmodules
  12. arch.h
  13. CHANGELOG
  14. cmdline.c
  15. cmdline.h
  16. common.h
  17. CONTRIBUTING
  18. COPYING
  19. display.c
  20. display.h
  21. files.c
  22. files.h
  23. fuzz.c
  24. fuzz.h
  25. honggfuzz.c
  26. log.c
  27. log.h
  28. Makefile
  29. mangle.c
  30. mangle.h
  31. README.md
  32. report.c
  33. report.h
  34. sancov.c
  35. sancov.h
  36. subproc.c
  37. subproc.h
  38. util.c
  39. util.h
README.md

honggfuzz

Description

  • A general-purpose, easy-to-use fuzzer with interesting analysis options. See USAGE for details
  • Supports several hardware-based (CPU) and software-based feedback-driven fuzzing methods
  • It works (at least) under GNU/Linux, FreeBSD, Mac OS X, Windows/CygWin and Android
  • Supports persistent modes of fuzzing (long-lived process calling a fuzzed API repeatedly) with libhfuzz
  • Can fuzz standalone long-lasting processes (e.g. network servers like Apache's httpd and ISC's bind)

Code

Requirements

  • Linux - The BFD library (libbfd-dev) and libunwind (libunwind-dev/libunwind8-dev)
  • FreeBSD - gmake
  • Android - Android SDK/NDK. Also see this detailed doc on how to build and run it
  • Windows - CygWin
  • Darwin/OS X - Xcode 10.8+
  • if Clang/LLVM is used - the BlocksRuntime Library (libblocksruntime-dev)

Trophies

The tool has been used to find a few interesting security problems in major software packages; Examples:

Other

This is NOT an official Google product.