Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for CET-enforced CFI/shadow stacks #44

Open
woodruffw opened this issue Mar 27, 2020 · 2 comments
Open

Support for CET-enforced CFI/shadow stacks #44

woodruffw opened this issue Mar 27, 2020 · 2 comments
Labels
enhancement New feature or request help wanted Extra attention is needed
Milestone

Comments

@woodruffw
Copy link
Member

Windows is adding hardware-backed stack protection via Intel's CET:

It looks like the relevant linker flag is /CETCOMPAT:

We should figure out which bit that flag sets in the DLL characteristics/load config and support it.

@woodruffw woodruffw added the enhancement New feature or request label Mar 27, 2020
@woodruffw
Copy link
Member Author

Looks like getting this information will be a little annoying: it's stored in the "extended DLL characteristics", which are an entry of type IMAGE_DEBUG_TYPE_EX_DLLCHARACTERISTICS=20 in the debug data directory entry vector.

In other words, we'll need to:

  • Grab the debug data directory entry vector via DIR_DEBUG
  • Walk it until we find an entry of type IMAGE_DEBUG_TYPE_EX_DLLCHARACTERISTICS
  • Check its data for the bitmask IMAGE_DLLCHARACTERISTICS_EX_CET_COMPAT (0x0001)

We could do this manually with the current pe-parse API, but it's probably also well-suited for a high-level API change (e.g. IterDebug).

@woodruffw
Copy link
Member Author

I'm going to push this to 2.1, since the right way to do it is with some pe-parse changes.

@woodruffw woodruffw modified the milestones: 2.0, 2.1 May 26, 2020
@woodruffw woodruffw added the help wanted Extra attention is needed label Oct 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant