Re: [RFC 00/12] Introduce struct layout randomization feature

2019-03-12 Thread Connor Kuehl via cfe-commits
Thank you for the heads up! I put the patchset on Phabricator and sent the RFC out to the cfe-dev mailing list. On 3/9/19 1:59 AM, Roman Lebedev wrote: You probably want to submit this patchset to phabricator. It will get lost in mailing list. On Sat, Mar 9, 2019 at 1:38 AM Connor Kuehl via

[RFC 09/12] Implement record field randomization algorithms

2019-03-08 Thread Connor Kuehl via cfe-commits
Co-authored-by: Cole Nixon Co-authored-by: Connor Kuehl Co-authored-by: James Foster Co-authored-by: Jeff Takahashi Co-authored-by: Jordan Cantrell Co-authored-by: Nikk Forbus Co-authored-by: Tim Pugh --- clang/include/clang/AST/DeclBase.h| 2 + .../clang/AST/RecordFieldReorga

[RFC 12/12] Wire up Randstruct; intercept and randomize

2019-03-08 Thread Connor Kuehl via cfe-commits
Co-authored-by: Cole Nixon Co-authored-by: Connor Kuehl Co-authored-by: James Foster Co-authored-by: Jeff Takahashi Co-authored-by: Jordan Cantrell Co-authored-by: Nikk Forbus Co-authored-by: Tim Pugh --- clang/lib/AST/RecordLayoutBuilder.cpp | 20 1 file changed, 20 in

[RFC 08/12] Add automatic structure selection compiler switch

2019-03-08 Thread Connor Kuehl via cfe-commits
This compiler switch allows the Randstruct feature to automatically select structures to randomize even if they're not decorated with the randomize_layout attribute. Structures can "opt out" of selection by using the no_randomize_layout attribute while this feature is active. Co-authored-by: Cole

[RFC 11/12] Forward declare RecordFieldReorganizer

2019-03-08 Thread Connor Kuehl via cfe-commits
Co-authored-by: Cole Nixon Co-authored-by: Connor Kuehl Co-authored-by: James Foster Co-authored-by: Jeff Takahashi Co-authored-by: Jordan Cantrell Co-authored-by: Nikk Forbus Co-authored-by: Tim Pugh --- clang/include/clang/AST/Decl.h | 1 + 1 file changed, 1 insertion(+) diff --git a/cla

[RFC 10/12] Fix: Set tail pointer to null in field list

2019-03-08 Thread Connor Kuehl via cfe-commits
Co-authored-by: Cole Nixon Co-authored-by: Connor Kuehl Co-authored-by: James Foster Co-authored-by: Jeff Takahashi Co-authored-by: Jordan Cantrell Co-authored-by: Nikk Forbus Co-authored-by: Tim Pugh --- clang/lib/AST/DeclBase.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/clan

[RFC 05/12] Add warning for mutually exclusive attributes

2019-03-08 Thread Connor Kuehl via cfe-commits
Co-authored-by: Cole Nixon Co-authored-by: Connor Kuehl Co-authored-by: James Foster Co-authored-by: Jeff Takahashi Co-authored-by: Jordan Cantrell Co-authored-by: Nikk Forbus Co-authored-by: Tim Pugh --- clang/include/clang/Basic/DiagnosticASTKinds.td | 3 +++ 1 file changed, 3 insertions(

[RFC 04/12] Add randomize_layout warning for unions

2019-03-08 Thread Connor Kuehl via cfe-commits
There is no technical advantage to randomizing the order fields within unions as they all share the same offset. Co-authored-by: Cole Nixon Co-authored-by: Connor Kuehl Co-authored-by: James Foster Co-authored-by: Jeff Takahashi Co-authored-by: Jordan Cantrell Co-authored-by: Nikk Forbus Co-

[RFC 07/12] Add randstruct-seed compiler argument

2019-03-08 Thread Connor Kuehl via cfe-commits
To create reproducible builds, the randstruct feature can (and should) operate on a seed provided at compile time. Co-authored-by: Cole Nixon Co-authored-by: Connor Kuehl Co-authored-by: James Foster Co-authored-by: Jeff Takahashi Co-authored-by: Jordan Cantrell Co-authored-by: Nikk Forbus C

[RFC 06/12] Add globals to store command line arguments in

2019-03-08 Thread Connor Kuehl via cfe-commits
Co-authored-by: Cole Nixon Co-authored-by: Connor Kuehl Co-authored-by: James Foster Co-authored-by: Jeff Takahashi Co-authored-by: Jordan Cantrell Co-authored-by: Nikk Forbus Co-authored-by: Tim Pugh --- clang/include/clang/AST/RandstructSeed.h | 8 clang/lib/AST/CMakeLists.txt

[RFC 00/12] Introduce struct layout randomization feature

2019-03-08 Thread Connor Kuehl via cfe-commits
This patch set introduces structure field layout randomization into the Clang compiler. The Randstruct feature is a compile-time hardening technique that randomizes the field layout for designated structures of a code base. Admittedly, this is mostly useful for closed-source releases of code (sin

[RFC 03/12] Add no_randomize_layout attribute and handler

2019-03-08 Thread Connor Kuehl via cfe-commits
Co-authored-by: Cole Nixon Co-authored-by: Connor Kuehl Co-authored-by: James Foster Co-authored-by: Jeff Takahashi Co-authored-by: Jordan Cantrell Co-authored-by: Nikk Forbus Co-authored-by: Tim Pugh --- clang/include/clang/Basic/Attr.td | 7 +++ clang/lib/Sema

[RFC 01/12] Add documentation for randstruct attributes

2019-03-08 Thread Connor Kuehl via cfe-commits
Co-authored-by: Cole Nixon Co-authored-by: Connor Kuehl Co-authored-by: James Foster Co-authored-by: Jeff Takahashi Co-authored-by: Jordan Cantrell Co-authored-by: Nikk Forbus Co-authored-by: Tim Pugh --- clang/include/clang/Basic/AttrDocs.td | 45 +++ 1 file changed

[RFC 02/12] Add randomize_layout attribute and handler

2019-03-08 Thread Connor Kuehl via cfe-commits
Co-authored-by: Cole Nixon Co-authored-by: Connor Kuehl Co-authored-by: James Foster Co-authored-by: Jeff Takahashi Co-authored-by: Jordan Cantrell Co-authored-by: Nikk Forbus Co-authored-by: Tim Pugh --- clang/include/clang/Basic/Attr.td | 7 +++ clang/lib/Sema