summaryrefslogtreecommitdiff
path: root/src/gcdump
diff options
context:
space:
mode:
authorJan Vorlicek <janvorli@microsoft.com>2018-02-14 10:15:19 +0100
committerGitHub <noreply@github.com>2018-02-14 10:15:19 +0100
commit4fb985121e782822f45e5a92f251fb7b4382b016 (patch)
tree0cba62126474ad82bb55d60092342c0c3b87f32f /src/gcdump
parent27af160a1d969c373894f1895c48fa43022f4aaa (diff)
downloadcoreclr-4fb985121e782822f45e5a92f251fb7b4382b016.tar.gz
coreclr-4fb985121e782822f45e5a92f251fb7b4382b016.tar.bz2
coreclr-4fb985121e782822f45e5a92f251fb7b4382b016.zip
Fix ARM/ARM64 hijacking in tail calls (#16039)
* Fix ARM/ARM64 hijacking in tail calls This change fixes an issue that can happen when a function that has tail calls is hijacked. There are two potential issues: 1. When a function that tail calls another one is hijacked, the LR may be stored at a different location in the stack frame of the tail call target. So just by performing tail call, the hijacked location becomes invalid and unhijacking would corrupt stack by writing to that location. 2. There is a small window after the caller pops LR from the stack in its epilog and before the tail called function pushes LR in its prolog when the hijacked return address would not be not on the stack and so we would not be able to unhijack. The fix is to prevent hijacking of functions that contain tail calls. * Enable the tailcall hijacking test for ARM64 The test JIT/Methodical/tailcall_v4/hijacking should be passing now on ARM64.
Diffstat (limited to 'src/gcdump')
-rw-r--r--src/gcdump/gcdumpnonx86.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/gcdump/gcdumpnonx86.cpp b/src/gcdump/gcdumpnonx86.cpp
index ca8cc75792..7a7ebfe36b 100644
--- a/src/gcdump/gcdumpnonx86.cpp
+++ b/src/gcdump/gcdumpnonx86.cpp
@@ -433,8 +433,11 @@ size_t GCDump::DumpGCTable(PTR_CBYTE gcInfoBlock,
? "<none>"
: GetRegName(hdrdecoder.GetStackBaseRegister()));
+#ifdef _TARGET_AMD64_
gcPrintf("Wants Report Only Leaf: %u\n", hdrdecoder.WantsReportOnlyLeaf());
-
+#elif defined(_TARGET_ARM_) || defined(_TARGET_ARM64_)
+ gcPrintf("Has tailcalls: %u\n", hdrdecoder.HasTailCalls());
+#endif // _TARGET_AMD64_
#ifdef FIXED_STACK_PARAMETER_SCRATCH_AREA
gcPrintf("Size of parameter area: %x\n", hdrdecoder.GetSizeOfStackParameterArea());
#endif