Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[scudo] Use the releaseAndZeroPagesToOS function. #71256

Merged
merged 1 commit into from
Nov 6, 2023

Conversation

cferris1000
Copy link
Contributor

All of the code assumes that when the pages are released, the entry is zero'd, so use the correct function. On most systems, this does not change anything.

All of the code assumes that when the pages are released, the entry
is zero'd, so use the correct function. On most systems, this does
not change anything.
@llvmbot
Copy link
Member

llvmbot commented Nov 4, 2023

@llvm/pr-subscribers-compiler-rt-sanitizer

Author: Christopher Ferris (cferris1000)

Changes

All of the code assumes that when the pages are released, the entry is zero'd, so use the correct function. On most systems, this does not change anything.


Full diff: https://github.com/llvm/llvm-project/pull/71256.diff

1 Files Affected:

  • (modified) compiler-rt/lib/scudo/standalone/secondary.h (+2-2)
diff --git a/compiler-rt/lib/scudo/standalone/secondary.h b/compiler-rt/lib/scudo/standalone/secondary.h
index c89e6a95f5a68a4..8dc4c87fa7c6e99 100644
--- a/compiler-rt/lib/scudo/standalone/secondary.h
+++ b/compiler-rt/lib/scudo/standalone/secondary.h
@@ -223,7 +223,7 @@ template <typename Config> class MapAllocatorCache {
                                          MAP_NOACCESS);
       }
     } else if (Interval == 0) {
-      Entry.MemMap.releasePagesToOS(Entry.CommitBase, Entry.CommitSize);
+      Entry.MemMap.releaseAndZeroPagesToOS(Entry.CommitBase, Entry.CommitSize);
       Entry.Time = 0;
     }
     do {
@@ -441,7 +441,7 @@ template <typename Config> class MapAllocatorCache {
         OldestTime = Entry.Time;
       return;
     }
-    Entry.MemMap.releasePagesToOS(Entry.CommitBase, Entry.CommitSize);
+    Entry.MemMap.releaseAndZeroPagesToOS(Entry.CommitBase, Entry.CommitSize);
     Entry.Time = 0;
   }
 

@cferris1000 cferris1000 merged commit e15fcd7 into llvm:main Nov 6, 2023
5 checks passed
@cferris1000 cferris1000 deleted the release_zero branch November 6, 2023 21:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants