[PATCH] D20084: [sanitizer] Initial implementation of a Hardened Allocator

Filipe Cabecinhas via llvm-commits llvm-commits at lists.llvm.org
Mon May 16 10:13:38 PDT 2016


filcab added inline comments.

================
Comment at: projects/compiler-rt/lib/hardened_allocator/scudo_allocator.cc:135
@@ +134,3 @@
+  // we are not being raced by a corruption occurring in another thread.
+  void compareExchangeHeader(UnpackedHeader *new_unpacked_header,
+                             UnpackedHeader *old_unpacked_header) {
----------------
Did `std::atomic<unsigned __int128>` not work/was too slow?

================
Comment at: projects/compiler-rt/lib/hardened_allocator/scudo_utils.cc:111
@@ +110,3 @@
+  std::hash<std::thread::id> hasher;
+  return getRdTSC() ^ hasher(std::this_thread::get_id()) ^
+      std::chrono::high_resolution_clock::now().time_since_epoch().count();
----------------
Using `/dev/urandom` should be what you need, yes.
Did you still have problems with urandom, btw?


http://reviews.llvm.org/D20084





More information about the llvm-commits mailing list