New issue
Advanced search Search tips

Issue 726716 link

Starred by 1 user

Issue metadata

Status: Verified
Owner:
Closed: Jun 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Mac
Pri: 1
Type: Bug-Security

Blocking:
issue 728151



Sign in to add a comment

Heap-use-after-free in blink::LayoutText::SetText

Project Member Reported by ClusterFuzz, May 26 2017

Issue description

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

Fuzzer: bj_broddelwerk
Job Type: linux_asan_content_shell_drt
Platform Id: linux

Crash Type: Heap-use-after-free READ 8
Crash Address: 0x60e0000c0780
Crash State:
  blink::LayoutText::SetText
  blink::LayoutText::SetTextWithOffset
  blink::Text::UpdateTextLayoutObject
  
Sanitizer: address (ASAN)

Recommended Security Severity: High

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

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


Issue filed automatically.

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

Comment 1 by kenrb@chromium.org, May 26 2017

Components: Blink>DOM
Labels: ReleaseBlock-Beta Pri-1
Owner: aboxhall@chromium.org
Status: Assigned (was: Untriaged)
aboxhall@: Your CL has caused a security regression -- https://chromium.googlesource.com/chromium/src/+/58a3e83e1325c8a366941564ca8ce096bb1345df

It appears that when AXObjectImpl::AccessibilityIsIgnored() calls UpdateDistribution() on its Document's owner, that can cause modifications to the layout tree, including destruction of a LayoutText object that is higher up in the stack.

Can you please have a look?
Project Member

Comment 2 by ClusterFuzz, May 27 2017

Labels: OS-Mac
Project Member

Comment 3 by sheriffbot@chromium.org, May 27 2017

Labels: M-60
Looking at this now.
Cc: dmazz...@chromium.org
Cc: kojii@chromium.org

Comment 7 by kojii@chromium.org, May 31 2017

Cc: hayato@chromium.org e...@chromium.org

Comment 8 by kojii@chromium.org, May 31 2017

Blocking: 728151
Project Member

Comment 9 by bugdroid1@chromium.org, Jun 1 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/6281b70b9a36a64590f99c799ee55264da6cb52d

commit 6281b70b9a36a64590f99c799ee55264da6cb52d
Author: aboxhall <aboxhall@chromium.org>
Date: Thu Jun 01 10:09:50 2017

Check whether a text node may be about to be redistributed in ShouldUpdateLayoutByReattaching(). Prevents use-after-free when SetTextWithOffset is called with dirty distribution.

BUG= 726716 

Review-Url: https://codereview.chromium.org/2913133002
Cr-Commit-Position: refs/heads/master@{#476242}

[modify] https://crrev.com/6281b70b9a36a64590f99c799ee55264da6cb52d/third_party/WebKit/Source/core/dom/Text.cpp

Project Member

Comment 10 by ClusterFuzz, Jun 2 2017

ClusterFuzz has detected this issue as fixed in range 476239:476249.

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

Fuzzer: bj_broddelwerk
Job Type: linux_asan_content_shell_drt
Platform Id: linux

Crash Type: Heap-use-after-free READ 8
Crash Address: 0x60e0000c0780
Crash State:
  blink::LayoutText::SetText
  blink::LayoutText::SetTextWithOffset
  blink::Text::UpdateTextLayoutObject
  
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=476239:476249

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


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 11 by ClusterFuzz, Jun 2 2017

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

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

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

Labels: -Restrict-View-SecurityTeam Restrict-View-SecurityNotify
Labels: Merge-Request-60
Project Member

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

Labels: -Merge-Request-60 Hotlist-Merge-Approved Merge-Approved-60
Your change meets the bar and is auto-approved for M60. Please go ahead and merge the CL to branch 3112 manually. Please contact 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
Labels: -ReleaseBlock-Beta ReleaseBlock-Stable
Project Member

Comment 16 by sheriffbot@chromium.org, Jun 12 2017

Cc: awhalley@chromium.org
This issue has been approved for a merge. Please merge the fix to any appropriate branches as soon as possible!

If all merges have been completed, please remove any remaining Merge-Approved labels from this issue.

Thanks for your time! To disable nags, add the Disable-Nags label.

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

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

This issue has been approved for a merge. Please merge the fix to any appropriate branches as soon as possible!

If all merges have been completed, please remove any remaining Merge-Approved labels from this issue.

Thanks for your time! To disable nags, add the Disable-Nags label.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
aboxhall@ - mind doing the merge to M60?  Thanks!
I'll merge now
Project Member

Comment 20 by bugdroid1@chromium.org, Jul 6 2017

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

commit 986255635c4af811abecf049b18c0b978d3a5703
Author: Dominic Mazzoni <dmazzoni@chromium.org>
Date: Thu Jul 06 20:15:33 2017

Merge to M60: Check whether a text node may be about to be redistributed in ShouldUpdateLayoutByReattaching(). Prevents use-after-free when SetTextWithOffset is called with dirty distribution.

BUG= 726716 

Review-Url: https://codereview.chromium.org/2913133002
Cr-Original-Commit-Position: refs/heads/master@{#476242}
Review-Url: https://codereview.chromium.org/2967423002 .
Cr-Commit-Position: refs/branch-heads/3112@{#533}
Cr-Branched-From: b6460e24cf59f429d69de255538d0fc7a425ccf9-refs/heads/master@{#474897}

[modify] https://crrev.com/986255635c4af811abecf049b18c0b978d3a5703/third_party/WebKit/Source/core/dom/Text.cpp

Labels: -Hotlist-Merge-Approved -ReleaseBlock-Stable
Thanks dmazzoni@!
Isn't the CL merged in #20 the one that caused perf regression and we chose do different fix?

I believe kochi@ merged the Alice's newer one already that this merge isn't necessary, no?
This is the merge CL:
https://codereview.chromium.org/2957733002

So I think 3112@{#464} fixed this problem in better way, and in #20, 3112@{#533} has an old fix that has a perf issue.

Should we revert #20 I guess?
Ah, you're right - the correct fix was from  bug 729229  and this shouldn't have been marked for merge.

Reverting now.

Thanks! Pardon the confusion.
Project Member

Comment 26 by sheriffbot@chromium.org, Sep 8 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