From 28bc6eba28909cc9ced1e814399a8b05130efbee Mon Sep 17 00:00:00 2001 From: Adam Langley Date: Thu, 20 Aug 2015 15:15:30 -0700 Subject: [PATCH] Don't use the uint128_t P-256 code under MSAN. MSAN appears to have a bug that causes this code to be miscompiled when compiled with optimisations. In order to prevent that bug from holding everything up, this change disables that code when MEMORY_SANITIZER is defined. The generic elliptic-curve code can pick up the slack in that case. Change-Id: I7ce26969b3ee0bc0b0496506f06a8cf9b2523cfa --- crypto/ec/ec.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/crypto/ec/ec.c b/crypto/ec/ec.c index df0407c4..3117f16e 100644 --- a/crypto/ec/ec.c +++ b/crypto/ec/ec.c @@ -222,7 +222,11 @@ const struct built_in_curve OPENSSL_built_in_curves[] = { {NID_secp224r1, &P224, 0}, { NID_X9_62_prime256v1, &P256, -#if defined(OPENSSL_64_BIT) && !defined(OPENSSL_WINDOWS) + /* MSAN appears to have a bug that causes this P-256 code to be miscompiled + * in opt mode. While that is being looked at, don't run the uint128_t + * P-256 code under MSAN for now. */ +#if defined(OPENSSL_64_BIT) && !defined(OPENSSL_WINDOWS) && \ + !defined(MEMORY_SANITIZER) EC_GFp_nistp256_method, #else 0,