enable GS Cookie on OSX - #39143
Conversation
| #else | ||
| #ifdef __APPLE__ | ||
| #define READONLY_ATTR_ARGS section("__TEXT,__const") | ||
| #define READONLY_ATTR_ARGS section("__DATA,__const") |
There was a problem hiding this comment.
Did you mean to change it only for CORECLR_EMBEDDED? See the previous discussion: #36808 (comment).
There was a problem hiding this comment.
@am11 do you see a reason to make this different for embedded and regular coreclr? It seems to me that it is fine to have it in the __DATA,__const segment for both.
There was a problem hiding this comment.
If it is working for all cases, then sounds good. :)
I was just thinking that since we have __TEXT,__const _s_gsCookie in the osx binary from the beginning (and previous change did not alter the section type); considering the requirements such as Mojave hardened runtime, maybe we do not need to change the type for the existing (non-embedded) case.
There was a problem hiding this comment.
I've verified that it works with the non-embedded coreclr with Mojave hardened runtime (running the app signed and from bundle) too.
|
Thanks!! |
Use '#define READONLY_ATTR_ARGS section("__DATA,__const")' for the s_gsCookie
which puts it in read only data segment.
It used to be readonly TEXT segment and that was causing issues when container is the singlefile host executable.
Fixes:#38184