Skip to content

Commit cd84a0b

Browse files
pleathThomas Moore (CHAKRA)
authored andcommitted
[CVE-2018-8500] RCE after cleanup of jitted entry points
1 parent f8aa306 commit cd84a0b

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

lib/Runtime/Base/FunctionBody.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2105,7 +2105,7 @@ namespace Js
21052105
{
21062106
FunctionTypeWeakRefList* typeList = EnsureFunctionObjectTypeList();
21072107

2108-
Assert(functionType != deferredPrototypeType);
2108+
Assert(functionType != deferredPrototypeType && functionType != undeferredFunctionType);
21092109
Recycler * recycler = this->GetScriptContext()->GetRecycler();
21102110
FunctionTypeWeakRef* weakRef = recycler->CreateWeakReferenceHandle(functionType);
21112111
typeList->SetAtFirstFreeSpot(weakRef);

lib/Runtime/Base/FunctionBody.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1088,8 +1088,10 @@ namespace Js
10881088
{
10891089
func(this->deferredPrototypeType);
10901090
}
1091-
// NOTE: We deliberately do not map the undeferredFunctionType here, since it's in the list
1092-
// of registered function object types we processed above.
1091+
if (this->undeferredFunctionType)
1092+
{
1093+
func(this->undeferredFunctionType);
1094+
}
10931095
}
10941096

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

0 commit comments

Comments
 (0)