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

Kostya Kortchinsky via llvm-commits llvm-commits at lists.llvm.org
Mon May 16 10:37:36 PDT 2016


cryptoad 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) {
----------------
filcab wrote:
> Did `std::atomic<unsigned __int128>` not work/was too slow?
It's in the works :)

================
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();
----------------
filcab wrote:
> Using `/dev/urandom` should be what you need, yes.
> Did you still have problems with urandom, btw?
/dev/udrandom appeared to work fine.


http://reviews.llvm.org/D20084





More information about the llvm-commits mailing list