New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 855905 link

Starred by 1 user

Issue metadata

Status: Duplicate
Merged: issue 855026
Owner:
Closed: Jun 2018
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Windows
Pri: 1
Type: Bug



Sign in to add a comment

Null-dereference READ in blink::LayoutTextFragment::GetFirstLetterPart

Project Member Reported by ClusterFuzz, Jun 24 2018

Issue description

Detailed report: https://clusterfuzz.com/testcase?key=4759551849791488

Fuzzer: marty_html_twiddler
Job Type: windows_asan_chrome_no_sandbox
Platform Id: windows

Crash Type: Null-dereference READ
Crash Address: 0x000000000010
Crash State:
  blink::LayoutTextFragment::GetFirstLetterPart
  blink::AssociatedLayoutObjectOf
  blink::FirstLetterPartFor
  
Sanitizer: address (ASAN)

Regressed: https://clusterfuzz.com/revisions?job=windows_asan_chrome_no_sandbox&range=569233:569235

Reproducer Testcase: https://clusterfuzz.com/download?testcase_id=4759551849791488

Issue filed automatically.

See https://github.com/google/clusterfuzz-tools for more information.
 
Project Member

Comment 1 by ClusterFuzz, Jun 24 2018

Labels: Test-Predator-Auto-Owner
Owner: yosin@chromium.org
Status: Assigned (was: Untriaged)
Automatically assigning owner based on suspected regression changelist https://chromium.googlesource.com/chromium/src/+/5c9711672411542ead18a35c95dec6a48947f077 ([LayoutNG] Adapt accessibility module to LayoutNG).

If this is incorrect, please let us know why and apply the Test-Predator-Wrong-CLs label. If you aren't the correct owner for this issue, please unassign yourself as soon as possible so it can be re-triaged.
Project Member

Comment 2 by ClusterFuzz, Jun 24 2018

Components: Blink>Editing Blink>Layout
Labels: Test-Predator-Auto-Components
Automatically applying components based on crash stacktrace and information from OWNERS files.

If this is incorrect, please apply the Test-Predator-Wrong-Components label.

Comment 3 by yosin@chromium.org, Jun 25 2018

Components: -Blink>Layout -Blink>Editing Blink>Editing>Selection
Owner: yoichio@chromium.org
yoichio@, could you take look?
It seems ResetOldSelectedLayoutObjects() uses LayoutObject being removed.
In below sample, it is LayoutTextFragment associated to Text node "def".
LayoutTextFragment::first_letter_pseudo_element_ is null

# Minimal HTML to reproduce
<!doctype html>
<style>
.c14::first-letter { font-weight: bold; }
</style>
<body>
<p>abc</p><p id="sample" class="c14">def</p>
<script>
const sample = document.getElementById('sample');
document.execCommand('SelectAll');
let counter = 0;
setTimeout(() => {
  if (++counter != 1)
    return;
  // Invoke LayoutSelection::ClearSelection() after reload.
  window.location.reload();
  sample.textContent = '';
}, 0);
</script>
</body>


# Stack trace
Node::GetFlag(blink::Node::NodeFlags mask) Line 906
Node::HasRareData() Line 951
Node::GetLayoutObject() Line 625
LayoutTextFragment::GetFirstLetterPart() Line 168
AssociatedLayoutObjectOf(const blink::Node & node, int offset_in_node, blink::LayoutObjectSide object_side) Line 4033
FirstLetterPartFor(const blink::LayoutObject * layout_object) Line 85
NextLayoutObjectOnFlatTree(const blink::LayoutObject & layout_object) Line 108
SelectionPaintRange::Iterator::operator++() Line 131
ResetOldSelectedLayoutObjects(const blink::SelectionPaintRange & old_range) Line 399
LayoutSelection::ClearSelection() Line 431
FrameSelection::ClearLayoutSelection() Line 1229
LayoutView::ClearSelection() Line 593
LayoutObjectChildList::RemoveChildNode(blink::LayoutObject * owner, blink::LayoutObject * old_child, bool notify_layout_object) Line 111
LayoutObject::RemoveChild(blink::LayoutObject * old_child) Line 392
LayoutBlockFlow::RemoveChild(blink::LayoutObject * old_child) Line 3248
LayoutObject::Remove() Line 1626
LayoutObject::WillBeDestroyed() Line 3042
LayoutText::WillBeDestroyed() Line 213
LayoutTextFragment::WillBeDestroyed() Line 76
LayoutObject::Destroy() Line 3314
LayoutObject::DestroyAndCleanupAnonymousWrappers() Line 3310
Node::DetachLayoutTree(const blink::Node::AttachContext & context) Line 1123
ContainerNode::RemoveBetween(blink::Node * previous_child, blink::Node * next_child, blink::Node & old_child) Line 734
ContainerNode::RemoveChildren(blink::SubtreeModificationAction action) Line 814
Node::setTextContent(const WTF::String & text) Line 1514
NodeV8Internal::textContentAttributeSetter(v8::Local<v8::Value> v8Value, const v8::FunctionCallbackInfo<v8::Value> & info) Line 289

Comment 4 by yosin@chromium.org, Jun 25 2018

Cc: brajkumar@chromium.org yosin@chromium.org
 Issue 855324  has been merged into this issue.

Comment 5 by yosin@chromium.org, Jun 25 2018

 Issue 855183  has been merged into this issue.
Project Member

Comment 6 by ClusterFuzz, Jun 25 2018

Labels: OS-Linux
Mergedinto: 855026
Status: Duplicate (was: Assigned)
Project Member

Comment 8 by ClusterFuzz, Jun 29 2018

ClusterFuzz has detected this issue as fixed in range 571075:571076.

Detailed report: https://clusterfuzz.com/testcase?key=4759551849791488

Fuzzer: marty_html_twiddler
Job Type: windows_asan_chrome_no_sandbox
Platform Id: windows

Crash Type: Null-dereference READ
Crash Address: 0x000000000010
Crash State:
  blink::LayoutTextFragment::GetFirstLetterPart
  blink::AssociatedLayoutObjectOf
  blink::FirstLetterPartFor
  
Sanitizer: address (ASAN)

Regressed: https://clusterfuzz.com/revisions?job=windows_asan_chrome_no_sandbox&range=569233:569235
Fixed: https://clusterfuzz.com/revisions?job=windows_asan_chrome_no_sandbox&range=571075:571076

Reproducer Testcase: https://clusterfuzz.com/download?testcase_id=4759551849791488

See https://github.com/google/clusterfuzz-tools for more information.

If you suspect that the result above is incorrect, try re-doing that job on the test case report page.

Sign in to add a comment