Compatibility Request: Disable CET in project/building with DotNet10 for wider Win10 LTSC + 20H2/21H2 compatibility?
Due to (by default but not mandatory) many DotNet 10 based programs having CET / Kernel Stack Protection enabled, older installs of Windows 10 may not be able to run them, despite the Runtime itself generally working.
I am currently running KSA under Win10 20H2 (non-final patches, and I shall not update out of personal taste given no other programs do not run consistently aside from DotNet10 ones) by using Powershell to disable the UserShadowStack and it is running fine, hence me wanting to try a modloader. Many DotNet9 programs that worked on similar systems break by a DotNet10 upgrade due to this new default requirement, even if it brings basically nothing to performance or the basic program security features which are still kept (ie ASLR/DEP etc).
I have tried launching Borea and StarMap modloaders, and have found they both fail due to them being DotNet 10 programs with the (compatibility killing) defaults for this "feature".
"Fatal error. Your Windows doesn't fully support CET. Please install all available Windows updates."
Given KSA is running on my system, could CET be disabled in the build commands/vsproj details so it's one less potential blocker for older but stable OS users? I would appreciate the change being tested on existing (Win11 or Linux) systems to prove it has no impact to anyone but weird semi-frozen Win10 users.
Thanks
Hey, thanks for the detailed report and Issue
Short answer: we will not turn CET off in the Borea build, because that would lower the security of Borea for every Windows user, and we don't want to make that trade for a single very rare edge case.
For users that run into the same situation, run this once in an admin PowerShell, the same way you did it for KSA:
Set-ProcessMitigation -Name borea.exe -Disable UserShadowStack
Both the Borea app and the Borea CLI are called borea.exe on Windows, so this one line covers both.
I decided to not change the build for the following reasons:
- The change would affect everyone.
CETCompat=falseis not just a compatibility switch for older systems, it turns shadow stack protection off for every Windows user of Borea. Shadow stacks make a whole class of memory corruption exploits (return address overwrites, ROP chains) fail. Borea downloads and opens content from the internet (archives, images, icons, screenshots), and some of that goes through native libraries for images and text. AFAIK that is exactly where such bugs tend to live. ASLR and DEP would stay, but we would give up a layer that costs nothing on supported systems at this moment. - KSA is marked CET-compatible just like Borea. KSA only runs on your system because you already turned shadow stacks off for it. So you need the same workaround for the game anyway, and a change in Borea would not save you that step.
- The crash comes from a known bug in older Windows builds that a Windows update fixes. The .NET runtime refuses to start because the unpatched kernel cannot handle CET correctly, and current Windows 10 and Windows 11 builds have the fix. I get that you hold off on updates on purpose, and that's your call, but with the per-program opt-out above there is no need to weaken Borea for everybody. For almost everyone else, on any OS, i think it is reasonable to expect a system that gets its free security updates. We don't ask anyone to be on Windows 11 or the newest release of anything, just reasonably up to date.
I'll close this as not planned, but it stays searchable as this Issue in case someone else runs into the same thing. If the workaround doesn't do the trick for you, just let me know here and I'll take another look.
Understood, I actually put in the ticket because the mitigations disable command that worked for KSA didn't initially work.
I can confirm though, the program starts after re-applying and reloading my profile/powershell for debugging the logs. KSA worked instantly, so I thought it somehow didn't fix it in this case
My bad!