[PATCH] D87739: [WIP] scudo: Add an API for disabling memory initialization per-thread.

Mitch Phillips via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 16 12:32:40 PDT 2020


hctim added inline comments.


================
Comment at: compiler-rt/lib/scudo/standalone/combined.h:496
     if (Options.DeallocTypeMismatch) {
-      if (Header.Origin != Origin) {
+      if (Header.OriginOrWasZeroed != Origin) {
         // With the exception of memalign'd chunks, that can be still be free'd.
----------------
pcc wrote:
> hctim wrote:
> > Isn't this now broken under `dealloc_type_mismatch` and MTE?
> No, because the field is intended to only have the "was zeroed" meaning while the chunk is not allocated. Note that the field is read before the call to `quarantineOrDeallocateChunk` later in this function causes it to take the "was zeroed" meaning.
I see - thanks for the clarification.  Maybe `OriginIfAliveOrWasZeroedIfDead`? A bit wordy (can't think of anything more concise right now), but otherwise it's a little hard to infer this which meaning applies at which time (especially given that `SizeOrUnusedBytes` has different semantics). Either that or a comment in the declaration explaining the semantics would probably suffice.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D87739/new/

https://reviews.llvm.org/D87739



More information about the llvm-commits mailing list