diff options
| author | 2021-08-23 17:41:57 +0800 | |
|---|---|---|
| committer | 2021-09-03 12:48:09 +0000 | |
| commit | fe2bf982759e4cffbfb527f54319e281ce6cfd77 (patch) | |
| tree | da4d1e3c8e4d67300b99a29dd5ac3b2decc59fb9 /runtime/jit/jit.cc | |
| parent | 8bc28c2d007a9066fae2ba6cf970df8ce2a342e8 (diff) | |
Fix android.security.cts.FileDescriptorTest#testCLOEXEC
When ART is mainline, it will create memFd boot-image-methods.art
without MFD_CLOEXEC.
Add MFD_CLOEXEC flag when create boot-image-methods.art memFd.
Bug: 197498527
Test: run cts CtsSecurityTestCases pass
Merged-In: If941c036f7adb598d67ec2b2c5bc4cb24994e3a1
(cherry picked from commit 3326fcea1ead5d5d360a053704faad27b6dd8c40)
Change-Id: Icfc2420e8e9d3f61f5e3f2eb5bfc53108c2c251b
(cherry picked from commit 0857789b5b09bccc977f712a071c7b68bfccae05)
Diffstat (limited to 'runtime/jit/jit.cc')
| -rw-r--r-- | runtime/jit/jit.cc | 3 |
1 files changed, 2 insertions, 1 deletions
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; |