diff options
author | Steve MacLean <Steve.MacLean@microsoft.com> | 2019-09-30 14:25:42 -0400 |
---|---|---|
committer | Hyungju Lee <leee.lee@samsung.com> | 2020-10-30 17:20:25 +0900 |
commit | cb22524bdb053fb652085deab60137dacb57f883 (patch) | |
tree | 00b7f2aca1e401f4a77ed70a7aed3904d929dd44 | |
parent | eeea0c108f9f798519ecefbbb357e04ed7641288 (diff) | |
download | coreclr-cb22524bdb053fb652085deab60137dacb57f883.tar.gz coreclr-cb22524bdb053fb652085deab60137dacb57f883.tar.bz2 coreclr-cb22524bdb053fb652085deab60137dacb57f883.zip |
Abort FuncEval on unaligned SP (for 3.1) (#26607)
* Abort FuncEval on unaligned SP (#26572)
* Check for nullity of the context in FuncEval setup SP alignment checks (#26911)
-rw-r--r-- | src/debug/ee/debugger.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/debug/ee/debugger.cpp b/src/debug/ee/debugger.cpp index a5e081c02e..82af1af568 100644 --- a/src/debug/ee/debugger.cpp +++ b/src/debug/ee/debugger.cpp @@ -15306,6 +15306,13 @@ HRESULT Debugger::FuncEvalSetup(DebuggerIPCE_FuncEvalInfo *pEvalInfo, return CORDBG_E_ILLEGAL_AT_GC_UNSAFE_POINT; } + if (filterContext != NULL && ::GetSP(filterContext) != ALIGN_DOWN(::GetSP(filterContext), STACK_ALIGN_SIZE)) + { + // SP is not aligned, we cannot do a FuncEval here + LOG((LF_CORDB, LL_INFO1000, "D::FES SP is unaligned")); + return CORDBG_E_FUNC_EVAL_BAD_START_POINT; + } + // Create a DebuggerEval to hold info about this eval while its in progress. Constructor copies the thread's // CONTEXT. DebuggerEval *pDE = new (interopsafe, nothrow) DebuggerEval(filterContext, pEvalInfo, fInException); @@ -15439,6 +15446,13 @@ HRESULT Debugger::FuncEvalSetupReAbort(Thread *pThread, Thread::ThreadAbortReque return CORDBG_E_ILLEGAL_AT_GC_UNSAFE_POINT; } + if (::GetSP(filterContext) != ALIGN_DOWN(::GetSP(filterContext), STACK_ALIGN_SIZE)) + { + // SP is not aligned, we cannot do a FuncEval here + LOG((LF_CORDB, LL_INFO1000, "D::FESRA: SP is unaligned")); + return CORDBG_E_FUNC_EVAL_BAD_START_POINT; + } + // Create a DebuggerEval to hold info about this eval while its in progress. Constructor copies the thread's // CONTEXT. DebuggerEval *pDE = new (interopsafe, nothrow) DebuggerEval(filterContext, pThread, requester); |