aboutsummaryrefslogtreecommitdiffstats
path: root/executor/common_usb_linux.h
diff options
context:
space:
mode:
authorAleksandr Nogikh <nogikh@google.com>2021-12-08 17:02:32 +0000
committerAleksandr Nogikh <wp32pw@gmail.com>2021-12-09 14:31:10 +0100
commit4459585c043faace507c685bcd9997da15809aae (patch)
treee37e0d561e243521cbcf9169bbdb0180e658f3cb /executor/common_usb_linux.h
parentb54aa474a6b13cc9b8c0a68f07d71873f30dfa02 (diff)
all: adapt to how mmapping a kcov instance works in Linux
It turns out that the current Linux implementation of KCOV does not properly handle multiple mmap invocations on the same instance. The first one succeedes, but the subsequent ones do not actually mmap anything, yet returning no error at all. The ability to mmap that memory multiple times allows us to increase syz-executor performance and it would be a pity to completely lose it (especially given that mmapping kcov works fine on *BSD). In some time a patch will be prepared, but still we will have to support both versions at the same time - the buggy one and the correct one. Detect whether the bug is present by writing a value at the pointer returned by mmap. If it is present, disable dynamic kcov mmapping and pre-mmap 5 instances in the main() function - it should be enough for all reasonable uses. Otherwise, pre-mmap 3 and let syz-executor mmap them as needed.
Diffstat (limited to 'executor/common_usb_linux.h')
0 files changed, 0 insertions, 0 deletions