You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[NativeAOT] Randomizing guard stack cookie not supported on some Unix platforms #73695
The Unix NativeAOT startup code includes a step where it randomizes the guard stack cookie that's baked into the binary's .rodata section. On multiple Unix-based game console platforms, this results in a runtime error because the .rodata section can never have its memory access permissions set to anything other than ReadOnly (presumably for security reasons).
It would be ideal if the InitGSCookie call were guarded by a feature define of some sort (FEATURE_RANDOMIZED_GS_COOKIES?) so that console ports don't have to have their own startup.cpp implementation just to work around this one feature.
It would be ideal if the InitGSCookie call were guarded by a feature define of some sort (FEATURE_RANDOMIZED_GS_COOKIES?) so that console ports don't have to have their own startup.cpp implementation just to work around this one feature.
Sounds like a good plan. Would you be able to submit a PR?
If the cookies are not random, an attacker can craft a stack corruption with a matching cookie, bypassing the stack guard. I don't think it matters if the value is 0 or 42. It can be kept at 0 to keep things simple.
Reacted by SupinePandora43
ghost added
in-prThere is an active PR which will close this issue when it is merged
Activity
MichalStrehovsky commentedon Aug 11, 2022
Sounds like a good plan. Would you be able to submit a PR?
TheSpydog commentedon Aug 11, 2022
Sure thing. One question -- if this feature is not defined, should the cookie still be set to 0 by default, or should we give it a different value?
MichalStrehovsky commentedon Aug 11, 2022
If the cookies are not random, an attacker can craft a stack corruption with a matching cookie, bypassing the stack guard. I don't think it matters if the value is 0 or 42. It can be kept at 0 to keep things simple.