Add support for randomized guard stack cookies (#70806)
authorMichal Strehovský <MichalStrehovsky@users.noreply.github.com>
Mon, 20 Jun 2022 07:27:51 +0000 (16:27 +0900)
committerGitHub <noreply@github.com>
Mon, 20 Jun 2022 07:27:51 +0000 (16:27 +0900)
commitf00c8be37bf4573e36c2e897208bee3b81eef518
treea59be8608487c7ebc1c8f793c69afda9f8c14f71
parent1ec5ba53884aa8704416acd73299919a3ef8533b
Add support for randomized guard stack cookies (#70806)

The compiler was generating GS cookies, but the cookie was always an ASCII encoding of "Hi, mom!".

Make the cookie properly per-process randomized.

The randomization algorithm is same as in the CoreCLR VM.

Fixes #70071.
src/coreclr/nativeaot/Runtime/startup.cpp
src/coreclr/nativeaot/Runtime/unix/PalRedhawkUnix.cpp
src/coreclr/tools/aot/ILCompiler.RyuJit/JitInterface/CorInfoImpl.RyuJit.cs