projects
/
platform
/
upstream
/
llvm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
243ef9e
)
[msan] Release origin pages with shadow
author
Vitaly Buka
<vitalybuka@google.com>
Fri, 23 Jun 2023 00:05:02 +0000
(17:05 -0700)
committer
Vitaly Buka
<vitalybuka@google.com>
Fri, 23 Jun 2023 00:07:02 +0000
(17:07 -0700)
compiler-rt/lib/msan/msan_poisoning.cpp
patch
|
blob
|
history
diff --git
a/compiler-rt/lib/msan/msan_poisoning.cpp
b/compiler-rt/lib/msan/msan_poisoning.cpp
index
af01aa6
..
1889e98
100644
(file)
--- a/
compiler-rt/lib/msan/msan_poisoning.cpp
+++ b/
compiler-rt/lib/msan/msan_poisoning.cpp
@@
-216,6
+216,13
@@
void SetShadow(const void *ptr, uptr size, u8 value) {
}
if (!MmapFixedSuperNoReserve(page_beg, page_end - page_beg))
Die();
+
+ if (__msan_get_track_origins()) {
+ // No need to set origin for zero shadow, but we can release pages.
+ uptr origin_beg = RoundUpTo(MEM_TO_ORIGIN(ptr), PageSize);
+ if (!MmapFixedSuperNoReserve(origin_beg, page_end - page_beg))
+ Die();
+ }
}
}
}