summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorandroid-build-team Robot <android-build-team-robot@google.com>2017-04-21 20:42:33 +0000
committerandroid-build-team Robot <android-build-team-robot@google.com>2017-04-21 20:42:33 +0000
commit249368295b41c3f2bdb39c2f22c11543dd4e1fd7 (patch)
treea1bcb3bcb6850c0ea9cc4a29ada23b55acdd55e9
parenta8d5351650906abbc5b56cd1158e22d07592e1eb (diff)
parent633d76742782dc977d9642c044bca076348c140b (diff)
Merge cherrypicks of [2007123, 2089669, 2072002, 2094113, 1989895, 2094094, 2017568, 2054111, 2054025, 2074928, 2066476, 2092431, 2053944, 2095243, 2092549, 2065088, 2007730, 2008313, 2053983, 2025333, 2094716, 2026590, 2059276, 2089422, 2080090] into nyc-mr2-pixel-monthly-release
Change-Id: Id02cbf050d7962af08201906764ddc3509eea9a5
-rw-r--r--libcutils/sched_policy.c2
-rw-r--r--libziparchive/zip_archive.cc13
-rw-r--r--rootdir/init.rc9
3 files changed, 9 insertions, 15 deletions
diff --git a/libcutils/sched_policy.c b/libcutils/sched_policy.c
index 05a20481d..6d905898a 100644
--- a/libcutils/sched_policy.c
+++ b/libcutils/sched_policy.c
@@ -404,7 +404,7 @@ int set_sched_policy(int tid, SchedPolicy policy)
}
- if (add_tid_to_cgroup(tid, fd) != 0) {
+ if (fd > 0 && add_tid_to_cgroup(tid, fd) != 0) {
if (errno != ESRCH && errno != ENOENT)
return -errno;
}
diff --git a/libziparchive/zip_archive.cc b/libziparchive/zip_archive.cc
index 986ee7208..49097ce9b 100644
--- a/libziparchive/zip_archive.cc
+++ b/libziparchive/zip_archive.cc
@@ -386,6 +386,14 @@ static int32_t ParseZipArchive(ZipArchive* archive) {
const uint8_t* const cd_end = cd_ptr + cd_length;
const uint8_t* ptr = cd_ptr;
for (uint16_t i = 0; i < num_entries; i++) {
+ if (ptr > cd_end - sizeof(CentralDirectoryRecord)) {
+ ALOGW("Zip: ran off the end (at %" PRIu16 ")", i);
+#if defined(__ANDROID__)
+ android_errorWriteLog(0x534e4554, "36392138");
+#endif
+ return -1;
+ }
+
const CentralDirectoryRecord* cdr =
reinterpret_cast<const CentralDirectoryRecord*>(ptr);
if (cdr->record_signature != CentralDirectoryRecord::kSignature) {
@@ -393,11 +401,6 @@ static int32_t ParseZipArchive(ZipArchive* archive) {
return -1;
}
- if (ptr + sizeof(CentralDirectoryRecord) > cd_end) {
- ALOGW("Zip: ran off the end (at %" PRIu16 ")", i);
- return -1;
- }
-
const off64_t local_header_offset = cdr->local_file_header_offset;
if (local_header_offset >= archive->directory_offset) {
ALOGW("Zip: bad LFH offset %" PRId64 " at entry %" PRIu16,
diff --git a/rootdir/init.rc b/rootdir/init.rc
index df60f6582..7dc9e5509 100644
--- a/rootdir/init.rc
+++ b/rootdir/init.rc
@@ -145,15 +145,6 @@ on init
write /dev/cpuctl/cpu.rt_period_us 1000000
write /dev/cpuctl/cpu.rt_runtime_us 950000
- mkdir /dev/cpuctl/bg_non_interactive
- chown system system /dev/cpuctl/bg_non_interactive/tasks
- chmod 0666 /dev/cpuctl/bg_non_interactive/tasks
- # 5.0 %
- write /dev/cpuctl/bg_non_interactive/cpu.shares 52
- write /dev/cpuctl/bg_non_interactive/cpu.rt_period_us 1000000
- # active FIFO threads will never be in BG
- write /dev/cpuctl/bg_non_interactive/cpu.rt_runtime_us 10000
-
# sets up initial cpusets for ActivityManager
mkdir /dev/cpuset
mount cpuset none /dev/cpuset