Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Fix return address hijacking in the stack probing loop #28119

Merged
merged 1 commit into from
Jan 15, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions src/vm/threadsuspend.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6727,6 +6727,17 @@ void HandleGCSuspensionForInterruptedThread(CONTEXT *interruptedContext)

BOOL unused;

#if defined(FEATURE_PAL) && (defined(_TARGET_AMD64_) || defined(_TARGET_X86_))
// Stack probing loop that JIT generates in prolog on x64 / x86 Unix for methods with
// large frame is not unwindable, so it is not possible to get the return address location
// for hijacking.
// This is a hotfix for release/3.1 only.
if (IsIPInProlog(&codeInfo) && codeInfo.GetFixedStackSize() >= 0x3000)
{
return;
}
#endif // _TARGET_UNIX_ && (TARGET_AMD64 || TARGET_X86)

if (IsIPInEpilog(interruptedContext, &codeInfo, &unused))
return;

Expand Down