BLAKE3 icon indicating copy to clipboard operation
BLAKE3 copied to clipboard

Suppress MemorySanitizer false positive

Open jbms opened this issue 2 years ago • 2 comments

MemorySanitizer does not support assembly, and therefore produces a false positive on blake3_hasher_finalize and related functions.

Note that a similar (but less comprehensive) fix was previously applied to LLVM's fork of this repo:

https://github.com/llvm/llvm-project/blob/34aff47521c3e0cbac58b0d5793197f76a304295/llvm/lib/Support/BLAKE3/blake3.c#L576

jbms avatar Feb 17 '23 22:02 jbms

Help me make sure I understand the problem. MSan thinks some memory is uninitialized, because the writes that initialized it were inside an assembly block/file that MSan can't analyze. Is that correct? That seems like it would be a problem for all sorts of libraries, like OpenSSL. Does OpenSSL include this sort of MSan hinting?

oconnor663 avatar Jun 17 '23 19:06 oconnor663

Yes, that's all correct.

https://github.com/openssl/openssl/blob/6c0ecc2bce64cc86948a51f80f832b5e48a9ebea/crypto/engine/eng_rdrand.c#L47

jbms avatar Jun 18 '23 06:06 jbms