Commit 80e82a8
[Backport] CVE-2024-11116: Inappropriate implementation in Paint
Manual backport of patch originally reviewed on
https://chromium-review.googlesource.com/c/chromium/src/+/5894513:
Reapply "[PH] Disable cross origin paint holding if there was no user activation."
This reverts commit 011f2568aab9a77614d10ad913a18a825ea7d6bb.
Original patch description:
This patch disables paint holding if this is a cross origin navigation
and there was no user activation. This is a safety measure to prevent
sites from continually displaying mismatched URL and content.
With regular user behavior (clicks, etc), the behavior should be
unchanged since this counts as user activation.
Difference from original CL:
The difference is that we post a task to timeout paintholding, which allows embedding to differ and happen further down in the stack.
Details:
The surface eviction happens in this stack
content::DelegatedFrameHost::ResetFallbackToFirstNavigationSurface()
content::RenderWidgetHostImpl::ClearDisplayedGraphics()
content::RenderWidgetHostImpl::ForceFirstFrameAfterNavigationTimeout()
content::RenderFrameHostManager::CommitPendingIfNecessary()
content::RenderFrameHostManager::DidNavigateFrame()
content::Navigator::DidNavigate()
There is a bifurcation in ResetFallbackToFirstNavigationSurface to
decide whether to evict the delegated frame. This decision is based
on whether we have an first local surface id after navigation. On
non-Mac system, this local surface id is set in a stack similar to
the one below:
content::DelegatedFrameHost::EmbedSurface()
content::RenderWidgetHostViewAura::SynchronizeVisualProperties()
content::RenderWidgetHostViewAura::ShowWithVisibility()
content::RenderFrameHostManager::CommitPendingIfNecessary()
content::RenderFrameHostManager::DidNavigateFrame()
content::Navigator::DidNavigate()
Importantly, this happens _before_ we reset fallback, so in typical
cases we avoid eviction of the frame and simply reset its surface.
On Mac, the stack that sets the frame is below:
content::DelegatedFrameHost::EmbedSurface()
content::BrowserCompositorMac::DidNavigate()
content::RenderWidgetHostImpl::DidNavigate()
content::RenderFrameHostImpl::DidCommitNavigation()
...
content::mojom::NavigationClient_CommitNavigation_ForwardToCallback
This call happens _after_ we reset the fallback, so in typical cases
we evict the frame before embedding a new one. This is a cause for
a lot of test failures (and ultimately the reason for the revert).
Because the reset fallback path never happened synchronously with
DidNavigate, it isn't clear at this time whether this poses a problem
in non-test cases. Out of abundance of caution, I propose posting a
(non-delayed) task to remove paint holding. In practice this means
potentially having paintholding in place while the UI thread is busy.
This, however, is still a mitigation for the initial bug, albeit one
that does not have strict guarantees.
R=creis@chromium.org
Bug: 40942531
Change-Id: Id45d1e2267147da2a6f4351cb95d3d8002d8f7ae
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5894513
Reviewed-by: Charlie Reis <creis@chromium.org>
Commit-Queue: Vladimir Levin <vmpstr@chromium.org>
Reviewed-by: Nate Fischer <ntfschr@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1363640}
Reviewed-on: https://codereview.qt-project.org/c/qt/qtwebengine-chromium/+/604272
Reviewed-by: Michal Klocek <michal.klocek@qt.io>
Reviewed-on: https://codereview.qt-project.org/c/qt/qtwebengine-chromium/+/607613
Reviewed-by: Anu Aliyas <anu.aliyas@qt.io>1 parent def42ea commit 80e82a8
File tree
8 files changed
+93
-29
lines changed- chromium/content
- browser/renderer_host
- common
- public/browser
8 files changed
+93
-29
lines changedLines changed: 4 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
503 | 503 | | |
504 | 504 | | |
505 | 505 | | |
506 | | - | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
507 | 510 | | |
508 | 511 | | |
509 | 512 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
| 35 | + | |
35 | 36 | | |
36 | 37 | | |
37 | 38 | | |
| |||
516 | 517 | | |
517 | 518 | | |
518 | 519 | | |
519 | | - | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
| 537 | + | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
| 541 | + | |
| 542 | + | |
| 543 | + | |
| 544 | + | |
| 545 | + | |
| 546 | + | |
| 547 | + | |
| 548 | + | |
| 549 | + | |
| 550 | + | |
| 551 | + | |
520 | 552 | | |
521 | 553 | | |
522 | 554 | | |
| |||
525 | 557 | | |
526 | 558 | | |
527 | 559 | | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
528 | 564 | | |
529 | 565 | | |
530 | 566 | | |
531 | 567 | | |
532 | 568 | | |
533 | | - | |
534 | | - | |
| 569 | + | |
535 | 570 | | |
536 | 571 | | |
537 | 572 | | |
| |||
598 | 633 | | |
599 | 634 | | |
600 | 635 | | |
601 | | - | |
602 | | - | |
603 | | - | |
604 | | - | |
605 | | - | |
606 | | - | |
607 | 636 | | |
608 | 637 | | |
609 | 638 | | |
| |||
Lines changed: 32 additions & 14 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
732 | 732 | | |
733 | 733 | | |
734 | 734 | | |
735 | | - | |
| 735 | + | |
736 | 736 | | |
737 | 737 | | |
738 | | - | |
| 738 | + | |
739 | 739 | | |
740 | 740 | | |
741 | 741 | | |
| |||
772 | 772 | | |
773 | 773 | | |
774 | 774 | | |
775 | | - | |
| 775 | + | |
776 | 776 | | |
777 | 777 | | |
778 | 778 | | |
| |||
787 | 787 | | |
788 | 788 | | |
789 | 789 | | |
790 | | - | |
| 790 | + | |
791 | 791 | | |
792 | 792 | | |
793 | 793 | | |
| |||
844 | 844 | | |
845 | 845 | | |
846 | 846 | | |
847 | | - | |
848 | | - | |
849 | | - | |
| 847 | + | |
| 848 | + | |
| 849 | + | |
| 850 | + | |
| 851 | + | |
| 852 | + | |
| 853 | + | |
| 854 | + | |
| 855 | + | |
| 856 | + | |
| 857 | + | |
| 858 | + | |
| 859 | + | |
| 860 | + | |
| 861 | + | |
| 862 | + | |
| 863 | + | |
| 864 | + | |
| 865 | + | |
| 866 | + | |
850 | 867 | | |
851 | 868 | | |
852 | 869 | | |
| |||
1471 | 1488 | | |
1472 | 1489 | | |
1473 | 1490 | | |
1474 | | - | |
| 1491 | + | |
1475 | 1492 | | |
1476 | 1493 | | |
1477 | 1494 | | |
| |||
4346 | 4363 | | |
4347 | 4364 | | |
4348 | 4365 | | |
4349 | | - | |
| 4366 | + | |
4350 | 4367 | | |
4351 | 4368 | | |
4352 | 4369 | | |
| |||
4599 | 4616 | | |
4600 | 4617 | | |
4601 | 4618 | | |
4602 | | - | |
4603 | | - | |
4604 | | - | |
| 4619 | + | |
| 4620 | + | |
| 4621 | + | |
| 4622 | + | |
4605 | 4623 | | |
4606 | 4624 | | |
4607 | 4625 | | |
| |||
4736 | 4754 | | |
4737 | 4755 | | |
4738 | 4756 | | |
4739 | | - | |
| 4757 | + | |
4740 | 4758 | | |
4741 | 4759 | | |
4742 | 4760 | | |
| |||
5145 | 5163 | | |
5146 | 5164 | | |
5147 | 5165 | | |
5148 | | - | |
| 5166 | + | |
5149 | 5167 | | |
5150 | 5168 | | |
5151 | 5169 | | |
| |||
Lines changed: 4 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
323 | 323 | | |
324 | 324 | | |
325 | 325 | | |
326 | | - | |
| 326 | + | |
327 | 327 | | |
328 | 328 | | |
329 | 329 | | |
| |||
972 | 972 | | |
973 | 973 | | |
974 | 974 | | |
975 | | - | |
976 | | - | |
| 975 | + | |
977 | 976 | | |
978 | 977 | | |
979 | 978 | | |
980 | | - | |
| 979 | + | |
981 | 980 | | |
982 | 981 | | |
983 | 982 | | |
984 | 983 | | |
985 | 984 | | |
986 | 985 | | |
987 | | - | |
| 986 | + | |
988 | 987 | | |
989 | 988 | | |
990 | 989 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
62 | 67 | | |
63 | 68 | | |
64 | 69 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
72 | 72 | | |
73 | 73 | | |
74 | 74 | | |
| 75 | + | |
| 76 | + | |
75 | 77 | | |
76 | 78 | | |
77 | 79 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1593 | 1593 | | |
1594 | 1594 | | |
1595 | 1595 | | |
| 1596 | + | |
| 1597 | + | |
| 1598 | + | |
| 1599 | + | |
1596 | 1600 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2619 | 2619 | | |
2620 | 2620 | | |
2621 | 2621 | | |
| 2622 | + | |
| 2623 | + | |
| 2624 | + | |
| 2625 | + | |
2622 | 2626 | | |
2623 | 2627 | | |
2624 | 2628 | | |
| |||
0 commit comments