Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(249)

Issue 2411333007: [css-grid] Avoid storing pointers to orthogonal grid items (Closed)

Created:
4 years, 2 months ago by jfernandez
Modified:
4 years, 2 months ago
CC:
chromium-reviews, jfernandez, szager+layoutwatch_chromium.org, zoltan1, svillar, blink-reviews-layout_chromium.org, pdr+renderingwatchlist_chromium.org, leviw+renderwatch, jchaffraix+rendering, blink-reviews, eae+blinkwatch
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

[css-grid] Avoid storing pointers to orthogonal grid items We defined a Vector of LayoutBox pointers to the orthogonal grid items. This vector has been used mainly to clear the override sizes when the grid layout logic is executed several times for the same Layout Tree. The problem, detected in the test cases attached in the bug report, is that those pointers may point to invalid memory regions. This lead to heap-use-after-free crashes which are potential security breaches. This patch removes the Vector so we iterate over the children got from the current Layout Tree structure at the time the layout logic is executed. This is a less efficient approach, but definitively safer because we avoid accessing pointers to invalid memory regions. BUG=655632 Committed: https://crrev.com/738e26e1286554cb9a63610bce2b77da5a912eb3 Cr-Commit-Position: refs/heads/master@{#425665}

Patch Set 1 #

Total comments: 10

Patch Set 2 : Patch for landing. #

Total comments: 4

Messages

Total messages: 23 (9 generated)
jfernandez
4 years, 2 months ago (2016-10-15 12:09:30 UTC) #3
svillar
Definitely safer indeed lgtm BTW could you rename the test to something more self-explicative? Otherwise ...
4 years, 2 months ago (2016-10-17 08:28:19 UTC) #5
Manuel Rego
A few typos in the description: "has used mainly", "the big report", "less a less".
4 years, 2 months ago (2016-10-17 09:09:58 UTC) #6
Manuel Rego
LGTM too. https://codereview.chromium.org/2411333007/diff/1/third_party/WebKit/LayoutTests/fast/css-grid-layout/regression-test-for-issue-655632.html File third_party/WebKit/LayoutTests/fast/css-grid-layout/regression-test-for-issue-655632.html (right): https://codereview.chromium.org/2411333007/diff/1/third_party/WebKit/LayoutTests/fast/css-grid-layout/regression-test-for-issue-655632.html#newcode9 third_party/WebKit/LayoutTests/fast/css-grid-layout/regression-test-for-issue-655632.html:9: <script> Nit: You don't need to close ...
4 years, 2 months ago (2016-10-17 09:13:41 UTC) #7
jfernandez
https://codereview.chromium.org/2411333007/diff/1/third_party/WebKit/LayoutTests/fast/css-grid-layout/regression-test-for-issue-655632.html File third_party/WebKit/LayoutTests/fast/css-grid-layout/regression-test-for-issue-655632.html (right): https://codereview.chromium.org/2411333007/diff/1/third_party/WebKit/LayoutTests/fast/css-grid-layout/regression-test-for-issue-655632.html#newcode9 third_party/WebKit/LayoutTests/fast/css-grid-layout/regression-test-for-issue-655632.html:9: <script> On 2016/10/17 09:13:41, Manuel Rego wrote: > Nit: ...
4 years, 2 months ago (2016-10-17 09:21:42 UTC) #9
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2411333007/40001
4 years, 2 months ago (2016-10-17 11:27:19 UTC) #13
cbiesinger
lgtm https://codereview.chromium.org/2411333007/diff/40001/third_party/WebKit/Source/core/layout/LayoutGrid.cpp File third_party/WebKit/Source/core/layout/LayoutGrid.cpp (right): https://codereview.chromium.org/2411333007/diff/40001/third_party/WebKit/Source/core/layout/LayoutGrid.cpp#newcode497 third_party/WebKit/Source/core/layout/LayoutGrid.cpp:497: if (child->isOutOfFlowPositioned() || !isOrthogonalChild(*child)) Since you use nextInFlowSiblingBox, ...
4 years, 2 months ago (2016-10-17 12:16:45 UTC) #14
jfernandez
https://codereview.chromium.org/2411333007/diff/1/third_party/WebKit/LayoutTests/fast/css-grid-layout/regression-test-for-issue-655632.html File third_party/WebKit/LayoutTests/fast/css-grid-layout/regression-test-for-issue-655632.html (right): https://codereview.chromium.org/2411333007/diff/1/third_party/WebKit/LayoutTests/fast/css-grid-layout/regression-test-for-issue-655632.html#newcode15 third_party/WebKit/LayoutTests/fast/css-grid-layout/regression-test-for-issue-655632.html:15: } catch (e) { On 2016/10/17 08:28:19, svillar wrote: ...
4 years, 2 months ago (2016-10-17 12:37:37 UTC) #15
Manuel Rego
https://codereview.chromium.org/2411333007/diff/40001/third_party/WebKit/Source/core/layout/LayoutGrid.cpp File third_party/WebKit/Source/core/layout/LayoutGrid.cpp (right): https://codereview.chromium.org/2411333007/diff/40001/third_party/WebKit/Source/core/layout/LayoutGrid.cpp#newcode497 third_party/WebKit/Source/core/layout/LayoutGrid.cpp:497: if (child->isOutOfFlowPositioned() || !isOrthogonalChild(*child)) Note that we need to ...
4 years, 2 months ago (2016-10-17 12:40:42 UTC) #16
jfernandez
https://codereview.chromium.org/2411333007/diff/40001/third_party/WebKit/Source/core/layout/LayoutGrid.cpp File third_party/WebKit/Source/core/layout/LayoutGrid.cpp (right): https://codereview.chromium.org/2411333007/diff/40001/third_party/WebKit/Source/core/layout/LayoutGrid.cpp#newcode497 third_party/WebKit/Source/core/layout/LayoutGrid.cpp:497: if (child->isOutOfFlowPositioned() || !isOrthogonalChild(*child)) On 2016/10/17 12:40:42, Manuel Rego ...
4 years, 2 months ago (2016-10-17 12:43:42 UTC) #17
commit-bot: I haz the power
Committed patchset #2 (id:40001)
4 years, 2 months ago (2016-10-17 12:50:27 UTC) #19
commit-bot: I haz the power
Patchset 2 (id:??) landed as https://crrev.com/738e26e1286554cb9a63610bce2b77da5a912eb3 Cr-Commit-Position: refs/heads/master@{#425665}
4 years, 2 months ago (2016-10-17 12:54:13 UTC) #21
blink-reviews
Oh, great point, thanks! lgtm either way. On Mon, Oct 17, 2016 at 8:43 AM, ...
4 years, 2 months ago (2016-10-17 12:58:05 UTC) #22
chromium-reviews
4 years, 2 months ago (2016-10-17 12:58:06 UTC) #23
Message was sent while issue was closed.
Oh, great point, thanks! lgtm either way.

On Mon, Oct 17, 2016 at 8:43 AM,  <jfernandez@igalia.com> wrote:
>
>
https://codereview.chromium.org/2411333007/diff/40001/third_party/WebKit/Sour...
> File third_party/WebKit/Source/core/layout/LayoutGrid.cpp (right):
>
>
https://codereview.chromium.org/2411333007/diff/40001/third_party/WebKit/Sour...
> third_party/WebKit/Source/core/layout/LayoutGrid.cpp:497: if
> (child->isOutOfFlowPositioned() || !isOrthogonalChild(*child))
> On 2016/10/17 12:40:42, Manuel Rego wrote:
>> Note that we need to check that firstChildBox() is not out of flow.
>> So or we implement a firstInFlowChildBox() or we probably simply use
>> nextSiblingBox() and keep the if here.
>
> That's true. I think we should change both and just use nextSiblingBox
> instead.
>
> https://codereview.chromium.org/2411333007/

-- 
You received this message because you are subscribed to the Google Groups
"Chromium-reviews" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to chromium-reviews+unsubscribe@chromium.org.

Powered by Google App Engine
This is Rietveld 408576698