]> git.ipfire.org Git - thirdparty/libbsd.git/commitdiff
test: Exempt blank_stack_side_effects() from sanitizer checks
authorGuillem Jover <guillem@hadrons.org>
Tue, 21 Mar 2023 03:11:03 +0000 (04:11 +0100)
committerGuillem Jover <guillem@hadrons.org>
Wed, 29 Mar 2023 00:47:18 +0000 (02:47 +0200)
This will mean we cannot use sanitizer support on the Hurd, for which
this function was added to fix the test. But the sanitizer suppression
function attribute is not having any effect, so this is better than
nothing.

test/explicit_bzero.c

index 048587600a809b262958382defe8380479baa764..5ec7592015531e64673ee0f0023b50c253be27c7 100644 (file)
@@ -138,6 +138,7 @@ populate_secret(char *buf, ssize_t len)
 static void __attribute__((__noinline__))
 blank_stack_side_effects(char *buf, size_t len)
 {
+#ifndef __SANITIZE_ADDRESS__
        char scratch[SECRETBYTES * 4];
 
        /* If the read(3) in populate_secret() wrote into the stack, as it
@@ -145,6 +146,7 @@ blank_stack_side_effects(char *buf, size_t len)
         * detect the wrong secret on the stack. */
        memset(scratch, 0xFF, sizeof(scratch));
        ASSERT_EQ(NULL, memmem(scratch, sizeof(scratch), buf, len));
+#endif
 }
 
 static int