summaryrefslogtreecommitdiff
path: root/absl/random/internal/seed_material.cc
diff options
context:
space:
mode:
authorGravatar Abseil Team <absl-team@google.com>2021-06-02 13:32:24 -0700
committerGravatar Derek Mauro <dmauro@google.com>2021-06-02 17:19:50 -0400
commited53ad03abd7baf39dda2ac8037ff3d4f5c533e5 (patch)
tree01d0d16bc184dd01d9009516e8b3eeb60e5ef5a1 /absl/random/internal/seed_material.cc
parent702cae1e762dc6f2f9d31777db04e1adbdb36697 (diff)
Export of internal Abseil changes
-- b2a781121ff72fb485b7e67539d5e4ff1eb66df2 by Gennadiy Rozental <rogeeff@google.com>: Consistently use absl::flat_hash_map instead of std::map in Flags implementation. PiperOrigin-RevId: 377132816 -- 9ab83a154d8f22d51fed0092bf94245b5af1f498 by Derek Mauro <dmauro@google.com>: Workaround for MSAN being unable to see through getentropy(). https://github.com/google/sanitizers/issues/1173 PiperOrigin-RevId: 377097059 -- 8d28e921442d1b246c26f3200f21027557c47657 by Greg Falcon <gfalcon@google.com>: Disable stack_consumption_test in tsan builds. A recent tsan change broke the way this test-only utility was counting stack usage. PiperOrigin-RevId: 377053169 GitOrigin-RevId: b2a781121ff72fb485b7e67539d5e4ff1eb66df2 Change-Id: Ib56356f8128f6c083f32b950091f3a56d9e2cd51
Diffstat (limited to 'absl/random/internal/seed_material.cc')
-rw-r--r--absl/random/internal/seed_material.cc4
1 files changed, 4 insertions, 0 deletions
diff --git a/absl/random/internal/seed_material.cc b/absl/random/internal/seed_material.cc
index 0fcba509..7c1d9efa 100644
--- a/absl/random/internal/seed_material.cc
+++ b/absl/random/internal/seed_material.cc
@@ -28,6 +28,7 @@
#include <cstdlib>
#include <cstring>
+#include "absl/base/dynamic_annotations.h"
#include "absl/base/internal/raw_logging.h"
#include "absl/strings/ascii.h"
#include "absl/strings/escaping.h"
@@ -142,6 +143,9 @@ bool ReadSeedMaterialFromGetEntropy(absl::Span<uint32_t> values) {
if (result < 0) {
return false;
}
+ // https://github.com/google/sanitizers/issues/1173
+ // MemorySanitizer can't see through getentropy().
+ ABSL_ANNOTATE_MEMORY_IS_INITIALIZED(buffer, to_read);
buffer += to_read;
buffer_size -= to_read;
}