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

Issue 724972 link

Starred by 2 users

Issue metadata

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

Blocked on:
issue 710844

Blocking:
issue 727560



Sign in to add a comment

CHECK failure: !v8::internal::FLAG_enable_slow_asserts || (object->IsJSArrayBuffer()) in object

Project Member Reported by ClusterFuzz, May 22 2017

Issue description

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

Fuzzer: inferno_js_fuzzer
Job Type: linux_asan_d8_v8_arm_dbg
Platform Id: linux

Crash Type: CHECK failure
Crash Address: 
Crash State:
  !v8::internal::FLAG_enable_slow_asserts || (object->IsJSArrayBuffer()) in object
  v8::internal::WasmMemoryObject::buffer
  v8::WebAssemblyMemoryGetBuffer
  
Sanitizer: address (ASAN)

Regressed: V8: 43658:43659

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


Issue filed automatically.

See https://dev.chromium.org/Home/chromium-security/bugs/reproducing-clusterfuzz-bugs for more information.
 
Labels: Restrict-View-SecurityTeam Type-Bug-Security
Owner: ishell@chromium.org
Status: Assigned (was: Untriaged)
Cast assert seems scary, hiding this to let v8 sheriff to triage.

Comment 2 by aarya@google.com, May 23 2017

Cc: ishell@chromium.org ahaas@chromium.org
Components: -Blink>JavaScript Blink>JavaScript>WebAssembly
Owner: clemensh@chromium.org

Comment 3 by aarya@google.com, May 25 2017

Cc: mstarzinger@chromium.org
Blockedon: 710844
Cc: -ishell@chromium.org -mstarzinger@chromium.org clemensh@chromium.org rossberg@chromium.org
Owner: gdeepti@chromium.org
Seems to be related to  crbug.com/710844 .

The problem is that if the initial memory size is 0, we don't allocate a JSArrayBuffer. The WasmMemoryObject created for the exported memory then does not have a buffer assigned (this is the design chosen in  crbug.com/710844 ).
But the {buffer} accessor still accesses it, and DCHECKs that it is indeed a JSArrayBuffer (which fails).

Repro:
=====================================================
load('test/mjsunit/wasm/wasm-constants.js');
load('test/mjsunit/wasm/wasm-module-builder.js');

var builder = new WasmModuleBuilder();
builder.addMemory(0, 0, true);
var instance = builder.instantiate();
instance.exports.memory.buffer;
=====================================================


Maybe a better fix would be to just create an empty JSArrayBuffer (pointing to {nullptr}, size 0) if the initial size is 0? AFAICT this would match the memory size and address we are emitting in the code for the case that there is no memory.
This might also remove a lot of the existing special cases for the "no initial memory" case.
Cc: ishell@chromium.org mstarzinger@chromium.org
 Issue 725273  has been merged into this issue.
Agreed, I don't think there is any reason not to allocate a zero-sized ArrayBuffer.
Blocking: 727560
For context, a zero-sized ArrayBuffer was not allocated because the ArrayBufferAllocator allocates a non null pointer to the backing store, and this was causing undefined behavior when patching the code on grow, and for when byteLength = NaN, figured in these cases it was safer to special case the the "no initial memory" case. I like clemensh@'s suggestion to create a dummy ArrayBuffer instead, sent out a CL that fixes this one as well as the test for 727560. 
Project Member

Comment 11 by ClusterFuzz, Jun 2 2017

ClusterFuzz has detected this issue as fixed in range 45664:45665.

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

Fuzzer: inferno_js_fuzzer
Job Type: linux_asan_d8_v8_arm_dbg
Platform Id: linux

Crash Type: CHECK failure
Crash Address: 
Crash State:
  !v8::internal::FLAG_enable_slow_asserts || (object->IsJSArrayBuffer()) in object
  v8::internal::WasmMemoryObject::buffer
  v8::WebAssemblyMemoryGetBuffer
  
Sanitizer: address (ASAN)

Regressed: V8: 43658:43659
Fixed: V8: 45664:45665

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


See https://dev.chromium.org/Home/chromium-security/bugs/reproducing-clusterfuzz-bugs 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 12 by ClusterFuzz, Jun 2 2017

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

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

Comment 13 by sheriffbot@chromium.org, Jun 2 2017

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

Comment 14 by sheriffbot@chromium.org, Sep 8 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