New issue
Advanced search Search tips

Issue 756332 link

Starred by 2 users

Issue metadata

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



Sign in to add a comment

DCHECK failure in !node->is_rewritten() in pattern-rewriter.cc

Project Member Reported by ClusterFuzz, Aug 17 2017

Issue description

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

Fuzzer: inferno_js_fuzzer_c
Job Type: linux_asan_d8_dbg
Platform Id: linux

Crash Type: DCHECK failure
Crash Address: 
Crash State:
  !node->is_rewritten() in pattern-rewriter.cc
  
Sanitizer: address (ASAN)

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

Issue manually filed by: ishell

See https://github.com/google/clusterfuzz-tools for more information.
 

Comment 1 by ishell@chromium.org, Aug 17 2017

Cc: marja@chromium.org
Owner: ishell@chromium.org
Status: Assigned (was: Untriaged)
Project Member

Comment 2 by ClusterFuzz, Aug 17 2017

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

Fuzzer: inferno_js_fuzzer_c
Job Type: linux_asan_d8_dbg
Platform Id: linux

Crash Type: DCHECK failure
Crash Address: 
Crash State:
  !node->is_rewritten() in pattern-rewriter.cc
  v8::internal::PatternRewriter::VisitRewritableExpression
  v8::internal::PatternRewriter::Visit
  
Sanitizer: address (ASAN)

Regressed: https://clusterfuzz.com/revisions?job=linux_asan_d8_dbg&range=47381:47382

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

See https://github.com/google/clusterfuzz-tools for more information.
Project Member

Comment 3 by ClusterFuzz, Aug 17 2017

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

Fuzzer: inferno_js_fuzzer_c
Job Type: linux_asan_d8_dbg
Platform Id: linux

Crash Type: DCHECK failure
Crash Address: 
Crash State:
  !node->is_rewritten() in pattern-rewriter.cc
  
Sanitizer: address (ASAN)

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

See https://github.com/google/clusterfuzz-tools for more information.

Comment 4 by ishell@chromium.org, Aug 17 2017

Cc: ca...@igalia.com
Owner: adamk@chromium.org
CF points to 983eec897979c48070ea5c76eda2afe339eda602. PTAL
Project Member

Comment 5 by ClusterFuzz, Aug 17 2017

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

Fuzzer: inferno_js_fuzzer_c
Job Type: linux_asan_d8_dbg
Platform Id: linux

Crash Type: DCHECK failure
Crash Address: 
Crash State:
  !node->is_rewritten() in pattern-rewriter.cc
  v8::internal::PatternRewriter::VisitRewritableExpression
  v8::internal::PatternRewriter::Visit
  
Sanitizer: address (ASAN)

Regressed: https://clusterfuzz.com/revisions?job=linux_asan_d8_dbg&range=47381:47382

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

See https://github.com/google/clusterfuzz-tools for more information.
Project Member

Comment 6 by ClusterFuzz, Aug 17 2017

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

Fuzzer: inferno_js_fuzzer_c
Job Type: linux_asan_d8_dbg
Platform Id: linux

Crash Type: DCHECK failure
Crash Address: 
Crash State:
  !node->is_rewritten() in pattern-rewriter.cc
  
Sanitizer: address (ASAN)

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

See https://github.com/google/clusterfuzz-tools for more information.
Project Member

Comment 7 by ClusterFuzz, Aug 17 2017

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

Fuzzer: inferno_js_fuzzer_c
Job Type: linux_asan_d8_dbg
Platform Id: linux

Crash Type: DCHECK failure
Crash Address: 
Crash State:
  !node->is_rewritten() in pattern-rewriter.cc
  v8::internal::PatternRewriter::VisitRewritableExpression
  
Sanitizer: address (ASAN)

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

See https://github.com/google/clusterfuzz-tools for more information.

Comment 8 by ishell@chromium.org, Aug 17 2017

 Issue 756258  has been merged into this issue.
Project Member

Comment 9 by sheriffbot@chromium.org, Aug 17 2017

Labels: Pri-1

Comment 10 by ca...@igalia.com, Aug 17 2017

It's not clear to me that Adam's CL is the proper culprit, as it looks like it takes the same execution paths within PatternRewriter.

I believe this is form parser-base.h:

```
    if (is_lazy_top_level_function) {
      FunctionState* parent_state = function_state.outer();
      DCHECK_NOT_NULL(parent_state);
      DCHECK_GE(parent_state->destructuring_assignments_to_rewrite().length(),
                rewritable_length);
      parent_state->RewindDestructuringAssignments(rewritable_length);
    }
```

This branch isn't being taken in the repro case, (maybe it was before?), so ParseProgram rewrites the recorded destructuring assignments, which includes one which has already been processed by DeclareAndInitializeVariables() for the arrow function.

It may be workable/make sense to always erase destructuring assignments from the parent function state, and doing so does fix this crash

Comment 11 by ca...@igalia.com, Aug 17 2017

https://chromium-review.googlesource.com/c/619386/2 tries this approach, but fails some regression tests. Could be that the condition to enter the branch just needs to be fine-tuned more.

Comment 12 by adamk@chromium.org, Aug 17 2017

More minimal repro:

{ ({x: {y} = {} } = {}) => {}; }

or for Array destructuring

{ ({x: [y] = [] } = {}) => {}; }

Comment 13 by adamk@chromium.org, Aug 17 2017

The failing DCHECK used to be an early return:

https://cs.chromium.org/chromium/src/v8/src/parsing/pattern-rewriter.cc?rcl=07259a9ceafa078c9bb7f9ee1bb6f2d67256cc80&l=335

Rewinding appropriately (as caitp suggests) seems more correct, but in the interest of a speedy fix I'll aim to land an early return with a TODO.
Labels: Security_Impact-Head
Project Member

Comment 15 by ClusterFuzz, Aug 18 2017

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

Fuzzer: inferno_js_fuzzer_c
Job Type: linux_asan_d8_dbg
Platform Id: linux

Crash Type: DCHECK failure
Crash Address: 
Crash State:
  !node->is_rewritten() in pattern-rewriter.cc
  
Sanitizer: address (ASAN)

Regressed: https://clusterfuzz.com/revisions?job=linux_asan_d8_dbg&range=47381:47382

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

See https://github.com/google/clusterfuzz-tools for more information.
Project Member

Comment 16 by ClusterFuzz, Aug 18 2017

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

Fuzzer: inferno_js_fuzzer_c
Job Type: linux_asan_d8_dbg
Platform Id: linux

Crash Type: DCHECK failure
Crash Address: 
Crash State:
  !node->is_rewritten() in pattern-rewriter.cc
  v8::internal::PatternRewriter::VisitRewritableExpression
  
Sanitizer: address (ASAN)

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

See https://github.com/google/clusterfuzz-tools for more information.
Project Member

Comment 17 by sheriffbot@chromium.org, Aug 18 2017

Labels: M-62
Project Member

Comment 18 by sheriffbot@chromium.org, Aug 18 2017

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

If this doesn't affect a release branch, or has not been properly classified for severity, please update the Security_Impact or Security_Severity labels, and remove the ReleaseBlock label. To disable this altogether, apply ReleaseBlock-NA.

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

Comment 19 by bugdroid1@chromium.org, Aug 18 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/v8/v8.git/+/cec289ea57cc2d5ec72d55c524a181f89ce864ce

commit cec289ea57cc2d5ec72d55c524a181f89ce864ce
Author: Adam Klein <adamk@chromium.org>
Date: Fri Aug 18 16:16:24 2017

[pattern-rewriter] Handle already-rewritten RewritableExpressions as before

Before 983eec897979c48070ea5c76eda2afe339eda602, RewritableExpressions
which had been queued for destructuring assignment rewriting but which
turned out to be part of a binding pattern in arrow function parameters
would be silently ignored by the PatternRewriter. After that CL, they
failed with a DCHECK.

This patch reverts to the previous behavior, with a TODO to handle this
in a better way by dequeuing RewritableExpressions that turned out
to be part of an inner arrow function.

Bug:  chromium:756332 
Change-Id: I0a9bf51499940c944034d9a8128e89950de38059
Reviewed-on: https://chromium-review.googlesource.com/619506
Reviewed-by: Marja Hölttä <marja@chromium.org>
Commit-Queue: Adam Klein <adamk@chromium.org>
Cr-Commit-Position: refs/heads/master@{#47435}
[modify] https://crrev.com/cec289ea57cc2d5ec72d55c524a181f89ce864ce/src/parsing/pattern-rewriter.cc
[add] https://crrev.com/cec289ea57cc2d5ec72d55c524a181f89ce864ce/test/mjsunit/regress/regress-crbug-756332.js

Comment 20 by adamk@chromium.org, Aug 18 2017

Status: Fixed (was: Assigned)
Project Member

Comment 21 by ClusterFuzz, Aug 19 2017

ClusterFuzz has detected this issue as fixed in range 47434:47435.

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

Fuzzer: inferno_js_fuzzer_c
Job Type: linux_asan_d8_dbg
Platform Id: linux

Crash Type: DCHECK failure
Crash Address: 
Crash State:
  !node->is_rewritten() in pattern-rewriter.cc
  v8::internal::PatternRewriter::VisitRewritableExpression
  v8::internal::PatternRewriter::Visit
  
Sanitizer: address (ASAN)

Regressed: https://clusterfuzz.com/revisions?job=linux_asan_d8_dbg&range=47381:47382
Fixed: https://clusterfuzz.com/revisions?job=linux_asan_d8_dbg&range=47434:47435

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

See https://github.com/google/clusterfuzz-tools 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 22 by ClusterFuzz, Aug 19 2017

ClusterFuzz has detected this issue as fixed in range 47434:47435.

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

Fuzzer: inferno_js_fuzzer_c
Job Type: linux_asan_d8_dbg
Platform Id: linux

Crash Type: DCHECK failure
Crash Address: 
Crash State:
  !node->is_rewritten() in pattern-rewriter.cc
  
Sanitizer: address (ASAN)

Regressed: https://clusterfuzz.com/revisions?job=linux_asan_d8_dbg&range=47381:47382
Fixed: https://clusterfuzz.com/revisions?job=linux_asan_d8_dbg&range=47434:47435

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

See https://github.com/google/clusterfuzz-tools 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 23 by ClusterFuzz, Aug 19 2017

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

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

Comment 24 by sheriffbot@chromium.org, Aug 19 2017

Labels: -Restrict-View-SecurityTeam Restrict-View-SecurityNotify
Project Member

Comment 25 by ClusterFuzz, Aug 25 2017

Labels: Needs-Feedback
ClusterFuzz testcase 5613767668006912 is still reproducing on tip-of-tree build (trunk).

Please re-test your fix against this testcase and if the fix was incorrect or incomplete, please re-open the bug. Otherwise, ignore this notification and add ClusterFuzz-Wrong label.

Comment 26 by adamk@chromium.org, Aug 25 2017

Cc: infe...@chromium.org
Labels: ClusterFuzz-Wrong
I can't reproduce against tip-of-tree. Marking as Clusterfuzz-Wrong, since I'm fairly confident this is fixed, but CCing inferno@ in case there's something else I should be trying.
Labels: -ClusterFuzz-Wrong
We have made a bunch of changes on ClusterFuzz side, so resetting ClusterFuzz-Wrong label.
Labels: -ReleaseBlock-Stable
Project Member

Comment 29 by sheriffbot@chromium.org, Nov 25 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