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

Issue 613907 link

Starred by 0 users

Issue metadata

Status: Fixed
Owner:
Closed: Jun 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux
Pri: 1
Type: Bug-Security



Sign in to add a comment

Bad-cast to blink::LayoutObject from blink::PaintLayer;LayoutTableSection.cpp:831:18

Project Member Reported by ClusterFuzz, May 23 2016

Issue description

Detailed report: https://cluster-fuzz.appspot.com/testcase?key=6056485184602112

Fuzzer: inferno_twister
Job Type: linux_ubsan_vptr_chrome
Platform Id: linux

Crash Type: Bad-cast
Crash Address: 0x13233700c3e8
Crash State:
  Bad-cast to blink::LayoutObject from blink::PaintLayer
  LayoutTableSection.cpp:831:18
  
Recommended Security Severity: High


Minimized Testcase (0.51 Kb):
Download: https://cluster-fuzz.appspot.com/download/AMIfv94dmFOau04VI-pr-TUHqzA1xrpUCryszBX44w89cZW90V93fG6VnMRU5uUkFP2FlEZ1Px0ivlUyaqEhwvR_ZmMpnNPxUOn62BUcIxAwhD8XcFULEhb-Lw-VmDZGJkdSz1CZoclVt-yCODfQvFVQZrNaSyWnFw
<unknown id=tCF9><frijole id=tCF17 style="marker-offset: 1486458433em; "</frijole></frijole><style>
* { animation-name: cfpulse68; contain: strict;</style><script>
var docElement = document.body ? document.body : document.documentElement;
tCF94 = document.createElementNS("http://www.w3.org/1999/xhtml", "cr");
tCF96 = document.createElementNS("http://www.w3.org/1999/xhtml", "dl");
tCF9.style.display = "table-row-group"
if (docElement) docElement.offsetTop;
tCF94.appendChild(tCF17); 
tCF9.appendChild(tCF96);
</script>


Additional requirements: Requires HTTP

Filer: inferno

See https://dev.chromium.org/Home/chromium-security/bugs/reproducing-clusterfuzz-bugs for more information.
 
Components: Blink>Layout
Labels: Pri-1
Owner: dsinclair@chromium.org
Status: Assigned (was: Available)
Maybe

Author: dsinclair@chromium.org
Project: chromium
Changelist: https://chromium.googlesource.com/chromium/src//+/193ad20975ef9540c9f6aa163c6514dd78725a7b
Time: Tue Apr 21 20:39:29 2015
The CL last changed line 831 of file LayoutTableSection.cpp, which is stack frame 0.
Project Member

Comment 2 by ClusterFuzz, May 23 2016

Detailed report: https://cluster-fuzz.appspot.com/testcase?key=5583731490553856

Fuzzer: inferno_twister
Job Type: linux_lsan_chrome_mp
Platform Id: linux

Crash Type: Heap-use-after-free READ 7
Crash Address: 0x6110000345f8
Crash State:
  blink::LayoutTableSection::layout
  blink::FrameView::performLayout
  blink::FrameView::layout
  
Recommended Security Severity: High

Regressed: https://cluster-fuzz.appspot.com/revisions?job=linux_lsan_chrome_mp&range=394251:394739

Minimized Testcase (0.33 Kb):
Download: https://cluster-fuzz.appspot.com/download/AMIfv949r5P-YL7lzrNZ1c97K3arGMZNMLGE7Cf9sc0yAM_EapweY_PexCOB_RuhKwTa8CsF0vi3LRKPeUVN44wEgmiRqse1biw_5Vhr9LfDXGkjPK8pDKe1MMr-V9EMd9lOSQ1YAkI1VTwaDprVOtKwQyi-n-Wnjw
<table>
<tr id=tCF4>
</style><style>
* { animation-name: cfpulse95;248)scale(-11%); contain: strict;</style><script>
var docElement = document.body ? document.body : document.documentElement;
if (docElement) docElement.offsetTop;
tCFDoc6911 = document.implementation.createDocument( "", null);
tCFDoc6911.appendChild(tCF4);
</script>


Filer: inferno

See https://dev.chromium.org/Home/chromium-security/bugs/reproducing-clusterfuzz-bugs for more information.
Cc: dsinclair@chromium.org
Owner: nainar@chromium.org
Author: nainar
Project: chromium
Changelist: https://chromium.googlesource.com/chromium/src//+/52328753422fc25a3815bd58f6eaf8e70f6e27ff
Time: Thu May 19 03:04:00 2016
Lines 2588 of file FrameView.cpp which potentially caused crash are changed in this cl (frame #6, "blink::FrameView::updateStyleAndLayoutIfNeededRecursiveInternal").
Minimum distance from crash line to modified line: 0. (file: FrameView.cpp, crashed on: 2588, modified: 2588).
Project Member

Comment 4 by ClusterFuzz, May 23 2016

Labels: Stability-Memory-AddressSanitizer Security_Impact-Head
Project Member

Comment 5 by sheriffbot@chromium.org, May 23 2016

Labels: M-52
Project Member

Comment 6 by sheriffbot@chromium.org, May 23 2016

Labels: ReleaseBlock-Beta
This issue is a security regression. If you are not able to fix this quickly, please revert the change that introduced it.

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

Comment 7 by sheriffbot@chromium.org, May 26 2016

Labels: -Security_Impact-Head Security_Impact-Beta
Project Member

Comment 8 by sheriffbot@chromium.org, May 26 2016

Labels: -ReleaseBlock-Beta ReleaseBlock-Stable

Comment 9 by kenrb@chromium.org, May 26 2016

Owner: kenrb@chromium.org
The suspect CL in comment #3 is just a name change, so not a plausible candidate. I'm investigating.

Comment 10 by kenrb@chromium.org, May 31 2016

Cc: kenrb@chromium.org
Owner: robhogan@chromium.org
robhogan@:

Hi Rob, I think this is a regression from one of your CLs:
https://codereview.chromium.org/1946413002

This is actually a use-after-free caused by a table section not getting RecalcCells() called it needs it. There is some DOM manipulation to create this condition, and then there is a dereference of stale pointer in the row list (never mind that the initial report calls this a bad cast, apparently the memory was getting reallocated to a PaintLayer).

This is a security bug. Are you able to resolve it?
Cc: e...@chromium.org le...@chromium.org
I can reproduce it with both https://codereview.chromium.org/1946413002 and its ancestor https://codereview.chromium.org/1809643008 reverted.

I'm surprised to see layoutFromRootObject() use a table section as the layout root. I would have said only tables can deal with sections directly - and skipping layout on the table is the reason why needsCellsRecalc() is asserting, as that's where sections and cells are rebuilt if necessary.

So we need someone familiar with subtree layout to cast their eye over this. leviw maybe?

Cc: -le...@chromium.org robhogan@chromium.org
Owner: le...@chromium.org
This bug does seem to be containment-related. Maybe we shouldn't be able to make table sections a relayout boundary? 

@leviw?
Here's a reduction:

<table>
<tr id=tCF4>
<style>
* { contain: strict;} 
</style>
<script>
var docElement = document.documentElement;
docElement.offsetTop;
document.implementation.createDocument( "", null).appendChild(tCF4);
</script>

613907.html
214 bytes View Download

Comment 14 by kenrb@chromium.org, May 31 2016

Ah, sorry. I thought I had reverted your change and had it fail to reproduce, but I must have done something wrong because I am seeing the same assertion.

Thanks for your help with the analysis. This is a fairly recent regression (I had an older build on my Windows machine and it wasn't hitting the assert), but it might be getting triggered as a side-effect of an unrelated change to layout somewhere.

Comment 15 by e...@chromium.org, Jun 1 2016

Owner: e...@chromium.org
Levi is no longer working on Blink.

Comment 16 by e...@chromium.org, Jun 1 2016

Also, this is not a regression as it relies on a new feature.

Comment 17 by e...@chromium.org, Jun 1 2016

Cc: dgro...@chromium.org

Comment 18 by e...@chromium.org, Jun 1 2016

Owner: dgro...@chromium.org
Labels: -Unreproducible
Status: Started (was: Assigned)
Status: Fixed (was: Started)
Project Member

Comment 22 by ClusterFuzz, Jun 3 2016

Labels: Merge-Triage
Adding Merge-Triage label for tracking purposes.

Once your fix had sufficient bake time (on canary, dev as appropriate), please nominate your fix for merge by adding the Merge-Request-XX label, where XX is the Chrome milestone.

When your merge is approved by the release manager, please start merging with higher milestone label first. Make sure to re-request merge for every milestone in the label list. You can get branch information on omahaproxy.appspot.com.

- Your friendly ClusterFuzz
Project Member

Comment 23 by sheriffbot@chromium.org, Jun 3 2016

Labels: -Restrict-View-SecurityTeam Restrict-View-SecurityNotify
Labels: Merge-Request-52

Comment 25 by tin...@google.com, Jun 3 2016

Labels: -Merge-Request-52 Merge-Approved-52 Hotlist-Merge-Approved
Your change meets the bar and is auto-approved for M52 (branch: 2743)
Project Member

Comment 26 by bugdroid1@chromium.org, Jun 3 2016

Now that this isn't a security issue further work will take place in  https://crbug.com/616643  (Tables and CSS containment interact poorly), just FYI
Project Member

Comment 28 by ClusterFuzz, Jun 9 2016

ClusterFuzz has detected this issue as fixed in range 397421:397444.

Detailed report: https://cluster-fuzz.appspot.com/testcase?key=5583731490553856

Fuzzer: inferno_twister
Job Type: linux_lsan_chrome_mp
Platform Id: linux

Crash Type: Heap-use-after-free READ 7
Crash Address: 0x61100002a878
Crash State:
  blink::LayoutTableSection::layout
  blink::FrameView::performLayout
  blink::FrameView::layout
  
Recommended Security Severity: High

Regressed: https://cluster-fuzz.appspot.com/revisions?job=linux_lsan_chrome_mp&range=394251:394739
Fixed: https://cluster-fuzz.appspot.com/revisions?job=linux_lsan_chrome_mp&range=397421:397444

Minimized Testcase (0.33 Kb):
Download: https://cluster-fuzz.appspot.com/download/AMIfv94wD-KYqn7nvrD8KojTwQef1S9rET0ufjg1jdRKC97yZ70cXWsj2sGNHF7rwxK9T8iDK6C-F2aEUJs8ZKaftozdCqIpE8nreJY6QXYGQ1w1LeYNkP4Ngxo5anOLsCZooxaT9zBNoFpZidzTYG_dw3D_J0APoQ
<table>
<tr id=tCF4>
</style><style>
* { animation-name: cfpulse95;248)scale(-11%); contain: strict;</style><script>
var docElement = document.body ? document.body : document.documentElement;
if (docElement) docElement.offsetTop;
tCFDoc6911 = document.implementation.createDocument( "", null);
tCFDoc6911.appendChild(tCF4);
</script>


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.
Labels: -Merge-Triage
Project Member

Comment 30 by sheriffbot@chromium.org, Sep 9 2016

Labels: -Restrict-View-SecurityNotify
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
Project Member

Comment 31 by sheriffbot@chromium.org, Oct 1 2016

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
Project Member

Comment 32 by sheriffbot@chromium.org, Oct 2 2016

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
Labels: allpublic

Sign in to add a comment