summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Brachet <abrachet@google.com>2022-04-19 01:05:38 +0000
committerAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>2022-04-19 01:05:38 +0000
commit8efb27c704e4d0a84430e2559c7845346a1511e2 (patch)
tree88ac1f51173fc7d412e45ff0f937fb8970af4a7f
parent3a2b07a7d453e10b0741cd929928a5bb311675a5 (diff)
parentfecd9f13bad8ed3c40229d5c198f554458e18652 (diff)
downloadscudo-8efb27c704e4d0a84430e2559c7845346a1511e2.tar.gz
Revert "[Scudo] enabling anonymous named pages on Linux 5.17 and onwards." am: b35c52a7fd am: 9821445c26 am: fecd9f13bat_frc_odp_330442040t_frc_odp_330442000t_frc_ase_330444010android13-frc-odp-releaseandroid13-dev
Original change: https://android-review.googlesource.com/c/platform/external/scudo/+/2066959 Change-Id: I212180d6ab3953fb84ae9d354ea319e7dd8464e3 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
-rw-r--r--standalone/linux.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/standalone/linux.cpp b/standalone/linux.cpp
index 88875c54a34..c77c1bb600d 100644
--- a/standalone/linux.cpp
+++ b/standalone/linux.cpp
@@ -28,11 +28,11 @@
#include <time.h>
#include <unistd.h>
+#if SCUDO_ANDROID
#include <sys/prctl.h>
-// Definitions of prctl arguments to set a vma name in kernels (Linux from 5.17).
-#ifndef PR_SET_VMA
-#define PR_SET_VMA 0x53564d41
-#define PR_SET_VMA_ANON_NAME 0
+// Definitions of prctl arguments to set a vma name in Android kernels.
+#define ANDROID_PR_SET_VMA 0x53564d41
+#define ANDROID_PR_SET_VMA_ANON_NAME 0
#endif
namespace scudo {
@@ -66,8 +66,10 @@ void *map(void *Addr, uptr Size, UNUSED const char *Name, uptr Flags,
dieOnMapUnmapError(errno == ENOMEM ? Size : 0);
return nullptr;
}
+#if SCUDO_ANDROID
if (Name)
- prctl(PR_SET_VMA, PR_SET_VMA_ANON_NAME, P, Size, Name);
+ prctl(ANDROID_PR_SET_VMA, ANDROID_PR_SET_VMA_ANON_NAME, P, Size, Name);
+#endif
return P;
}