[scudo] Remove false DCHECK

MTE Cache.store passes MAP_NOACCESS here.

Reviewed By: pcc, cryptoad

Differential Revision: https://reviews.llvm.org/D105266
This commit is contained in:
Vitaly Buka 2021-06-30 23:39:12 -07:00
parent fe08e9c487
commit 78e70cee0d
2 changed files with 7 additions and 5 deletions

View File

@ -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)

View File

@ -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) {