[PATCH] D93731: scudo: Support memory tagging in the secondary allocator.

Peter Collingbourne via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 8 16:33:52 PST 2021


pcc added inline comments.


================
Comment at: compiler-rt/lib/scudo/standalone/combined.h:833
   void disableMemoryTagging() {
-    if (allocatorSupportsMemoryTagging<Params>())
+    initThreadMaybe();
+    if (allocatorSupportsMemoryTagging<Params>()) {
----------------
hctim wrote:
> Yeah, this unfortunately means that some of the sizeclasses get mapped as PROT_MTE even when MTE is disabled. Maybe we should pull this change out of this patch and follow up separately, as it sounds like we might need to pull the MTE options out of the primary options bitset so it doesn't get clobbered at init-time.
> 
> ```
> $ adb shell process/with/no/mte
> $ adb shell cat /proc/<pid>/smaps | egrep 'VmFlags.*mt' -B23
> 7ca588f000-7ca58cf000 rw-p 00000000 00:00 0                              [anon:scudo:primary]
> VmFlags: rd wr mr mw me ac mt
> 7cd588c000-7cd58cc000 rw-p 00000000 00:00 0                              [anon:scudo:primary]
> VmFlags: rd wr mr mw me ac mt
> ```
Pulling this change out of the patch would lead to MTE never being disabled (from the allocator's perspective), and consequent crashes due to an incorrect include mask. I'll see what can be done about these mappings.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D93731



More information about the llvm-commits mailing list