Skip to content

Commit 73ced02

Browse files
Atul Kattirajeshpeter
authored andcommitted
[CVE-2020-1037] Ensure JIT bails out when there is an object marked as temporary during an implicit call, to prevent objects stored on the stack to be used outside of the function. This is done by preventing removal of the Bailout instruction for that case during the DeadStore pass of GlobOpt.
1 parent e245029 commit 73ced02

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/Backend/GlobOptBailOut.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1204,7 +1204,8 @@ GlobOpt::IsImplicitCallBailOutCurrentlyNeeded(IR::Instr * instr, Value const * s
12041204
NeedBailOnImplicitCallForLiveValues(block, isForwardPass) ||
12051205
NeedBailOnImplicitCallForCSE(block, isForwardPass) ||
12061206
NeedBailOnImplicitCallWithFieldOpts(block->loop, hasLiveFields) ||
1207-
NeedBailOnImplicitCallForArrayCheckHoist(block, isForwardPass)
1207+
NeedBailOnImplicitCallForArrayCheckHoist(block, isForwardPass) ||
1208+
(instr->HasBailOutInfo() && (instr->GetBailOutKind() & IR::BailOutMarkTempObject) != 0)
12081209
) &&
12091210
(!instr->HasTypeCheckBailOut() && MayNeedBailOnImplicitCall(instr, src1Val, src2Val)))
12101211
{

0 commit comments

Comments
 (0)