[compiler-rt] [msan] Detect dereferencing zero-alloc as use-of-uninitialized-value (PR #155944)

Thurston Dang via llvm-commits llvm-commits at lists.llvm.org
Sat Aug 30 00:07:39 PDT 2025


================
@@ -230,6 +230,12 @@ static void *MsanAllocate(BufferedStackTrace *stack, uptr size, uptr alignment,
       __msan_set_origin(allocated, size, o.raw_id());
     }
   }
+
+  uptr actually_allocated_size = allocator.GetActuallyAllocatedSize(allocated);
----------------
thurstond wrote:

> b. this patch is already "out of scope" (it's essentially OOB detection)

To be logically consistent with the position that MSan does not handle OOB, I've made a revert pull request for this patch: https://github.com/llvm/llvm-project/pull/156148

https://github.com/llvm/llvm-project/pull/155944


More information about the llvm-commits mailing list