summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorandroid-build-team Robot <android-build-team-robot@google.com>2017-04-21 17:29:29 +0000
committerandroid-build-team Robot <android-build-team-robot@google.com>2017-04-21 17:29:29 +0000
commita8d5351650906abbc5b56cd1158e22d07592e1eb (patch)
tree6b6d4e943b45ff7e8d4ffa58e24f638016b7ae05
parenta0c58d5ebd816658792e3625f4561e8b4c95a258 (diff)
parentc35a128f0b6ff7882d0606f869cd5628846d084c (diff)
release-request-762540b1-1728-41bc-a9ce-e977f3e2683f-for-git_nyc-mr2-pixel-monthly-release-3888830 snap-temp-L22300000056915770
Change-Id: If660b2507ebb0fdf5657c3f9f4ae65e286bd87fe
-rw-r--r--libcutils/sched_policy.c2
-rw-r--r--libziparchive/zip_archive.cc13
-rw-r--r--rootdir/init.rc9
3 files changed, 15 insertions, 9 deletions
diff --git a/libcutils/sched_policy.c b/libcutils/sched_policy.c
index 6d905898a..05a20481d 100644
--- a/libcutils/sched_policy.c
+++ b/libcutils/sched_policy.c
@@ -404,7 +404,7 @@ int set_sched_policy(int tid, SchedPolicy policy)
}
- if (fd > 0 && add_tid_to_cgroup(tid, fd) != 0) {
+ if (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 49097ce9b..986ee7208 100644
--- a/libziparchive/zip_archive.cc
+++ b/libziparchive/zip_archive.cc
@@ -386,14 +386,6 @@ 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) {
@@ -401,6 +393,11 @@ 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 7dc9e5509..df60f6582 100644
--- a/rootdir/init.rc
+++ b/rootdir/init.rc
@@ -145,6 +145,15 @@ 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