Skip to content

Commit 2419957

Browse files
Jana Grillmibrunin
Jana Grill
authored andcommitted
[Backport] CVE-2021-21206: Use after free in Blink
Cherry-pick of patch originally reviewed on https://chromium-review.googlesource.com/c/chromium/src/+/2821879: Forbid script execution while updating the paint lifecycle. (cherry picked from commit 5425d3b100fab533ea9ddc2ed8fbfc4870db0587) Bug: 1196781 Change-Id: Idc8d24792d5c413691977b09ca821de4e13887ad Commit-Queue: Adrian Taylor <[email protected]> Commit-Queue: Robert Flack <[email protected]> Reviewed-by: Xianzhu Wang <[email protected]> Cr-Original-Commit-Position: refs/heads/master@{#870275} Reviewed-by: Robert Flack <[email protected]> Reviewed-by: Achuith Bhandarkar <[email protected]> Reviewed-by: Victor-Gabriel Savu <[email protected]> Commit-Queue: Jana Grill <[email protected]> Cr-Commit-Position: refs/branch-heads/4240@{#1601} Cr-Branched-From: f297677702651916bbf65e59c0d4bbd4ce57d1ee-refs/heads/master@{#800218} Reviewed-by: Allan Sandfeld Jensen <[email protected]>
1 parent b09d379 commit 2419957

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

chromium/third_party/blink/renderer/core/frame/local_frame_view.cc

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2766,11 +2766,14 @@ void LocalFrameView::RunPaintLifecyclePhase() {
27662766
for (PaintLayerScrollableArea* area : *animating_scrollable_areas)
27672767
area->UpdateCompositorScrollAnimations();
27682768
}
2769-
frame_view.GetLayoutView()
2770-
->GetDocument()
2771-
.GetDocumentAnimations()
2772-
.UpdateAnimations(DocumentLifecycle::kPaintClean,
2773-
paint_artifact_compositor_.get());
2769+
{
2770+
ScriptForbiddenScope forbid_script;
2771+
frame_view.GetLayoutView()
2772+
->GetDocument()
2773+
.GetDocumentAnimations()
2774+
.UpdateAnimations(DocumentLifecycle::kPaintClean,
2775+
paint_artifact_compositor_.get());
2776+
}
27742777
});
27752778

27762779
// Initialize animation properties in the newly created paint property

0 commit comments

Comments
 (0)