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

Issue 747348 link

Starred by 1 user

Issue metadata

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



Sign in to add a comment

Stack-overflow in void WasmGenerator::Generate<

Project Member Reported by ClusterFuzz, Jul 21 2017

Issue description

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

Fuzzer: libFuzzer_v8_wasm_compile_fuzzer
Job Type: libfuzzer_chrome_asan
Platform Id: linux

Crash Type: Stack-overflow
Crash Address: 0x7ffed14e06e0
Crash State:
  void WasmGenerator::Generate<
  std::__1::function<void
  
Sanitizer: address (ASAN)

Regressed: https://clusterfuzz.com/revisions?job=libfuzzer_chrome_asan&range=453555:453570

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


Issue filed automatically.

See https://chromium.googlesource.com/chromium/src/+/master/testing/libfuzzer/reproducing.md for more information.
 
Cc: msrchandra@chromium.org
Labels: M-62 Test-Predator-Wrong
Owner: eholk@chromium.org
Status: Assigned (was: Untriaged)
Predator and CL did not provide any possible suspects.
Assigning to concern owner from CL using the file, "wasm-compile.cc"

https://chromium.googlesource.com/chromium/src/+log/d42421bec3f31371e904543c9e60b287dd3580ae..7df786793ee25b50c681e7e7093c5e11f990a681?pretty=fuller

Suspecting Commit#
https://chromium.googlesource.com/chromium/src/+/1a5a2759fff7a99cb6950f8e16da94731875ab76

@eholk -- Could you please look into the issue, kindly re-assign if this is not related to your changes.
Thank You.

Comment 2 by eholk@chromium.org, Jul 24 2017

The wasm-compile fuzzer works by taking the input string and doing a recursive divide and conquer algorithm to generate a Wasm module to then compile and execute. Some inputs can therefore lead to deep call stacks.

The bug is only in the test generator, not in any shipping code.

We should be able to fix this by rewriting the test generator to use an explicitly managed stack on the heap rather than the program stack. I will start working on this.

Comment 3 by eholk@chromium.org, Aug 30 2017

Cc: eholk@chromium.org
 Issue 760535  has been merged into this issue.
Cc: ahaas@chromium.org
Project Member

Comment 5 by ClusterFuzz, Oct 1 2017

Components: Blink>JavaScript
Labels: Test-Predator-AutoComponents
Automatically applying components based on information from OWNERS files. If this seems incorrect, please apply the Test-Predator-Wrong-Components label.

Comment 6 by mmoroz@chromium.org, Oct 24 2017

For more information, please see https://chromium.googlesource.com/chromium/src/+/master/testing/libfuzzer/reference.md.

The link referenced in the description is no longer valid.

(bulk edit)
Cc: clemensh@chromium.org
I just ran into the same issue when fuzzing Liftoff locally.
 Issue 781263  has been merged into this issue.
Since the bigger fix for this (mentioned in #2) seems to take a while, and the "wasm_compile" fuzzer is effectively nonfunctional till this is fixed, I went ahead and implemented a straight-forward fix: Just limit the recursion depth to a fixed value, and always generate a constant once that level is reached.

Eric, WDYT?
https://crrev.com/c/753329
Project Member

Comment 10 by bugdroid1@chromium.org, Nov 6 2017

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

commit dbddb56359c129741bb8bcf56aad6b2351bbe514
Author: Clemens Hammacher <clemensh@chromium.org>
Date: Mon Nov 06 10:27:13 2017

[wasm] Limit recursion depth in compile fuzzer

Fix a stack overflow in the wasm_compile_fuzzer by limiting the
recursion depth to 64. At this depth, we always just generate a
constant expression.

R=eholk@chromium.org, ahaas@chromium.org

Bug:  chromium:747348 
Change-Id: I236c1e07b8cb2b6c9181c549e850eca34fac6ec6
Reviewed-on: https://chromium-review.googlesource.com/753329
Reviewed-by: Eric Holk <eholk@chromium.org>
Reviewed-by: Andreas Haas <ahaas@chromium.org>
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#49134}
[modify] https://crrev.com/dbddb56359c129741bb8bcf56aad6b2351bbe514/test/fuzzer/wasm-compile.cc

Cc: -clemensh@chromium.org
Owner: clemensh@chromium.org
Status: Fixed (was: Assigned)
Thanks for fixing this!
Project Member

Comment 13 by ClusterFuzz, Nov 7 2017

ClusterFuzz has detected this issue as fixed in range 514142:514166.

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

Fuzzer: libFuzzer_v8_wasm_compile_fuzzer
Job Type: libfuzzer_chrome_asan
Platform Id: linux

Crash Type: Stack-overflow
Crash Address: 0x7fffbbd5bba0
Crash State:
  void v8::internal::wasm::fuzzer::WasmGenerator::Generate<
  std::__1::function<void
  
Sanitizer: address (ASAN)

Regressed: https://clusterfuzz.com/revisions?job=libfuzzer_chrome_asan&range=453555:453570
Fixed: https://clusterfuzz.com/revisions?job=libfuzzer_chrome_asan&range=514142:514166

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

See https://chromium.googlesource.com/chromium/src/+/master/testing/libfuzzer/reference.md 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 14 by ClusterFuzz, Nov 7 2017

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

If this is incorrect, please add ClusterFuzz-Wrong label and re-open the issue.
Labels: -Test-Predator-AutoComponents Test-Predator-Auto-Components

Sign in to add a comment