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

Issue 2913133002: Check whether a text node may be about to be redistributed in ShouldUpdateLayoutByReattaching() (Closed)

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

Description

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} Committed: https://chromium.googlesource.com/chromium/src/+/6281b70b9a36a64590f99c799ee55264da6cb52d

Patch Set 1 #

Patch Set 2 : Revert change to LayoutText and instead check for a parent shadowhost needing redistribution in Text #

Patch Set 3 : Add comment #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+6 lines, -0 lines) Patch
M third_party/WebKit/Source/core/dom/Text.cpp View 1 2 2 chunks +6 lines, -0 lines 1 comment Download

Messages

Total messages: 39 (15 generated)
aboxhall
What do you think of this fix?
3 years, 6 months ago (2017-05-31 05:56:50 UTC) #2
aboxhall
What do you think of this fix?
3 years, 6 months ago (2017-05-31 05:56:51 UTC) #3
dmazzoni
Could you add another sentence to the change description explaining why it needs to be ...
3 years, 6 months ago (2017-05-31 05:57:07 UTC) #4
dmazzoni
lgtm based on offline discussion, please explain a bit more in the change description before ...
3 years, 6 months ago (2017-05-31 06:04:19 UTC) #5
aboxhall
kojii@ - would you mind taking a look at this? I will CC you on ...
3 years, 6 months ago (2017-05-31 06:37:22 UTC) #8
kojii
Hi Alice, thank you for working on this very promptly. Let me cc eae@ and ...
3 years, 6 months ago (2017-05-31 14:25:55 UTC) #10
kojii
On 2017/05/31 at 14:25:55, kojii wrote: > #3 should probably fall onto DOM team. I'll ...
3 years, 6 months ago (2017-05-31 14:34:35 UTC) #11
dmazzoni
On Wed, May 31, 2017 at 7:25 AM <kojii@chromium.org> wrote: > 1. Could we make ...
3 years, 6 months ago (2017-05-31 15:33:04 UTC) #12
dmazzoni
On Wed, May 31, 2017 at 7:25 AM <kojii@chromium.org> wrote: > 1. Could we make ...
3 years, 6 months ago (2017-05-31 15:33:05 UTC) #13
dmazzoni
The bug where I'm working on that refactoring is http://crbug.com/699438 - i'm starting by improving ...
3 years, 6 months ago (2017-05-31 15:37:03 UTC) #14
dmazzoni
The bug where I'm working on that refactoring is http://crbug.com/699438 - i'm starting by improving ...
3 years, 6 months ago (2017-05-31 15:37:04 UTC) #15
aboxhall
On 2017/05/31 15:33:04, dmazzoni wrote: > On Wed, May 31, 2017 at 7:25 AM <mailto:kojii@chromium.org> ...
3 years, 6 months ago (2017-05-31 22:29:13 UTC) #16
kojii
On 2017/05/31 at 15:33:05, dmazzoni wrote: > On Wed, May 31, 2017 at 7:25 AM ...
3 years, 6 months ago (2017-06-01 02:09:40 UTC) #17
kojii
On 2017/06/01 at 02:09:40, kojii wrote: > On 2017/05/31 at 22:29:13, aboxhall wrote: > > ...
3 years, 6 months ago (2017-06-01 02:25:34 UTC) #18
aboxhall
On 2017/06/01 02:25:34, kojii wrote: > On 2017/06/01 at 02:09:40, kojii wrote: > > On ...
3 years, 6 months ago (2017-06-01 02:57:04 UTC) #19
aboxhall
On 2017/06/01 02:57:04, aboxhall wrote: > On 2017/06/01 02:25:34, kojii wrote: > > On 2017/06/01 ...
3 years, 6 months ago (2017-06-01 06:20:00 UTC) #22
kojii
lgtm w/nit. It checks only direct parent, so there maybe cases where the text is ...
3 years, 6 months ago (2017-06-01 07:27:32 UTC) #23
kojii
After seeing your message offline, I understand it's intentional to check parent only, so disregard ...
3 years, 6 months ago (2017-06-01 07:32:29 UTC) #24
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/2913133002/40001
3 years, 6 months ago (2017-06-01 08:29:34 UTC) #31
commit-bot: I haz the power
Committed patchset #3 (id:40001) as https://chromium.googlesource.com/chromium/src/+/6281b70b9a36a64590f99c799ee55264da6cb52d
3 years, 6 months ago (2017-06-01 10:10:01 UTC) #34
yosin_UTC9
https://codereview.chromium.org/2913133002/diff/40001/third_party/WebKit/Source/core/dom/Text.cpp File third_party/WebKit/Source/core/dom/Text.cpp (right): https://codereview.chromium.org/2913133002/diff/40001/third_party/WebKit/Source/core/dom/Text.cpp#newcode451 third_party/WebKit/Source/core/dom/Text.cpp:451: if (text_node.ParentElementShadow() && What is happend when Text is ...
3 years, 6 months ago (2017-06-02 07:47:43 UTC) #36
hayato
> After seeing your message offline, I understand it's intentional to check parent only, so ...
3 years, 6 months ago (2017-06-02 08:00:29 UTC) #37
kojii
On 2017/06/02 at 08:00:29, hayato wrote: > > After seeing your message offline, I understand ...
3 years, 6 months ago (2017-06-02 16:18:17 UTC) #38
aboxhall
3 years, 6 months ago (2017-06-07 00:36:32 UTC) #39
Message was sent while issue was closed.
On 2017/06/02 16:18:17, kojii wrote:
> On 2017/06/02 at 08:00:29, hayato wrote:
> > > After seeing your message offline, I understand it's intentional to check
> parent only, so disregard the first part.
> > 
> > I appreciate if you could share us what is the intention behind? It looks
> wrong to me.
> 
> First, please see #13 and #14. dmazzoni@ is working on making AX more
lifecycle
> friendly, hopefully in a few weeks, so this is a fix until then.
> 
> Second, most of cases do not hit this condition, since there are many other
> checks until the code reaches to UpdateDistribution(). So far the only case
she
> could find is when a text node is distributed into shadow dom. Maybe we could
> also check if the parent is insertion point, if there were way to do it (I
don't
> know atm), but we can add it if such cases were found before dmazzoni@
finishes
> his work.
> 
> I didn't measure by myself but this function is known to be a very special,
> intentional rule breaker because of a significant performance benefit.
Disabling
> in all shadow trees without understanding a problem exists scares me in other
> ways.

Yes, I'm hoping this will only need to be a temporary fix.

In terms of @yosin's question, the object was being deleted in
https://cs.chromium.org/chromium/src/third_party/WebKit/Source/core/layout/La...
so I think this only affects text nodes which are a directly distributed, but I
may be incorrect.

Powered by Google App Engine
This is Rietveld 408576698