summaryrefslogtreecommitdiff
path: root/compiler/optimizing/optimizing_compiler.cc
diff options
context:
space:
mode:
author Jiakai Zhang <jiakaiz@google.com> 2025-03-03 09:00:14 -0800
committer Treehugger Robot <android-test-infra-autosubmit@system.gserviceaccount.com> 2025-03-03 10:48:30 -0800
commite29eb53ebf11fdb891762db7dd927e95a0858fc0 (patch)
tree5573cb41c947e31762a1d67814d9e86946ffe02c /compiler/optimizing/optimizing_compiler.cc
parent6cb16360db97fa95e47830c04e209f05aef24623 (diff)
Ensure the dex use database cannot grow unboundedly.
Its size can theoretically be O(<owning package> X <dex path> X <loading package>) Owning and loading packages are limited by the valid entries in the package database. Dex paths from primary dex'es are also limited by the installed packages. However dex paths for secondary dex'es can potentially be unbounded, so impose a limit on them. The limit is fixed for any given owning package, which is simpler than limiting based on loading package. That restricts a package from adding an arbitrary number of secondary dex files in itself. Also check that the dex file exists if the loading package is different from the owning one, so that the former cannot consume entries up to the limit for the latter. The class loader context strings for secondary dex files are also not guaranteed bounded, so impose a limit on them as well. Test: atest DexUseManagerTest Test: Install app_debug.apk from b/391895923#comment3 and verify that it can run until OOM repeatedly without growing the database to more than 650 KiB. Bug: 391895923 Flag: EXEMPT bugfix Ignore-AOSP-First: Security fix Change-Id: Ic50bf22000730282d90a4f6aa1c49379357fe77a
Diffstat (limited to 'compiler/optimizing/optimizing_compiler.cc')
0 files changed, 0 insertions, 0 deletions