[compiler-rt] 78e70ce - [scudo] Remove false DCHECK
Vitaly Buka via llvm-commits
llvm-commits at lists.llvm.org
Thu Jul 1 12:06:38 PDT 2021
Author: Vitaly Buka
Date: 2021-07-01T12:06:33-07:00
New Revision: 78e70cee0d46bb14dcbedec993fbf855a4d13266
URL: https://github.com/llvm/llvm-project/commit/78e70cee0d46bb14dcbedec993fbf855a4d13266
DIFF: https://github.com/llvm/llvm-project/commit/78e70cee0d46bb14dcbedec993fbf855a4d13266.diff
LOG: [scudo] Remove false DCHECK
MTE Cache.store passes MAP_NOACCESS here.
Reviewed By: pcc, cryptoad
Differential Revision: https://reviews.llvm.org/D105266
Added:
Modified:
compiler-rt/lib/scudo/standalone/linux.cpp
compiler-rt/lib/scudo/standalone/tests/secondary_test.cpp
Removed:
################################################################################
diff --git a/compiler-rt/lib/scudo/standalone/linux.cpp b/compiler-rt/lib/scudo/standalone/linux.cpp
index dedab61631bc..c77c1bb600d9 100644
--- a/compiler-rt/lib/scudo/standalone/linux.cpp
+++ b/compiler-rt/lib/scudo/standalone/linux.cpp
@@ -58,11 +58,8 @@ void *map(void *Addr, uptr Size, UNUSED const char *Name, uptr Flags,
if (Flags & MAP_MEMTAG)
MmapProt |= PROT_MTE;
#endif
- if (Addr) {
- // Currently no scenario for a noaccess mapping with a fixed address.
- DCHECK_EQ(Flags & MAP_NOACCESS, 0);
+ if (Addr)
MmapFlags |= MAP_FIXED;
- }
void *P = mmap(Addr, Size, MmapProt, MmapFlags, -1, 0);
if (P == MAP_FAILED) {
if (!(Flags & MAP_ALLOWNOMEM) || errno != ENOMEM)
diff --git a/compiler-rt/lib/scudo/standalone/tests/secondary_test.cpp b/compiler-rt/lib/scudo/standalone/tests/secondary_test.cpp
index 6b8a60d386b8..d3b7c486f7c3 100644
--- a/compiler-rt/lib/scudo/standalone/tests/secondary_test.cpp
+++ b/compiler-rt/lib/scudo/standalone/tests/secondary_test.cpp
@@ -6,6 +6,7 @@
//
//===----------------------------------------------------------------------===//
+#include "memtag.h"
#include "tests/scudo_unit_test.h"
#include "allocator_config.h"
@@ -20,7 +21,11 @@
#include <vector>
template <typename Config> static scudo::Options getOptionsForConfig() {
- return {};
+ if (!Config::MaySupportMemoryTagging || !scudo::archSupportsMemoryTagging())
+ return {};
+ scudo::AtomicOptions AO;
+ AO.set(scudo::OptionBit::UseMemoryTagging);
+ return AO.load();
}
template <typename Config> static void testSecondaryBasic(void) {
More information about the llvm-commits
mailing list