Skip to content

Commit

Permalink
autotools: Disable eager MSan in ctime_tests
Browse files Browse the repository at this point in the history
  • Loading branch information
real-or-random committed Apr 15, 2024
1 parent d831168 commit f53604d
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,20 @@ AC_DEFUN([SECP_TRY_APPEND_DEFAULT_CFLAGS], [
])
SECP_TRY_APPEND_DEFAULT_CFLAGS(SECP_CFLAGS)

ctime_tests_CFLAGS=
if test "x$GCC" = "xyes"; then
# MSan on Clang >=16 reports unitialized memory in function parameters and return values, even if
# the uninitalized variable is never actually "used". This is called "eager" checking, and it's
# sounds like good idea for normal use of MSan. However, it yields many false positives in the
# ctime_tests because many return values depend on secret (i.e., "uninitialized") values, and
# we're only interested in detecting branches (which count as "uses") on secret data.
#
# We need to wrap the argument in a --(start/end)-no-unused-arguments block to suppress a
# -Wunused-command-line-argument warning, which clang emits if MSan is not actually enabled, i.e.,
# if -fsanitize=memory does not appear on the command line.
SECP_TRY_APPEND_CFLAGS([--start-no-unused-arguments -fno-sanitize-memory-param-retval --end-no-unused-arguments], ctime_tests_CFLAGS)
fi

###
### Define config arguments
###
Expand Down

0 comments on commit f53604d

Please sign in to comment.