Merge the 2019-08-01 SPL branch from AOSP-Partner
* security-aosp-nyc-mr2-release:
Use conservative permissions when creating files in ART
Change-Id: Ifb9781b636a24bcfb2861051b7feef66f52ec404
diff --git a/runtime/os_linux.cc b/runtime/os_linux.cc
index f45e9f6..b628846 100644
--- a/runtime/os_linux.cc
+++ b/runtime/os_linux.cc
@@ -54,7 +54,7 @@
File* OS::OpenFileWithFlags(const char* name, int flags) {
CHECK(name != nullptr);
std::unique_ptr<File> file(new File);
- if (!file->Open(name, flags, 0666)) {
+ if (!file->Open(name, flags, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH)) {
return nullptr;
}
return file.release();