Skip to content

Commit cc943be

Browse files
zakharvoitmibrunin
authored andcommitted
[Backport] Security bug 1228036
Cherry-pick of patch originally reviewed on https://chromium-review.googlesource.com/c/v8/v8/+/3101487: [M90-LTS] [deoptimizer] Finish concurrent sweeping before overwriting ByteArrays (cherry picked from commit b63a59619530cb26bf5d51f39ef4cb4c20952d5f) Bug: chromium:1228036 No-Try: true No-Presubmit: true No-Tree-Checks: true Change-Id: I5abe7009920d2c8f81f024c9ae7bb6b13607da1a Commit-Queue: Georg Neis <[email protected]> Cr-Original-Commit-Position: refs/heads/master@{#75932} Commit-Queue: Zakhar Voit <[email protected]> Reviewed-by: Achuith Bhandarkar <[email protected]> Cr-Commit-Position: refs/branch-heads/9.0@{#75} Cr-Branched-From: bd0108b4c88e0d6f2350cb79b5f363fbd02f3eb7-refs/heads/9.0.257@{#1} Cr-Branched-From: 349bcc6a075411f1a7ce2d866c3dfeefc2efa39d-refs/heads/master@{#73001} Reviewed-by: Allan Sandfeld Jensen <[email protected]>
1 parent 19f9a2b commit cc943be

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

chromium/v8/src/deoptimizer/translated-state.cc

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -525,6 +525,12 @@ Handle<Object> TranslatedValue::GetValue() {
525525
// pass the verifier.
526526
container_->EnsureObjectAllocatedAt(this);
527527

528+
// Finish any sweeping so that it becomes safe to overwrite the ByteArray
529+
// headers.
530+
// TODO(hpayer): Find a cleaner way to support a group of
531+
// non-fully-initialized objects.
532+
isolate()->heap()->mark_compact_collector()->EnsureSweepingCompleted();
533+
528534
// 2. Initialize the objects. If we have allocated only byte arrays
529535
// for some objects, we now overwrite the byte arrays with the
530536
// correct object fields. Note that this phase does not allocate
@@ -1398,9 +1404,9 @@ TranslatedValue* TranslatedState::GetValueByObjectIndex(int object_index) {
13981404
}
13991405

14001406
Handle<HeapObject> TranslatedState::InitializeObjectAt(TranslatedValue* slot) {
1401-
slot = ResolveCapturedObject(slot);
1402-
14031407
DisallowGarbageCollection no_gc;
1408+
1409+
slot = ResolveCapturedObject(slot);
14041410
if (slot->materialization_state() != TranslatedValue::kFinished) {
14051411
std::stack<int> worklist;
14061412
worklist.push(slot->object_index());

0 commit comments

Comments
 (0)