summaryrefslogtreecommitdiff
path: root/compiler/optimizing/graph_visualizer.cc
diff options
context:
space:
mode:
authorAlex Light <allight@google.com>2020-01-17 15:30:40 -0800
committerTreehugger Robot <treehugger-gerrit@google.com>2020-01-21 17:20:32 +0000
commitf6c69e53da3d1a065b6403573e3d5344944a2820 (patch)
treea37cc053c2e5c016680fc5f4a17488fffa5112e4 /compiler/optimizing/graph_visualizer.cc
parented1cecd996067d2cad66b297bd856de169a5fdbe (diff)
Fix race resulting in UAF in class-define-pausing
When we pause class redefinition we use a barrier to make sure that all threads properly exit the ClassDefinitionPauser code so we can destroy it without causing UAF. To do this we need to know how many threads are in ClassDefinitionPauser code. We previously incorrectly only counted threads after they had already suspended and acquired a mutex owned by the Pauser. This means that if the transformation thread managed to finish all work before the loading thread had made it past the mutex the thread would not be counted. This can easily lead to a UAF. To fix this we just need to move the count to before the thread-suspend and perform the release code with all threads suspended. This will ensure that all threads are counted. Bug: 147880227 Test: ./test.py --host Test: ./test/run-test --create-runner --host --prebuild --compact-dex-level fast --optimizing --no-relocate --runtime-option -Xcheck:jni --64 2001-virtual-structural-multithread tools/parallel_run.py Change-Id: I3e76ca29a504259270f8cec5574f5c07b27ed02f
Diffstat (limited to 'compiler/optimizing/graph_visualizer.cc')
0 files changed, 0 insertions, 0 deletions