summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2021-09-29 10:05:49 +0000
committerAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2021-09-29 10:05:49 +0000
commitef9f17438da68d49df52942add80c793c25e67ea (patch)
tree88a8d02ef488b6a17e3455da21a278cee01e9270
parent86e7047d3922aa7a9190560e7346733f21f1bfa7 (diff)
parent693713c9cad26e713478294ecb1377ba3a0e51f3 (diff)
Snap for 7776994 from 693713c9cad26e713478294ecb1377ba3a0e51f3 to s-keystone-qcom-release
Change-Id: Ib8c175570a419896714ed5090a10117c8f9e2ded
-rw-r--r--libartbase/base/memfd.h4
-rw-r--r--runtime/jit/jit.cc3
2 files changed, 6 insertions, 1 deletions
diff --git a/libartbase/base/memfd.h b/libartbase/base/memfd.h
index 0bb336d45a..3c27dcb9e3 100644
--- a/libartbase/base/memfd.h
+++ b/libartbase/base/memfd.h
@@ -53,6 +53,10 @@
# define F_SEAL_FUTURE_WRITE 0x0010
#endif
+#ifndef MFD_CLOEXEC
+# define MFD_CLOEXEC 0x0001U
+#endif
+
#ifndef MFD_ALLOW_SEALING
# define MFD_ALLOW_SEALING 0x0002U
#endif
diff --git a/runtime/jit/jit.cc b/runtime/jit/jit.cc
index 5ee88718dc..876e12091c 100644
--- a/runtime/jit/jit.cc
+++ b/runtime/jit/jit.cc
@@ -1238,7 +1238,8 @@ void Jit::CreateThreadPool() {
// Start with '/boot' and end with '.art' to match the pattern recognized
// by android_os_Debug.cpp for boot images.
const char* name = "/boot-image-methods.art";
- unique_fd mem_fd = unique_fd(art::memfd_create(name, /* flags= */ MFD_ALLOW_SEALING));
+ unique_fd mem_fd =
+ unique_fd(art::memfd_create(name, /* flags= */ MFD_ALLOW_SEALING | MFD_CLOEXEC));
if (mem_fd.get() == -1) {
PLOG(WARNING) << "Could not create boot image methods file descriptor";
return;