Skip to content

Commit

Permalink
Add workaround for memory sanitizer that cannot recognize explicit_bz…
Browse files Browse the repository at this point in the history
…ero.

Otherwise it produces a lot of false positives in OSS-Fuzz.
  • Loading branch information
mbroz committed Feb 8, 2025
1 parent 3899484 commit a2b2c6a
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lib/crypto_backend/memutils.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,13 @@
# endif
#endif

/* Workaround for https://github.com/google/sanitizers/issues/1507 */
#if defined __has_feature
# if __has_feature (memory_sanitizer)
# undef HAVE_EXPLICIT_BZERO
# endif
#endif

/* Memzero helper (memset on stack can be optimized out) */
ATTR_NOINLINE ATTR_ZERO_REGS
void crypt_backend_memzero(void *s, size_t n)
Expand Down

0 comments on commit a2b2c6a

Please sign in to comment.