Commit 536a7d42fd010811aba208eef281916f34387e78

Guillem Jover 2023-03-21T04:11:03

test: Exempt blank_stack_side_effects() from sanitizer checks 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.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
diff --git a/test/explicit_bzero.c b/test/explicit_bzero.c
index 0485876..5ec7592 100644
--- a/test/explicit_bzero.c
+++ b/test/explicit_bzero.c
@@ -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