Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compatibility with MSVC's /CETCOMPACT + on Windows 11 with CET (Control-flow Enforcement Technology) enabled #1889

Open
hzqst opened this issue Oct 16, 2023 · 0 comments

Comments

@hzqst
Copy link

hzqst commented Oct 16, 2023

Requirements to repro the issue

Windows 11 with CET (Control-flow Enforcement Technology) enabled

Visual Studio 2022

Description

Though this might be a won-fix or low-priority issue, I wrote this just in case someone else get into this and waste their life on debugging.

This issue occurs only when you get your .exe linked with linker flag /CETCOMPACT which was introduced in Visual Studio 2022, and you are running your .exe on Windows 11 with Control-flow Enforcement Technology enabled.

You will get a STATUS_STACK_BUFFER_OVERRUN exception at the last instruction of helper_**_***_mmu_x86_64

.text:00000001402F0C29                 mov     r14, [rsp+88h+arg_10]
.text:00000001402F0C31                 add     rsp, 50h
.text:00000001402F0C35                 pop     r15
.text:00000001402F0C37                 pop     r13
.text:00000001402F0C39                 pop     r12
.text:00000001402F0C3B                 pop     rdi
.text:00000001402F0C3C                 pop     rsi
.text:00000001402F0C3D                 pop     rbp
.text:00000001402F0C3E                 pop     rbx
.text:00000001402F0C3F                 retn                                     <------ exception here
.text:00000001402F0C3F helper_le_stw_mmu_x86_64 endp

1

The actual return address seems to be some generated code from tcg.

2

Version

1.0.0 ~ 1.0.3, and 2.0.0 (others are not tested)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant