Skip to content

Commit

Permalink
ResStringPool: Prevenet boot loop from se fix
Browse files Browse the repository at this point in the history
Changes the logs adding in a previous security fix to warnings so
devices with malformed APKs currently on them will not undergo DOS when
they are upgraded to P.

Bug: 79724567
Test: run cts -m CtsAppSecurityHostTestCases \
          -t android.appsecurity.cts.CorruptApkTests

Change-Id: Ied54e4bb14abdaf79da562022c7ea6075187c1f8
(cherry picked from commit f05f47b)
(cherry picked from commit c31cf80)
  • Loading branch information
RyanMitch16 authored and Klozz committed Nov 20, 2018
1 parent ea47de4 commit 0511fd8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions libs/androidfw/ResourceTypes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -460,7 +460,7 @@ status_t ResStringPool::setTo(const void* data, size_t size, bool copyData)

// The chunk must be at least the size of the string pool header.
if (size < sizeof(ResStringPool_header)) {
LOG_ALWAYS_FATAL("Bad string block: data size %zu is too small to be a string block", size);
ALOGW("Bad string block: data size %zu is too small to be a string block", size);
return (mError=BAD_TYPE);
}

Expand All @@ -470,7 +470,7 @@ status_t ResStringPool::setTo(const void* data, size_t size, bool copyData)
if (validate_chunk(reinterpret_cast<const ResChunk_header*>(data), sizeof(ResStringPool_header),
reinterpret_cast<const uint8_t*>(data) + size,
"ResStringPool_header") != NO_ERROR) {
LOG_ALWAYS_FATAL("Bad string block: malformed block dimensions");
ALOGW("Bad string block: malformed block dimensions");
return (mError=BAD_TYPE);
}

Expand Down

0 comments on commit 0511fd8

Please sign in to comment.