From bac367c419c63f1440cf68ff593a3c00f8f47124 Mon Sep 17 00:00:00 2001 From: "Todd C. Miller" Date: Thu, 29 Dec 2022 13:22:29 -0700 Subject: Avoid using our function replacements when fuzzing (where possible). We don't want to fuzz the function replacements themselves as this can skew the coverage reports. --- configure.ac | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) (limited to 'configure.ac') diff --git a/configure.ac b/configure.ac index 8d67657c6..25abf27f0 100644 --- a/configure.ac +++ b/configure.ac @@ -2089,17 +2089,21 @@ case "$host" in # We call getrandom via syscall(3) in case it is not in libc AC_CHECK_HEADERS([linux/random.h sys/syscall.h]) - # The glibc getentropy() emulation may fail on older kernels. - # We use our own getentropy() by default on Linux. - : ${ac_cv_func_getentropy='no'} - - # The glibc arc4random() may fail in chroot on older kernels. - # We use our own arc4random() by default on Linux. - : ${ac_cv_func_arc4random='no'} - - # The glibc closefrom() emulation may fail in chroot. - # We use our own closefrom() by default on Linux. - : ${ac_cv_func_closefrom='no'} + # Do not use our replacement functions when fuzzing, it may + # skew the coverage reports. + if test X"$enable_fuzzer" != X"no"; then + # glibc's getentropy() emulation may fail on older kernels. + # We use our own getentropy() by default on Linux. + : ${ac_cv_func_getentropy='no'} + + # glibc's arc4random() may fail in chroot on older kernels. + # We use our own arc4random() by default on Linux. + : ${ac_cv_func_arc4random='no'} + + # glibc's closefrom() emulation may fail in chroot. + # We use our own closefrom() by default on Linux. + : ${ac_cv_func_closefrom='no'} + fi # Linux 3.2 supports reading/writing a another process # without using ptrace(2). -- cgit v1.2.1