reference, declarationdefinition
definition → references, declarations, derived classes, virtual overrides
reference to multiple definitions → definitions
unreferenced

References

projects/compiler-rt/lib/asan/asan_activation.cpp
  115   disabled.min_redzone = Max(16, (int)SHADOW_GRANULARITY);
projects/compiler-rt/lib/asan/asan_allocator.cpp
  147                  RoundUpTo(m->UsedSize(), SHADOW_GRANULARITY),
  305       uptr end_aligned_down = RoundDownTo(end, SHADOW_GRANULARITY);
  409     const uptr min_alignment = SHADOW_GRANULARITY;
  465     if (*(u8 *)MEM_TO_SHADOW((uptr)allocated) == 0 && CanPoisonMemory()) {
  512         RoundDownTo(size, SHADOW_GRANULARITY);
  520       *shadow = fl.poison_partial ? (size & (SHADOW_GRANULARITY - 1)) : 0;
  588                  RoundUpTo(m->UsedSize(), SHADOW_GRANULARITY),
projects/compiler-rt/lib/asan/asan_debugging.cpp
  143     *shadow_scale = SHADOW_SCALE;
projects/compiler-rt/lib/asan/asan_errors.cpp
  333   uptr granularity = SHADOW_GRANULARITY;
  412       if (*shadow_addr == 0 && access_size > SHADOW_GRANULARITY) shadow_addr++;
  503       (int)SHADOW_GRANULARITY);
  506   for (u8 i = 1; i < SHADOW_GRANULARITY; i++) PrintShadowByte(str, "", i, " ");
projects/compiler-rt/lib/asan/asan_fake_stack.cpp
   31   if (SHADOW_SCALE == 3 && class_id <= 6) {
  268   uptr PartialRzAligned = PartialRzAddr & ~(SHADOW_GRANULARITY - 1);
  271       PartialRzAligned, PartialRzAddr % SHADOW_GRANULARITY,
  280                (bottom - top) / SHADOW_GRANULARITY);
projects/compiler-rt/lib/asan/asan_flags.cpp
  148   if (f->redzone < (int)SHADOW_GRANULARITY)
  149     f->redzone = SHADOW_GRANULARITY;
projects/compiler-rt/lib/asan/asan_globals.cpp
   64   uptr aligned_size = RoundUpTo(g.size, SHADOW_GRANULARITY);
   69         g.beg + RoundDownTo(g.size, SHADOW_GRANULARITY),
   70         g.size % SHADOW_GRANULARITY,
   71         SHADOW_GRANULARITY,
projects/compiler-rt/lib/asan/asan_linux.cpp
  124   uptr shadow_size = RoundUpTo(kHighShadowEnd, granularity);
projects/compiler-rt/lib/asan/asan_mapping.h
  162     0x7FFFFFFF & (~0xFFFULL << kDefaultShadowScale);  // < 2G.
  181      (kMyriadMemorySize32 >> kDefaultShadowScale));
  314   return a >= kLowShadowBeg && a <= kLowShadowEnd;
  324   return kMidMemBeg && a >= kMidShadowBeg && a <= kMidShadowEnd;
  324   return kMidMemBeg && a >= kMidShadowBeg && a <= kMidShadowEnd;
  329   return kHighMemBeg && a >= kHighMemBeg && a <= kHighMemEnd;
  329   return kHighMemBeg && a >= kHighMemBeg && a <= kHighMemEnd;
  334   return kHighMemBeg && a >= kHighShadowBeg && a <= kHighShadowEnd;
  334   return kHighMemBeg && a >= kHighShadowBeg && a <= kHighShadowEnd;
  334   return kHighMemBeg && a >= kHighShadowBeg && a <= kHighShadowEnd;
  340     if (a <= kShadowGapEnd)
  341       return SHADOW_OFFSET == 0 || a >= kShadowGapBeg;
  342     return (a >= kShadowGap2Beg && a <= kShadowGap2End) ||
  343            (a >= kShadowGap3Beg && a <= kShadowGap3End);
  348     return a <= kShadowGapEnd;
  349   return a >= kShadowGapBeg && a <= kShadowGapEnd;
  349   return a >= kShadowGapBeg && a <= kShadowGapEnd;
  367   return MEM_TO_SHADOW(p);
  377   return (a & (SHADOW_GRANULARITY - 1)) == 0;
  385   u8 *shadow_address = (u8*)MEM_TO_SHADOW(a);
  388     u8 last_accessed_byte = (a & (SHADOW_GRANULARITY - 1))
projects/compiler-rt/lib/asan/asan_poisoning.cpp
   38   CHECK(AddrIsInMem(addr + size - SHADOW_GRANULARITY));
   60     offset = address & (SHADOW_GRANULARITY - 1);
   81   CHECK(IsAligned(end, SHADOW_GRANULARITY));
   82   if (!IsAligned(ptr, SHADOW_GRANULARITY)) {
   84         poison ? static_cast<u8>(ptr % SHADOW_GRANULARITY) : 0;
   85     ptr |= SHADOW_GRANULARITY - 1;
   88   for (; ptr < end; ptr += SHADOW_GRANULARITY)
  194   uptr aligned_b = RoundUpTo(beg, SHADOW_GRANULARITY);
  195   uptr aligned_e = RoundDownTo(end, SHADOW_GRANULARITY);
  269   uptr s = MEM_TO_SHADOW(p);
  277   uptr s = MEM_TO_SHADOW(reinterpret_cast<uptr>(p));
  299   uptr aligned_size = size & ~(SHADOW_GRANULARITY - 1);
  365   uptr granularity = SHADOW_GRANULARITY;
projects/compiler-rt/lib/asan/asan_poisoning.h
   46   uptr shadow_beg = MEM_TO_SHADOW(aligned_beg);
   47   uptr shadow_end = MEM_TO_SHADOW(
   48       aligned_beg + aligned_size - SHADOW_GRANULARITY) + 1;
   83   u8 *shadow = (u8*)MEM_TO_SHADOW(aligned_addr);
   84   for (uptr i = 0; i < redzone_size; i += SHADOW_GRANULARITY, shadow++) {
   85     if (i + SHADOW_GRANULARITY <= size) {
   88       *shadow = (SHADOW_GRANULARITY == 128) ? 0xff : value;  // unaddressable
projects/compiler-rt/lib/asan/asan_rtl.cpp
   56       UnmapOrDie((void*)kMidMemEnd, kHighShadowEnd - kMidMemEnd);
   58       if (kHighShadowEnd)
   59         UnmapOrDie((void*)kLowShadowBeg, kHighShadowEnd - kLowShadowBeg);
  322   kHighMemEnd |= SHADOW_GRANULARITY * GetMmapGranularity() - 1;
  324   CHECK_EQ((kHighMemBeg % GetMmapGranularity()), 0);
  329   if (kHighMemBeg) {
  331            (void*)kHighMemBeg, (void*)kHighMemEnd);
  333            (void*)kHighShadowBeg, (void*)kHighShadowEnd);
  333            (void*)kHighShadowBeg, (void*)kHighShadowEnd);
  337            (void*)kShadowGap3Beg, (void*)kShadowGap3End);
  341            (void*)kShadowGap2Beg, (void*)kShadowGap2End);
  343            (void*)kMidShadowBeg, (void*)kMidShadowEnd);
  343            (void*)kMidShadowBeg, (void*)kMidShadowEnd);
  346          (void*)kShadowGapBeg, (void*)kShadowGapEnd);
  346          (void*)kShadowGapBeg, (void*)kShadowGapEnd);
  349            (void*)kLowShadowBeg, (void*)kLowShadowEnd);
  354          (void*)MEM_TO_SHADOW(kLowShadowBeg),
  355          (void*)MEM_TO_SHADOW(kLowShadowEnd));
  355          (void*)MEM_TO_SHADOW(kLowShadowEnd));
  356   if (kHighMemBeg) {
  358            (void*)MEM_TO_SHADOW(kHighShadowBeg),
  358            (void*)MEM_TO_SHADOW(kHighShadowBeg),
  359            (void*)MEM_TO_SHADOW(kHighShadowEnd));
  359            (void*)MEM_TO_SHADOW(kHighShadowEnd));
  363            (void*)MEM_TO_SHADOW(kMidShadowBeg),
  363            (void*)MEM_TO_SHADOW(kMidShadowBeg),
  364            (void*)MEM_TO_SHADOW(kMidShadowEnd));
  364            (void*)MEM_TO_SHADOW(kMidShadowEnd));
  375   Printf("SHADOW_SCALE: %d\n", (int)SHADOW_SCALE);
  376   Printf("SHADOW_GRANULARITY: %d\n", (int)SHADOW_GRANULARITY);
  378   CHECK(SHADOW_SCALE >= 3 && SHADOW_SCALE <= 7);
  378   CHECK(SHADOW_SCALE >= 3 && SHADOW_SCALE <= 7);
  380     CHECK(kMidShadowBeg > kLowShadowEnd &&
  380     CHECK(kMidShadowBeg > kLowShadowEnd &&
  381           kMidMemBeg > kMidShadowEnd &&
  382           kHighShadowBeg > kMidMemEnd);
  448   SetLowLevelAllocateMinAlignment(SHADOW_GRANULARITY);
projects/compiler-rt/lib/asan/asan_shadow_setup.cpp
   47     uptr GapShadowBeg = RoundDownTo(MEM_TO_SHADOW(addr), GetPageSizeCached());
   49         RoundUpTo(MEM_TO_SHADOW(addr + size), GetPageSizeCached()) - 1;
  114         MemoryRangeIsAvailable(shadow_start, kHighShadowEnd);
  129       ReserveShadowMemoryRange(shadow_start, kLowShadowEnd, "low shadow");
  131     ReserveShadowMemoryRange(kHighShadowBeg, kHighShadowEnd, "high shadow");
  131     ReserveShadowMemoryRange(kHighShadowBeg, kHighShadowEnd, "high shadow");
  133     ProtectGap(kShadowGapBeg, kShadowGapEnd - kShadowGapBeg + 1);
  133     ProtectGap(kShadowGapBeg, kShadowGapEnd - kShadowGapBeg + 1);
  133     ProtectGap(kShadowGapBeg, kShadowGapEnd - kShadowGapBeg + 1);
  134     CHECK_EQ(kShadowGapEnd, kHighShadowBeg - 1);
  134     CHECK_EQ(kShadowGapEnd, kHighShadowBeg - 1);
  137              MemoryRangeIsAvailable(kMidMemEnd + 1, kHighShadowEnd)) {
  138     CHECK(kLowShadowBeg != kLowShadowEnd);
  140     ReserveShadowMemoryRange(shadow_start, kLowShadowEnd, "low shadow");
  142     ReserveShadowMemoryRange(kMidShadowBeg, kMidShadowEnd, "mid shadow");
  142     ReserveShadowMemoryRange(kMidShadowBeg, kMidShadowEnd, "mid shadow");
  144     ReserveShadowMemoryRange(kHighShadowBeg, kHighShadowEnd, "high shadow");
  144     ReserveShadowMemoryRange(kHighShadowBeg, kHighShadowEnd, "high shadow");
  146     ProtectGap(kShadowGapBeg, kShadowGapEnd - kShadowGapBeg + 1);
  146     ProtectGap(kShadowGapBeg, kShadowGapEnd - kShadowGapBeg + 1);
  146     ProtectGap(kShadowGapBeg, kShadowGapEnd - kShadowGapBeg + 1);
  147     ProtectGap(kShadowGap2Beg, kShadowGap2End - kShadowGap2Beg + 1);
  147     ProtectGap(kShadowGap2Beg, kShadowGap2End - kShadowGap2Beg + 1);
  148     ProtectGap(kShadowGap3Beg, kShadowGap3End - kShadowGap3Beg + 1);
  154            shadow_start, kHighShadowEnd);
projects/compiler-rt/lib/asan/asan_thread.cpp
  310     uptr tls_begin_aligned = RoundDownTo(tls_begin_, SHADOW_GRANULARITY);
  311     uptr tls_end_aligned = RoundUpTo(tls_end_, SHADOW_GRANULARITY);
  335   uptr mem_ptr = RoundDownTo(aligned_addr, SHADOW_GRANULARITY);
  342     mem_ptr -= SHADOW_GRANULARITY;
  348     mem_ptr -= SHADOW_GRANULARITY;
  355   uptr* ptr = (uptr*)(mem_ptr + SHADOW_GRANULARITY);