Make GC Stress 4/8 work with CET (#71085)
authorJan Vorlicek <janvorli@microsoft.com>
Wed, 22 Jun 2022 08:55:06 +0000 (10:55 +0200)
committerGitHub <noreply@github.com>
Wed, 22 Jun 2022 08:55:06 +0000 (10:55 +0200)
commit305144e2d798a5385e8a52137c3e3f4e2abc2cd5
tree8b647b50d6522437c43b1325c8eeb96c40f32101
parent93f46d21ed3a06f0c8067feb7b22aef2283d7448
Make GC Stress 4/8 work with CET (#71085)

* Make GC Stress 4/8 work with CET

This change makes the GC stress 4/8 work without redirection. It also
fixes a problem with missing unwinding of the shadow stack pointer
that was not discovered before. I've found it while testing this
change - it has manifested itself as a shadow stack overflow.

And there is one more fix. The VSD Resolve stub was problematic to unwind
through when null reference was passed as this to it. The stub had a push rdx
as the first instruction and the dereference of this happened after that. So
in case of the null, the call stack in the vectored exception handler contained
a phantom frame caused by a problem unwinding from the stub. That
caused incorrect updating of the shadow SP. I've fixed it by moving the dereference
before the push.
18 files changed:
src/coreclr/debug/ee/debugger.cpp
src/coreclr/debug/ee/debugger.h
src/coreclr/vm/amd64/Context.asm
src/coreclr/vm/amd64/cgencpu.h
src/coreclr/vm/amd64/excepamd64.cpp
src/coreclr/vm/amd64/virtualcallstubcpu.hpp
src/coreclr/vm/ceemain.cpp
src/coreclr/vm/common.h
src/coreclr/vm/encee.cpp
src/coreclr/vm/excep.cpp
src/coreclr/vm/exceptionhandling.cpp
src/coreclr/vm/gccover.cpp
src/coreclr/vm/jithelpers.cpp
src/coreclr/vm/stackwalk.cpp
src/coreclr/vm/threads.cpp
src/coreclr/vm/threads.h
src/coreclr/vm/threadsuspend.cpp
src/coreclr/vm/vars.hpp