Skip to content

Commit

Permalink
[CVE-2018-8500] RCE after cleanup of jitted entry points
Browse files Browse the repository at this point in the history
  • Loading branch information
pleath authored and Thomas Moore (CHAKRA) committed Oct 8, 2018
1 parent f8aa306 commit cd84a0b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/Runtime/Base/FunctionBody.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2105,7 +2105,7 @@ namespace Js
{
FunctionTypeWeakRefList* typeList = EnsureFunctionObjectTypeList();

Assert(functionType != deferredPrototypeType);
Assert(functionType != deferredPrototypeType && functionType != undeferredFunctionType);
Recycler * recycler = this->GetScriptContext()->GetRecycler();
FunctionTypeWeakRef* weakRef = recycler->CreateWeakReferenceHandle(functionType);
typeList->SetAtFirstFreeSpot(weakRef);
Expand Down
6 changes: 4 additions & 2 deletions lib/Runtime/Base/FunctionBody.h
Original file line number Diff line number Diff line change
Expand Up @@ -1088,8 +1088,10 @@ namespace Js
{
func(this->deferredPrototypeType);
}
// NOTE: We deliberately do not map the undeferredFunctionType here, since it's in the list
// of registered function object types we processed above.
if (this->undeferredFunctionType)
{
func(this->undeferredFunctionType);
}
}

static uint GetOffsetOfDeferredPrototypeType() { return static_cast<uint>(offsetof(Js::FunctionProxy, deferredPrototypeType)); }
Expand Down

0 comments on commit cd84a0b

Please # to comment.