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

Issue 734348 link

Starred by 1 user

Issue metadata

Status: Verified
Owner:
Last visit > 30 days ago
Closed: Jun 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux
Pri: 1
Type: Bug-Security



Sign in to add a comment

Heap-use-after-free in blink::LayoutQuote::DetachQuote

Project Member Reported by ClusterFuzz, Jun 17 2017

Issue description

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

Fuzzer: mbarbella_webcomponents
Job Type: linux_asan_content_shell_drt
Platform Id: linux

Crash Type: Heap-use-after-free WRITE 8
Crash Address: 0x610000083bd8
Crash State:
  blink::LayoutQuote::DetachQuote
  blink::LayoutQuote::WillBeDestroyed
  blink::LayoutObject::Destroy
  
Sanitizer: address (ASAN)

Recommended Security Severity: High

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


Issue filed automatically.

See https://dev.chromium.org/Home/chromium-security/bugs/reproducing-clusterfuzz-bugs for more information.
 

Comment 1 by est...@chromium.org, Jun 17 2017

Components: Blink>Layout
Project Member

Comment 2 by sheriffbot@chromium.org, Jun 18 2017

Labels: M-59
Project Member

Comment 3 by sheriffbot@chromium.org, Jun 18 2017

Labels: Pri-1

Comment 4 by est...@chromium.org, Jun 19 2017

Owner: kojii@chromium.org
Status: Assigned (was: Untriaged)
kojii, would you be able to help triage this please? Thank you!

Comment 5 by kojii@chromium.org, Jun 19 2017

Cc: kojii@chromium.org
Components: -Blink>Layout Blink>DOM>ShadowDOM
Owner: hayato@chromium.org
hayato@, could you mind having a look?

The stack is InsertionPoint::SetDistributedNodes() calls LazyReattachIfAttached(). Is this part of your re-writes? If this looks more like layout tree problem, please feel free to assign back to me.

Comment 6 by hayato@chromium.org, Jun 19 2017

Since the rewrite [1] should affect only Shadow DOM v1's distribution, it is unlikely to affect this crash, which was happening in Shadow DOM v0's insertion points, at the first glance.

But I am not 100% sure. I might miss something...

[1] https://chromium-review.googlesource.com/c/532734/

Comment 7 by hayato@chromium.org, Jun 19 2017

Cc: hayato@chromium.org
Owner: kochi@chromium.org
kochi@, are you interested in play with this cluster-fuzz crash?
I am on build sheriff today. This might be good chance for you to learn how Shadow DOM distribution works. I am happy to help you later.



Comment 8 by kochi@chromium.org, Jun 20 2017

Cc: aboxhall@chromium.org
I manually cleaned up the minimized reprocase, and attached here.

In summary, a quote element with ::after pseudo element is redistributed
to another <content>, and at the same time the ::after pseudo style becomes
not-matching.

But in the meantime, I found in the backtrace of memory free, 
UpdateDistribution() appeared twice (i.e. reentered the function),
the second was called from AXObjectImpl. This looks very suspicious.

It looks like aboxhall@ is at it, and applying the change
https://codereview.chromium.org/2939933002
fixed the ASAN failure locally.
min.html
771 bytes View Download

Comment 9 by kochi@chromium.org, Jun 20 2017

For reference, attaching the backtrace on the free code path.

stacktrace_free.txt
14.3 KB View Download

Comment 10 by kochi@chromium.org, Jun 20 2017

In the backtrace above, UpdateDistribution() appears in #21 and #59.
Project Member

Comment 11 by ClusterFuzz, Jun 21 2017

ClusterFuzz has detected this issue as fixed in range 480776:480824.

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

Fuzzer: mbarbella_webcomponents
Job Type: linux_asan_content_shell_drt
Platform Id: linux

Crash Type: Heap-use-after-free WRITE 8
Crash Address: 0x610000083bd8
Crash State:
  blink::LayoutQuote::DetachQuote
  blink::LayoutQuote::WillBeDestroyed
  blink::LayoutObject::Destroy
  
Sanitizer: address (ASAN)

Recommended Security Severity: High

Regressed: https://clusterfuzz.com/revisions?job=linux_asan_content_shell_drt&range=474583:474657
Fixed: https://clusterfuzz.com/revisions?job=linux_asan_content_shell_drt&range=480776:480824

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


See https://dev.chromium.org/Home/chromium-security/bugs/reproducing-clusterfuzz-bugs for more information.

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

Comment 12 by ClusterFuzz, Jun 21 2017

Labels: ClusterFuzz-Verified
Status: Verified (was: Assigned)
ClusterFuzz testcase 5120190756159488 is verified as fixed, so closing issue.

If this is incorrect, please add ClusterFuzz-Wrong label and re-open the issue.
Project Member

Comment 13 by sheriffbot@chromium.org, Jun 21 2017

Labels: -Restrict-View-SecurityTeam Restrict-View-SecurityNotify
Project Member

Comment 14 by sheriffbot@chromium.org, Jun 23 2017

Labels: Merge-Request-60
Project Member

Comment 15 by sheriffbot@chromium.org, Jun 23 2017

Labels: -Merge-Request-60 Hotlist-Merge-Review Merge-Review-60
This bug requires manual review: M60 has already been promoted to the beta branch, so this requires manual review
Please contact the milestone owner if you have questions.
Owners: amineer@(Android), cmasso@(iOS), josafat@(ChromeOS), bustamante@(Desktop)

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
Please confirm if this has been verified in canary. 

Comment 17 by kochi@chromium.org, Jun 26 2017

This only happens with ASAN builds and it's hard to *verify* with today's canary,
but with that said, I cannot reproduce the issue with ToT local build with ASAN
enabled, with the same repro case (attached to comment #8) and
considering cluserfuzz already verified the fix on ToT build in comment #11,
we can safely say the bug fix is in canary for a few days.
Labels: -Merge-Review-60 Merge-Approved-60
Approving merge to M60. 
Project Member

Comment 19 by bugdroid1@chromium.org, Jun 26 2017

Labels: -merge-approved-60 merge-merged-3112
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/303e0e83015674dec5bf2fc1a5eafe2871e867ee

commit 303e0e83015674dec5bf2fc1a5eafe2871e867ee
Author: Takayoshi Kochi <kochi@chromium.org>
Date: Mon Jun 26 04:55:46 2017

Only call TextChanged on existing AXObjects. This avoids triggering the code which calls UpdateDistribution as part of creating a new AXObject, which was causing issues.

This change should cause no behaviour changes, as in cases where an AXObject needs to be created for a text node, its parent will also have a ChildrenChanged notification fired on it, which will cause the appropriate updates to fire.

Reverts https://codereview.chromium.org/2926713002/ as the code which causes UpdateDistribution to be called should never run with this change, so we don't need to check whether distribution is dirty any more.

BUG= 729229 , 732200 , 734348 

Review-Url: https://codereview.chromium.org/2939933002
Cr-Original-Commit-Position: refs/heads/master@{#480792}
Review-Url: https://codereview.chromium.org/2957733002 .
Cr-Commit-Position: refs/branch-heads/3112@{#464}
Cr-Branched-From: b6460e24cf59f429d69de255538d0fc7a425ccf9-refs/heads/master@{#474897}

[modify] https://crrev.com/303e0e83015674dec5bf2fc1a5eafe2871e867ee/content/test/data/accessibility/event/menulist-collapse-expected-win.txt
[modify] https://crrev.com/303e0e83015674dec5bf2fc1a5eafe2871e867ee/third_party/WebKit/LayoutTests/accessibility/contenteditable-notifications.html
[modify] https://crrev.com/303e0e83015674dec5bf2fc1a5eafe2871e867ee/third_party/WebKit/LayoutTests/accessibility/presentation-owned-elements.html
[modify] https://crrev.com/303e0e83015674dec5bf2fc1a5eafe2871e867ee/third_party/WebKit/LayoutTests/resources/accessibility-helper.js
[modify] https://crrev.com/303e0e83015674dec5bf2fc1a5eafe2871e867ee/third_party/WebKit/Source/core/layout/LayoutMenuList.cpp
[modify] https://crrev.com/303e0e83015674dec5bf2fc1a5eafe2871e867ee/third_party/WebKit/Source/modules/accessibility/AXMenuList.cpp
[modify] https://crrev.com/303e0e83015674dec5bf2fc1a5eafe2871e867ee/third_party/WebKit/Source/modules/accessibility/AXMenuListPopup.cpp
[modify] https://crrev.com/303e0e83015674dec5bf2fc1a5eafe2871e867ee/third_party/WebKit/Source/modules/accessibility/AXMenuListPopup.h
[modify] https://crrev.com/303e0e83015674dec5bf2fc1a5eafe2871e867ee/third_party/WebKit/Source/modules/accessibility/AXObjectCacheImpl.cpp
[modify] https://crrev.com/303e0e83015674dec5bf2fc1a5eafe2871e867ee/third_party/WebKit/Source/modules/accessibility/AXObjectCacheImpl.h

Labels: -M-59 M-61 M-60
Labels: Release-0-M60
Project Member

Comment 22 by sheriffbot@chromium.org, Sep 27 2017

Labels: -Restrict-View-SecurityNotify allpublic
This bug has been closed for more than 14 weeks. Removing security view restrictions.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot

Sign in to add a comment