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

Issue 610214 link

Starred by 1 user

Issue metadata

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



Sign in to add a comment

Heap-buffer-overflow in v8::internal::Simulator::LoadStoreHelper

Project Member Reported by ClusterFuzz, May 9 2016

Issue description

Detailed report: https://cluster-fuzz.appspot.com/testcase?key=5757631041372160

Fuzzer: decoder_langfuzz
Job Type: linux_asan_d8_v8_arm64_dbg
Platform Id: linux

Crash Type: Heap-buffer-overflow WRITE 8
Crash Address: 0x7fde134fc7f8
Crash State:
  v8::internal::Simulator::LoadStoreHelper
  v8::internal::Simulator::ExecuteInstruction
  v8::internal::Simulator::CheckPCSComplianceAndRun
  
Recommended Security Severity: High


Minimized Testcase (10.77 Kb): https://cluster-fuzz.appspot.com/download/AMIfv94mCHZYyG1LLjsQOmN-5M2u_XVzRJ-q3ATRhOJutS-z_iH3hrnqv2VjBV_O-j3-c4rfJejVW3hQoJtmbG51QWs9eCaNwGxa8X6QnAjkZG1PjBSxoG21_uFRMtEd8XnivgqzCwpdOUaFNLjPcnOJOCCM-55bMQ

Filer: mstarzinger

See https://dev.chromium.org/Home/chromium-security/bugs/reproducing-clusterfuzz-bugs for more information.
 
I can reproduce with the downloaded binary, but not yet with a local build. Need investigate more.
Project Member

Comment 2 by sheriffbot@chromium.org, May 9 2016

Labels: M-50
Project Member

Comment 3 by sheriffbot@chromium.org, May 9 2016

Labels: Pri-1
Cc: -mstarzinger@chromium.org
Owner: mstarzinger@chromium.org
Status: Assigned (was: Available)
mstarzinger: Would you mind taking another look or closing if this isn't actionable? (Need an owner since it's in the security queue)

Comment 5 by ishell@chromium.org, May 23 2016

Cc: mstarzinger@chromium.org
Owner: ishell@chromium.org
I managed to reproduce it, looking...

Comment 6 by ishell@chromium.org, May 23 2016

Labels: -Pri-1 Pri-2
What is happening here is when we are near the stack limit we call a function with so many arguments that it "overflows" the allocated JS stack buffer including the stack protection area before we manage to do a call (which will do a next stack limit check).

This is a simulator-only issue because on the real hardware where we use normal stack as a JS stack we will trigger the real stack overflow during attempt to push a next argument on the stack.
I think we can remove the security labels and decrease the priority.


In order to make V8 throw a StackOverflowError we could emit additional stack overflow checks after every Nth argument pushed on the stack.

Comment 7 by ishell@chromium.org, May 23 2016

Even simplier, if the number of arguments is bigger that some limit we can generate a stack overflow check before pushing all the arguments (we do similar check if the number of locals is too big).

Or we can check the worst case: if the maximum length of expression stack + current stack state will overflow. I'm not sure that we calculate the expression stack limit though.
Re comment #7: As discussed offline, AFAIK we don't know the maximum operand stack size ahead of time. But the full code generator keeps track of the current operand stack size (i.e. FullCodeGenerator::OperandStackDepthIncrement and Decrement), so at least we know the depth while generating code.

Comment 9 by aarya@google.com, May 24 2016

Labels: -Type-Bug-Security -reward-topanel -Restrict-View-SecurityTeam -Security_Impact-Stable -Security_Severity-High Type-Bug
Removing security labels since this is a simulator only issue as per c#6.
 Issue 620251  has been merged into this issue.
 Issue 656816  has been merged into this issue.
Project Member

Comment 12 by ClusterFuzz, Nov 1 2016

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

If this is incorrect, please add ClusterFuzz-Wrong label and re-open the issue.
 Issue 801790  has been merged into this issue.

Sign in to add a comment