Skip to content

Commit

Permalink
disable msan for some functions that make libsodium calls
Browse files Browse the repository at this point in the history
  • Loading branch information
caitlinross committed Mar 3, 2022
1 parent 5ca574c commit 8418fab
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion plugins/EncryptionOperator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ namespace plugin
struct EncryptionOperator::EncryptImpl
{
std::string KeyFilename;
unsigned char Key[crypto_secretbox_KEYBYTES];
unsigned char Key[crypto_secretbox_KEYBYTES] = {0};
bool KeyValid = false;

~EncryptImpl()
Expand Down Expand Up @@ -90,6 +90,12 @@ EncryptionOperator::EncryptionOperator(const Params &parameters)

EncryptionOperator::~EncryptionOperator() {}

#if defined(__clang__)
#if __has_feature(memory_sanitizer)
// Memory Sanitizer has an issue with some libsodium calls.
__attribute__((no_sanitize("memory")))
#endif
#endif
size_t EncryptionOperator::Operate(const char *dataIn, const Dims &blockStart,
const Dims &blockCount, const DataType type,
char *bufferOut)
Expand Down Expand Up @@ -131,6 +137,12 @@ size_t EncryptionOperator::Operate(const char *dataIn, const Dims &blockStart,
return offset;
}

#if defined(__clang__)
#if __has_feature(memory_sanitizer)
// Memory Sanitizer has an issue with some libsodium calls.
__attribute__((no_sanitize("memory")))
#endif
#endif
size_t EncryptionOperator::InverseOperate(const char *bufferIn,
const size_t sizeIn, char *dataOut)
{
Expand Down

0 comments on commit 8418fab

Please sign in to comment.