Android-x86
Fork
Faire un don

  • R/O
  • HTTP
  • SSH
  • HTTPS

frameworks-base: Commit

frameworks/base


Commit MetaInfo

Révision906afb4f3641963583a4334bd8291d479b8c844a (tree)
l'heure2018-08-11 05:28:02
AuteurRyan Mitchell <rtmitchell@goog...>
Commiterandroid-build-team Robot

Message de Log

Fix DynamicRefTable::load security bug

DynamicRefTables parsed from apks are missing bounds checks that prevent
buffer overflows. This changes verifies the bounds of the header before
attempting to preform operations on the chunk.

Bug: 79488511
Test: run cts -m CtsAppSecurityHostTestCases \

-t android.appsecurity.cts.CorruptApkTests

Change-Id: I02c8ad957da244fce777ac68a482e4e8fa70f846
Merged-In: I02c8ad957da244fce777ac68a482e4e8fa70f846
(cherry picked from commit 18a6ada4aa136da4f50f03fff91d61d448ced195)

Change Summary

Modification

--- a/libs/androidfw/ResourceTypes.cpp
+++ b/libs/androidfw/ResourceTypes.cpp
@@ -6576,8 +6576,16 @@ status_t ResTable::parsePackage(const ResTable_package* const pkg,
65766576 }
65776577
65786578 } else if (ctype == RES_TABLE_LIBRARY_TYPE) {
6579+
65796580 if (group->dynamicRefTable.entries().size() == 0) {
6580- status_t err = group->dynamicRefTable.load((const ResTable_lib_header*) chunk);
6581+ const ResTable_lib_header* lib = (const ResTable_lib_header*) chunk;
6582+ status_t err = validate_chunk(&lib->header, sizeof(*lib),
6583+ endPos, "ResTable_lib_header");
6584+ if (err != NO_ERROR) {
6585+ return (mError=err);
6586+ }
6587+
6588+ err = group->dynamicRefTable.load(lib);
65816589 if (err != NO_ERROR) {
65826590 return (mError=err);
65836591 }
Afficher sur ancien navigateur de dépôt.