clang-randstruct / llvm-project

Randomize the order of fields in a structure layout as a compile-time hardening feature
3 stars 1 forks source link

Automatic Structure Selection #5

Closed connorkuehl closed 5 years ago

connorkuehl commented 5 years ago

Is your feature request related to a problem? Please describe.

One of our stretch goals is to allow automatic structure selection with manual opt-out through an attribute like __no_randomize_layout

Describe the solution you'd like When the Clang compiler asks our plugin if we'd like to layout the structure, we can perform a series of checks to determine if this structure is a candidate for automatic selection. If the structure has the attribute __no_randomize_layout, we disqualify it. If not, and the structure is very simple, we will randomize its layout.

An example of a very simple structure would be a structure containing only function pointers. They are all the same size.

connorkuehl commented 5 years ago

Acceptance criteria: