Menu

#1405 Windows: Enable Hardware-enforced Stack Protection

Committed
closed
nobody
5
2021-06-02
2021-05-07
mberchtold
No

On Windows, it may be a good idea to enable Hardware-enforced Stack Protection by passing the /CETCOMPAT option to the MSVC linker [1] by default. More details in [2,3].

References

  1. /CETCOMPAT (CET Shadow Stack compatible)
  2. Developer Guidance for Hardware-enforced Stack Protection
  3. Enabling Hardware-enforced Stack Protection (cetcompat) in Chrome

Discussion

  • Neil Hodgson

    Neil Hodgson - 2021-05-08
    • labels: --> lexilla, scintilla, scite, win32, msvc
    • Group: Initial --> Committed
     
  • Neil Hodgson

    Neil Hodgson - 2021-05-08

    The flag is not available with the linker included in Visual C++ 2017 which is required for supporting Windows XP. Therefore, it was added to the non-SUPPORT_XP branches in the *.mak files but was not added to *.vcxproj or *.pro files.

    Only very recent processors implement CET and I don't have one so can not test this change and do not know if there are any problems.

    Committed with [062ded] , [9d59d3] , and
    https://github.com/ScintillaOrg/lexilla/commit/4942d6d9f65f8dcc750876d3f437c3ef428ea982

     

    Related

    Commit: [9d59d3]
    Commit: [062ded]

    • mberchtold

      mberchtold - 2021-05-08

      Thank you.
      Visual Studio ignores elements in the .vcxproj file it doesn't recognize. So the following element can be added (under the <link> node) and it will be ignored before Visual Studio 2019 16.7 Preview 4:

      <CETCompat>true</CETCompat>
      
       

      Last edit: mberchtold 2021-05-08
  • Neil Hodgson

    Neil Hodgson - 2021-06-02
    • status: open --> closed
     

Log in to post a comment.