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

Issue 2649903005: blink: fix use-after-scope issues in CSSInterpolationType. (Closed)

Created:
3 years, 11 months ago by krasin1
Modified:
3 years, 11 months ago
CC:
darktears, blink-reviews, blink-reviews-animation_chromium.org, chromium-reviews, Eric Willigers, rjwright, shans
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

blink: fix use-after-scope issues in CSSInterpolationType. The problem was in the following line: const AtomicString& propertyName = getProperty().customPropertyName(); <consequent use of propertyName> getProperty() returns PropertyHandle value that is allocated on the stack as a temporary variable with the scope of one statement. Then customPropertyName() returns a reference to this temp variable. Once the statement is over, PropertyHandle value goes out of scope and destroyed. By the time propertyName is used, it already points to a potentially reused stack address. And even if it's not yet reused, the object is destroyed, so the value is invalid anyway. The fix is to save ProperyHandle value in a local variable with the large enough scope to cover all propertyName uses. The bug was found by AddressSanitizer with use-after-free check enabled. It's currently being rolled out into Chrome, and this CL is a part of a larger cleanup of existing failures. BUG=649897, 683459 Review-Url: https://codereview.chromium.org/2649903005 Cr-Commit-Position: refs/heads/master@{#445559} Committed: https://chromium.googlesource.com/chromium/src/+/a6de90795ea5ee5c080e3266dceedd98f66b045e

Patch Set 1 #

Total comments: 4
Unified diffs Side-by-side diffs Delta from patch set Stats (+4 lines, -2 lines) Patch
M third_party/WebKit/Source/core/animation/CSSInterpolationType.cpp View 2 chunks +4 lines, -2 lines 4 comments Download

Messages

Total messages: 23 (9 generated)
krasin1
3 years, 11 months ago (2017-01-23 19:55:27 UTC) #2
dgozman
[+Alan] https://codereview.chromium.org/2649903005/diff/1/third_party/WebKit/Source/core/animation/CSSInterpolationType.cpp File third_party/WebKit/Source/core/animation/CSSInterpolationType.cpp (right): https://codereview.chromium.org/2649903005/diff/1/third_party/WebKit/Source/core/animation/CSSInterpolationType.cpp#newcode254 third_party/WebKit/Source/core/animation/CSSInterpolationType.cpp:254: const PropertyHandle property = getProperty(); Should we instead ...
3 years, 11 months ago (2017-01-23 20:09:16 UTC) #8
krasin1
The android trybots failed during analyze stage with a non-related error message: MBErr: target "components_variations_junit_tests" ...
3 years, 11 months ago (2017-01-23 20:10:44 UTC) #9
krasin1
https://codereview.chromium.org/2649903005/diff/1/third_party/WebKit/Source/core/animation/CSSInterpolationType.cpp File third_party/WebKit/Source/core/animation/CSSInterpolationType.cpp (right): https://codereview.chromium.org/2649903005/diff/1/third_party/WebKit/Source/core/animation/CSSInterpolationType.cpp#newcode254 third_party/WebKit/Source/core/animation/CSSInterpolationType.cpp:254: const PropertyHandle property = getProperty(); On 2017/01/23 20:09:15, dgozman ...
3 years, 11 months ago (2017-01-23 20:13:34 UTC) #10
krasin1
Friendly ping. It might be a good idea to push the fix forward, unblock rolling ...
3 years, 11 months ago (2017-01-23 21:53:42 UTC) #11
alancutter (OOO until 2018)
Sorry for the delay, lgtm. Please add a test case before landing though.
3 years, 11 months ago (2017-01-23 22:19:08 UTC) #12
alancutter (OOO until 2018)
https://codereview.chromium.org/2649903005/diff/1/third_party/WebKit/Source/core/animation/CSSInterpolationType.cpp File third_party/WebKit/Source/core/animation/CSSInterpolationType.cpp (right): https://codereview.chromium.org/2649903005/diff/1/third_party/WebKit/Source/core/animation/CSSInterpolationType.cpp#newcode254 third_party/WebKit/Source/core/animation/CSSInterpolationType.cpp:254: const PropertyHandle property = getProperty(); On 2017/01/23 at 20:09:15, ...
3 years, 11 months ago (2017-01-23 22:21:34 UTC) #13
krasin1
On 2017/01/23 22:19:08, alancutter wrote: > Sorry for the delay, lgtm. > Please add a ...
3 years, 11 months ago (2017-01-23 22:22:17 UTC) #14
krasin1
https://codereview.chromium.org/2649903005/diff/1/third_party/WebKit/Source/core/animation/CSSInterpolationType.cpp File third_party/WebKit/Source/core/animation/CSSInterpolationType.cpp (right): https://codereview.chromium.org/2649903005/diff/1/third_party/WebKit/Source/core/animation/CSSInterpolationType.cpp#newcode254 third_party/WebKit/Source/core/animation/CSSInterpolationType.cpp:254: const PropertyHandle property = getProperty(); On 2017/01/23 22:21:33, alancutter ...
3 years, 11 months ago (2017-01-23 22:56:01 UTC) #16
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/2649903005/1
3 years, 11 months ago (2017-01-23 22:56:16 UTC) #17
alancutter (OOO until 2018)
On 2017/01/23 at 22:22:17, krasin wrote: > On 2017/01/23 22:19:08, alancutter wrote: > > Sorry ...
3 years, 11 months ago (2017-01-23 23:04:07 UTC) #18
commit-bot: I haz the power
Committed patchset #1 (id:1) as https://chromium.googlesource.com/chromium/src/+/a6de90795ea5ee5c080e3266dceedd98f66b045e
3 years, 11 months ago (2017-01-24 00:26:17 UTC) #21
krasin1
On 2017/01/23 23:04:07, alancutter wrote: > On 2017/01/23 at 22:22:17, krasin wrote: > > On ...
3 years, 11 months ago (2017-01-24 17:14:57 UTC) #22
alancutter (OOO until 2018)
3 years, 11 months ago (2017-01-25 04:35:05 UTC) #23
Message was sent while issue was closed.
On 2017/01/24 at 17:14:57, krasin wrote:
> On 2017/01/23 23:04:07, alancutter wrote:
> > On 2017/01/23 at 22:22:17, krasin wrote:
> > > On 2017/01/23 22:19:08, alancutter wrote:
> > > > Sorry for the delay, lgtm.
> > > > Please add a test case before landing though.
> > > 
> > > It was already caught by a test with -fsanitize-use-after-scope enabled.
> > Enabling this check on the bots is my top priority, and I will enable it
with
> > https://codereview.chromium.org/2654623002/ once this CL is submitted.
> > 
> > Which test caught it? Please add that to the description.
> 
> Sorry, I spotted your request to update the CL description after it's landed.
> The bug was detected by the following test cases of blink_tests:
> 
> virtual/threaded/animations/custom-properties/registered-neutral-keyframe.html
> animations/custom-properties/registered-neutral-keyframe.html
> virtual/threaded/animations/custom-properties/registered-inheritance.html
> animations/custom-properties/registered-inheritance.html
> 
> See also:
>
https://build.chromium.org/p/chromium.webkit/builders/WebKit%20Linux%20Trusty...

Thanks!

Powered by Google App Engine
This is Rietveld 408576698