⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 287867 in webkit


Ignore:
Timestamp:
Jan 10, 2022, 7:21:20 PM (5 years ago)
Author:
Alan Bujtas
Message:

null ptr deref in WebCore::LayoutIntegration::LineLayout::collectOverflow()
https://bugs.webkit.org/show_bug.cgi?id=234654
<rdar://problem/86571571>

Reviewed by Antti Koivisto.

Source/WebCore:

needsLayout() check in invalidateLineLayoutPath is insufficient for modern line layout.

m_lineLayout = std::monostate() does not only destroy the line layout object but it also nukes all the IFC geometries.
It is equivalent to having all the child boxes dirty, since in order to re-generate the geometry information,
we have to layout _all_ the boxes (note that nuking the legacy line layout object does not destroy the inline tree).
The bug here is that needsLayout() returns true for cases (e.g. posChildNeedsLayout) when
while the geometry is all gone, we are going to take a special layout codepath which expects pre-computed geometries.

Test: fast/block/line-layout/line-layout-collect-overflow-crash.html

  • rendering/RenderBlockFlow.cpp:

(WebCore::RenderBlockFlow::invalidateLineLayoutPath):

LayoutTests:

  • fast/block/line-layout/line-layout-collect-overflow-crash-expected.txt: Added.
  • fast/block/line-layout/line-layout-collect-overflow-crash.html: Added.
Location:
trunk
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r287866 r287867  
     12022-01-10  Alan Bujtas  <zalan@apple.com>
     2
     3        null ptr deref in WebCore::LayoutIntegration::LineLayout::collectOverflow()
     4        https://bugs.webkit.org/show_bug.cgi?id=234654
     5        <rdar://problem/86571571>
     6
     7        Reviewed by Antti Koivisto.
     8
     9        * fast/block/line-layout/line-layout-collect-overflow-crash-expected.txt: Added.
     10        * fast/block/line-layout/line-layout-collect-overflow-crash.html: Added.
     11
    1122022-01-10  Wenson Hsieh  <wenson_hsieh@apple.com>
    213
  • trunk/Source/WebCore/ChangeLog

    r287866 r287867  
     12022-01-10  Alan Bujtas  <zalan@apple.com>
     2
     3        null ptr deref in WebCore::LayoutIntegration::LineLayout::collectOverflow()
     4        https://bugs.webkit.org/show_bug.cgi?id=234654
     5        <rdar://problem/86571571>
     6
     7        Reviewed by Antti Koivisto.
     8
     9        needsLayout() check in invalidateLineLayoutPath is insufficient for modern line layout.
     10
     11        m_lineLayout = std::monostate() does not only destroy the line layout object but it also nukes all the IFC geometries.
     12        It is equivalent to having all the child boxes dirty, since in order to re-generate the geometry information,
     13        we have to layout _all_ the boxes (note that nuking the legacy line layout object does not destroy the inline tree).
     14        The bug here is that needsLayout() returns true for cases (e.g. posChildNeedsLayout) when
     15        while the geometry is all gone, we are going to take a special layout codepath which expects pre-computed geometries.
     16
     17        Test: fast/block/line-layout/line-layout-collect-overflow-crash.html
     18
     19        * rendering/RenderBlockFlow.cpp:
     20        (WebCore::RenderBlockFlow::invalidateLineLayoutPath):
     21
    1222022-01-10  Wenson Hsieh  <wenson_hsieh@apple.com>
    223
  • trunk/Source/WebCore/rendering/RenderBlockFlow.cpp

    r287771 r287867  
    35633563        m_lineLayout = std::monostate();
    35643564        setLineLayoutPath(path);
    3565         if (needsLayout())
     3565        if (selfNeedsLayout() || normalChildNeedsLayout())
    35663566            return;
    35673567        // FIXME: We should just kick off a subtree layout here (if needed at all) see webkit.org/b/172947.
Note: See TracChangeset for help on using the changeset viewer.