Page MenuHomePhabricator

sconstab (Scott Constable)
User

Projects

User does not belong to any projects.

User Details

User Since
Sun, Mar 8, 1:33 PM (3 w, 4 d)

Recent Activity

Yesterday

sconstab updated the diff for D76812: [X86] Add Indirect Thunk Support to X86 to mitigate Load Value Injection (LVI) [3/3].

@craig.topper I think that removing spurious MBBs is not really necessary because the emitted machine code doesn't contain the spurious MBBs, from what I have observed. I added the check anyways, if only because others may look at this discrepancy and have the same question.

Wed, Apr 1, 12:57 PM

Tue, Mar 31

sconstab added a comment to D76811: [X86] Refactor X86IndirectThunks.cpp to Accommodate Mitigations other than Retpoline [2/3].

4x agree.

Tue, Mar 31, 5:06 PM
sconstab added a comment to D76811: [X86] Refactor X86IndirectThunks.cpp to Accommodate Mitigations other than Retpoline [2/3].

By the way, I had initially implemented this patch with a pure virtual base class and a retpoline thunk (and later LVI thunk) class that implements the interface. However, I could not for the life of me structure the classes in a manner that would allow the compiler to devirtualize. Using CRTP admittedly sacrifices some readability, but it does not prevent the compiler from inlining RetpolineThunkInserter's methods.

Asking to learn here. I've not heard of CRTP and don't quite understand your explanation.

Recommend the article here: https://en.wikipedia.org/wiki/Curiously_recurring_template_pattern

  • What do you mean by allowing the compiler to devirtualize?

Suppose you have

struct Base { virtual void foo() = 0; };
struct D1 : Base { void foo() { … }; };
struct D2 final : Base { void foo() { … }; };
Tue, Mar 31, 3:27 PM
sconstab updated the diff for D76812: [X86] Add Indirect Thunk Support to X86 to mitigate Load Value Injection (LVI) [3/3].

Added a comment to the header of X86IndirectThunks.cpp to indicate support for LVI thunks.

Tue, Mar 31, 7:44 AM
sconstab added a comment to D76811: [X86] Refactor X86IndirectThunks.cpp to Accommodate Mitigations other than Retpoline [2/3].

By the way, I had initially implemented this patch with a pure virtual base class and a retpoline thunk (and later LVI thunk) class that implements the interface. However, I could not for the life of me structure the classes in a manner that would allow the compiler to devirtualize. Using CRTP admittedly sacrifices some readability, but it does not prevent the compiler from inlining RetpolineThunkInserter's methods.

Tue, Mar 31, 7:44 AM
sconstab updated the diff for D76810: [X86][NFC] Generalize the naming of "Retpoline Thunks" and related code to "Indirect Thunks" [1/3].

Updated to address @zbrid and @craig.topper 's comments.

Tue, Mar 31, 7:44 AM

Wed, Mar 25

sconstab retitled D76812: [X86] Add Indirect Thunk Support to X86 to mitigate Load Value Injection (LVI) [3/3] from Add Indirect Thunk Support to X86 to mitigate Load Value Injection (LVI) [3/3] to [X86] Add Indirect Thunk Support to X86 to mitigate Load Value Injection (LVI) [3/3].
Wed, Mar 25, 4:49 PM
sconstab added a child revision for D76811: [X86] Refactor X86IndirectThunks.cpp to Accommodate Mitigations other than Retpoline [2/3]: D76812: [X86] Add Indirect Thunk Support to X86 to mitigate Load Value Injection (LVI) [3/3].
Wed, Mar 25, 4:49 PM
sconstab added a child revision for D76810: [X86][NFC] Generalize the naming of "Retpoline Thunks" and related code to "Indirect Thunks" [1/3]: D76811: [X86] Refactor X86IndirectThunks.cpp to Accommodate Mitigations other than Retpoline [2/3].
Wed, Mar 25, 4:49 PM
sconstab added a parent revision for D76812: [X86] Add Indirect Thunk Support to X86 to mitigate Load Value Injection (LVI) [3/3]: D76811: [X86] Refactor X86IndirectThunks.cpp to Accommodate Mitigations other than Retpoline [2/3].
Wed, Mar 25, 4:49 PM
sconstab added a parent revision for D76811: [X86] Refactor X86IndirectThunks.cpp to Accommodate Mitigations other than Retpoline [2/3]: D76810: [X86][NFC] Generalize the naming of "Retpoline Thunks" and related code to "Indirect Thunks" [1/3].
Wed, Mar 25, 4:49 PM
sconstab abandoned D76639: Change X86RetpolineThunks from a MachineFunctionPass to a ModulePass.

Due to performance/memory reasons, it is not a good idea to refactor this pass into a ModulePass.

Wed, Mar 25, 4:49 PM
sconstab created D76812: [X86] Add Indirect Thunk Support to X86 to mitigate Load Value Injection (LVI) [3/3].
Wed, Mar 25, 4:49 PM
sconstab created D76811: [X86] Refactor X86IndirectThunks.cpp to Accommodate Mitigations other than Retpoline [2/3].
Wed, Mar 25, 4:49 PM
sconstab created D76810: [X86][NFC] Generalize the naming of "Retpoline Thunks" and related code to "Indirect Thunks" [1/3].
Wed, Mar 25, 4:49 PM

Tue, Mar 24

sconstab retitled D75938: [DO NOT MERGE] X86 Mitigate for Load Value Injection (LVI)--All Code from X86 Mitigate for Load Value Injection (LVI)--All Code to [DO NOT MERGE] X86 Mitigate for Load Value Injection (LVI)--All Code.
Tue, Mar 24, 6:36 PM · Restricted Project

Mon, Mar 23

sconstab added a comment to D76639: Change X86RetpolineThunks from a MachineFunctionPass to a ModulePass.

This probably has a hidden side effect on the pass manager construction. Inserting a module pass into the middle of the pipeline effectively introduces a serialization point in the middle of the pipeline. This means all functions have to reach this point in the pipeline before any function can continue. I believe this will cause the Machine IR for all functions to become resident in memory at once. This will substantially increase the memory usage of the compiler.

Mon, Mar 23, 1:38 PM
sconstab created D76639: Change X86RetpolineThunks from a MachineFunctionPass to a ModulePass.
Mon, Mar 23, 1:06 PM

Thu, Mar 19

sconstab created D76458: Add Indirect Thunk Support to X86 to mitigate Load Value Injection (LVI) [by modifying X86RetpolineThunks.cpp].
Thu, Mar 19, 3:22 PM

Wed, Mar 18

sconstab updated the diff for D75937: Add Support to X86 for Load Hardening to Mitigate Load Value Injection (LVI) [5/6].

One fix to correctly count the number of fences inserted.

Wed, Mar 18, 7:32 PM · Restricted Project
sconstab added inline comments to D75936: Add a Pass to X86 that builds a Condensed CFG for Load Value Injection (LVI) Gadgets [4/6].
Wed, Mar 18, 7:32 PM · Restricted Project
sconstab updated the diff for D75936: Add a Pass to X86 that builds a Condensed CFG for Load Value Injection (LVI) Gadgets [4/6].

Addressed Zola's comments.

Wed, Mar 18, 7:32 PM · Restricted Project
sconstab added inline comments to D75935: Add RET-hardening Support to X86 to mitigate Load Value Injection (LVI) [3/6].
Wed, Mar 18, 5:55 PM · Restricted Project
sconstab updated the diff for D75935: Add RET-hardening Support to X86 to mitigate Load Value Injection (LVI) [3/6].

Addressed Zola's comments.

Wed, Mar 18, 5:55 PM · Restricted Project
sconstab added inline comments to D75934: Add Indirect Thunk Support to X86 to mitigate Load Value Injection (LVI) [2/6].
Wed, Mar 18, 3:46 PM · Restricted Project
sconstab updated the diff for D75934: Add Indirect Thunk Support to X86 to mitigate Load Value Injection (LVI) [2/6].

Addressed some of Zola's comments, and removed some unnecessary assertions.

Wed, Mar 18, 3:46 PM · Restricted Project

Tue, Mar 17

sconstab updated the diff for D76158: Add inline assembly load hardening mitigation for Load Value Injection (LVI) on X86 [6/6].

Added comments with pointers to LVI public documentation.

Tue, Mar 17, 10:10 AM

Mon, Mar 16

sconstab added inline comments to D76158: Add inline assembly load hardening mitigation for Load Value Injection (LVI) on X86 [6/6].
Mon, Mar 16, 1:07 PM
sconstab updated the diff for D76158: Add inline assembly load hardening mitigation for Load Value Injection (LVI) on X86 [6/6].

Separated out the load/cfi hardening functionality into two separate member functions.

Mon, Mar 16, 1:07 PM
sconstab retitled D76158: Add inline assembly load hardening mitigation for Load Value Injection (LVI) on X86 [6/6] from Add inline assembly load hardening mitigation for Load Value Injection (LVI) on X86 to Add inline assembly load hardening mitigation for Load Value Injection (LVI) on X86 [6/6].
Mon, Mar 16, 9:48 AM
sconstab retitled D75937: Add Support to X86 for Load Hardening to Mitigate Load Value Injection (LVI) [5/6] from Add Support to X86 for Load Hardening to Mitigate Load Value Injection (LVI) [5/5] to Add Support to X86 for Load Hardening to Mitigate Load Value Injection (LVI) [5/6].
Mon, Mar 16, 9:48 AM · Restricted Project
sconstab retitled D75935: Add RET-hardening Support to X86 to mitigate Load Value Injection (LVI) [3/6] from Add RET-hardening Support to X86 to mitigate Load Value Injection (LVI) [3/5] to Add RET-hardening Support to X86 to mitigate Load Value Injection (LVI) [3/6].
Mon, Mar 16, 9:47 AM · Restricted Project
sconstab retitled D75934: Add Indirect Thunk Support to X86 to mitigate Load Value Injection (LVI) [2/6] from Add Indirect Thunk Support to X86 to mitigate Load Value Injection (LVI) [2/5] to Add Indirect Thunk Support to X86 to mitigate Load Value Injection (LVI) [2/6].
Mon, Mar 16, 9:47 AM · Restricted Project
sconstab retitled D75936: Add a Pass to X86 that builds a Condensed CFG for Load Value Injection (LVI) Gadgets [4/6] from Add a Pass to X86 that builds a Condensed CFG for Load Value Injection (LVI) Gadgets [4/5] to Add a Pass to X86 that builds a Condensed CFG for Load Value Injection (LVI) Gadgets [4/6].
Mon, Mar 16, 9:47 AM · Restricted Project
sconstab updated the diff for D75938: [DO NOT MERGE] X86 Mitigate for Load Value Injection (LVI)--All Code.

Added updates for inline assembly mitigation and warnings.

Mon, Mar 16, 9:47 AM · Restricted Project
sconstab retitled D75932: Move RDF from Hexagon to Codegen [1/6] from Move RDF from Hexagon to Codegen [1/5] to Move RDF from Hexagon to Codegen [1/6].
Mon, Mar 16, 9:47 AM · Restricted Project
sconstab updated the summary of D76158: Add inline assembly load hardening mitigation for Load Value Injection (LVI) on X86 [6/6].
Mon, Mar 16, 9:47 AM
sconstab updated the diff for D76158: Add inline assembly load hardening mitigation for Load Value Injection (LVI) on X86 [6/6].

Added warnings for instructions that cannot be automatically mitigating by inserting an LFENCE.

Mon, Mar 16, 9:47 AM

Fri, Mar 13

sconstab added parent revisions for D76158: Add inline assembly load hardening mitigation for Load Value Injection (LVI) on X86 [6/6]: D75934: Add Indirect Thunk Support to X86 to mitigate Load Value Injection (LVI) [2/6], D75936: Add a Pass to X86 that builds a Condensed CFG for Load Value Injection (LVI) Gadgets [4/6], D75937: Add Support to X86 for Load Hardening to Mitigate Load Value Injection (LVI) [5/6], D75935: Add RET-hardening Support to X86 to mitigate Load Value Injection (LVI) [3/6].
Fri, Mar 13, 2:01 PM
sconstab added a child revision for D75934: Add Indirect Thunk Support to X86 to mitigate Load Value Injection (LVI) [2/6]: D76158: Add inline assembly load hardening mitigation for Load Value Injection (LVI) on X86 [6/6].
Fri, Mar 13, 2:01 PM · Restricted Project
sconstab added a child revision for D75936: Add a Pass to X86 that builds a Condensed CFG for Load Value Injection (LVI) Gadgets [4/6]: D76158: Add inline assembly load hardening mitigation for Load Value Injection (LVI) on X86 [6/6].
Fri, Mar 13, 2:01 PM · Restricted Project
sconstab added a child revision for D75937: Add Support to X86 for Load Hardening to Mitigate Load Value Injection (LVI) [5/6]: D76158: Add inline assembly load hardening mitigation for Load Value Injection (LVI) on X86 [6/6].
Fri, Mar 13, 2:01 PM · Restricted Project
sconstab added a child revision for D75935: Add RET-hardening Support to X86 to mitigate Load Value Injection (LVI) [3/6]: D76158: Add inline assembly load hardening mitigation for Load Value Injection (LVI) on X86 [6/6].
Fri, Mar 13, 2:01 PM · Restricted Project
sconstab updated the diff for D75938: [DO NOT MERGE] X86 Mitigate for Load Value Injection (LVI)--All Code.

Added inline assembly mitigation.

Fri, Mar 13, 2:01 PM · Restricted Project
sconstab created D76158: Add inline assembly load hardening mitigation for Load Value Injection (LVI) on X86 [6/6].
Fri, Mar 13, 2:01 PM

Thu, Mar 12

sconstab updated the diff for D75935: Add RET-hardening Support to X86 to mitigate Load Value Injection (LVI) [3/6].

Re-added

->addRegisterDead(X86::EFLAGS, TRI);

To address Craig's comment.

Thu, Mar 12, 3:11 PM · Restricted Project
sconstab added inline comments to D75935: Add RET-hardening Support to X86 to mitigate Load Value Injection (LVI) [3/6].
Thu, Mar 12, 1:34 PM · Restricted Project
sconstab added a comment to D75939: [x86][seses] Introduce SESES pass for LVI.

What is the intention of this set of patches in relation to D75938? It was unclear to me whether you intended to commit this implementation or were just offering it as an alternative for discussion.

I offer these patches for discussion and will upstream in folks in the LLVM community would like them to be upstreamed. If this approach and the other approach are both desired by the LLVM community, then I will work with Intel to decide whether to merge the approaches into a single framework/pass or not.

If you have thoughts on whether or not this should be upstreamed, please let me know and feel free to add to the discussion.

For code review comments:

  • I will address these shortly.
Thu, Mar 12, 8:40 AM · Restricted Project
sconstab added a reviewer for D75936: Add a Pass to X86 that builds a Condensed CFG for Load Value Injection (LVI) Gadgets [4/6]: kparzysz.
Thu, Mar 12, 8:40 AM · Restricted Project

Wed, Mar 11

sconstab updated the diff for D75935: Add RET-hardening Support to X86 to mitigate Load Value Injection (LVI) [3/6].

In the case where there is no scratch register available, changed from using OR 0 to SHL 0 to load/store from/to RSP. The benefit of SHL 0 is that it does not clobber EFLAGS.

Wed, Mar 11, 3:32 PM · Restricted Project
sconstab updated the diff for D75936: Add a Pass to X86 that builds a Condensed CFG for Load Value Injection (LVI) Gadgets [4/6].

Added help text for the CLI options

Wed, Mar 11, 3:19 PM · Restricted Project
sconstab updated the diff for D75934: Add Indirect Thunk Support to X86 to mitigate Load Value Injection (LVI) [2/6].

Added help text for driver CLI options.

Wed, Mar 11, 3:19 PM · Restricted Project
sconstab updated the summary of D75937: Add Support to X86 for Load Hardening to Mitigate Load Value Injection (LVI) [5/6].
Wed, Mar 11, 2:07 PM · Restricted Project
sconstab updated the summary of D75938: [DO NOT MERGE] X86 Mitigate for Load Value Injection (LVI)--All Code.
Wed, Mar 11, 2:07 PM · Restricted Project
sconstab retitled D75937: Add Support to X86 for Load Hardening to Mitigate Load Value Injection (LVI) [5/6] from Add Support to X86 for Load Hardening to Mitigate Load Value Injection (LVI) to Add Support to X86 for Load Hardening to Mitigate Load Value Injection (LVI) [5/5].
Wed, Mar 11, 1:01 PM · Restricted Project
sconstab updated the summary of D75938: [DO NOT MERGE] X86 Mitigate for Load Value Injection (LVI)--All Code.
Wed, Mar 11, 1:01 PM · Restricted Project
sconstab retitled D75934: Add Indirect Thunk Support to X86 to mitigate Load Value Injection (LVI) [2/6] from Add Indirect Thunk Support to X86 to mitigate Load Value Injection (LVI) to Add Indirect Thunk Support to X86 to mitigate Load Value Injection (LVI) [2/5].
Wed, Mar 11, 1:01 PM · Restricted Project
sconstab retitled D75936: Add a Pass to X86 that builds a Condensed CFG for Load Value Injection (LVI) Gadgets [4/6] from Add a Pass to X86 that builds a Condensed CFG for Load Value Injection (LVI) Gadgets to Add a Pass to X86 that builds a Condensed CFG for Load Value Injection (LVI) Gadgets [4/5].
Wed, Mar 11, 1:01 PM · Restricted Project
sconstab retitled D75935: Add RET-hardening Support to X86 to mitigate Load Value Injection (LVI) [3/6] from Add RET-hardening Support to X86 to mitigate Load Value Injection (LVI) to Add RET-hardening Support to X86 to mitigate Load Value Injection (LVI) [3/5].
Wed, Mar 11, 1:01 PM · Restricted Project
sconstab retitled D75932: Move RDF from Hexagon to Codegen [1/6] from Move RDF from Hexagon to Codegen to Move RDF from Hexagon to Codegen [1/5].
Wed, Mar 11, 1:01 PM · Restricted Project
sconstab added a child revision for D75936: Add a Pass to X86 that builds a Condensed CFG for Load Value Injection (LVI) Gadgets [4/6]: D75937: Add Support to X86 for Load Hardening to Mitigate Load Value Injection (LVI) [5/6].
Wed, Mar 11, 1:01 PM · Restricted Project
sconstab added a parent revision for D75937: Add Support to X86 for Load Hardening to Mitigate Load Value Injection (LVI) [5/6]: D75936: Add a Pass to X86 that builds a Condensed CFG for Load Value Injection (LVI) Gadgets [4/6].
Wed, Mar 11, 1:01 PM · Restricted Project
sconstab added a parent revision for D75935: Add RET-hardening Support to X86 to mitigate Load Value Injection (LVI) [3/6]: D75934: Add Indirect Thunk Support to X86 to mitigate Load Value Injection (LVI) [2/6].
Wed, Mar 11, 1:01 PM · Restricted Project
sconstab added child revisions for D75932: Move RDF from Hexagon to Codegen [1/6]: D75937: Add Support to X86 for Load Hardening to Mitigate Load Value Injection (LVI) [5/6], D75936: Add a Pass to X86 that builds a Condensed CFG for Load Value Injection (LVI) Gadgets [4/6].
Wed, Mar 11, 1:01 PM · Restricted Project
sconstab added a parent revision for D75936: Add a Pass to X86 that builds a Condensed CFG for Load Value Injection (LVI) Gadgets [4/6]: D75932: Move RDF from Hexagon to Codegen [1/6].
Wed, Mar 11, 1:01 PM · Restricted Project
sconstab added a child revision for D75934: Add Indirect Thunk Support to X86 to mitigate Load Value Injection (LVI) [2/6]: D75935: Add RET-hardening Support to X86 to mitigate Load Value Injection (LVI) [3/6].
Wed, Mar 11, 1:01 PM · Restricted Project
sconstab added a parent revision for D75937: Add Support to X86 for Load Hardening to Mitigate Load Value Injection (LVI) [5/6]: D75932: Move RDF from Hexagon to Codegen [1/6].
Wed, Mar 11, 1:01 PM · Restricted Project
sconstab added a reviewer for D75937: Add Support to X86 for Load Hardening to Mitigate Load Value Injection (LVI) [5/6]: george.burgess.iv.
Wed, Mar 11, 9:37 AM · Restricted Project
sconstab added a reviewer for D75936: Add a Pass to X86 that builds a Condensed CFG for Load Value Injection (LVI) Gadgets [4/6]: george.burgess.iv.
Wed, Mar 11, 9:37 AM · Restricted Project
sconstab added a reviewer for D75938: [DO NOT MERGE] X86 Mitigate for Load Value Injection (LVI)--All Code: george.burgess.iv.
Wed, Mar 11, 9:37 AM · Restricted Project
sconstab added a reviewer for D75934: Add Indirect Thunk Support to X86 to mitigate Load Value Injection (LVI) [2/6]: george.burgess.iv.
Wed, Mar 11, 9:37 AM · Restricted Project
sconstab added a reviewer for D75932: Move RDF from Hexagon to Codegen [1/6]: george.burgess.iv.
Wed, Mar 11, 9:37 AM · Restricted Project
sconstab added a reviewer for D75935: Add RET-hardening Support to X86 to mitigate Load Value Injection (LVI) [3/6]: george.burgess.iv.
Wed, Mar 11, 9:37 AM · Restricted Project

Tue, Mar 10

sconstab created D75938: [DO NOT MERGE] X86 Mitigate for Load Value Injection (LVI)--All Code.
Tue, Mar 10, 10:19 AM · Restricted Project
sconstab created D75937: Add Support to X86 for Load Hardening to Mitigate Load Value Injection (LVI) [5/6].
Tue, Mar 10, 10:19 AM · Restricted Project
sconstab created D75935: Add RET-hardening Support to X86 to mitigate Load Value Injection (LVI) [3/6].
Tue, Mar 10, 10:19 AM · Restricted Project
sconstab created D75936: Add a Pass to X86 that builds a Condensed CFG for Load Value Injection (LVI) Gadgets [4/6].
Tue, Mar 10, 10:19 AM · Restricted Project
sconstab created D75934: Add Indirect Thunk Support to X86 to mitigate Load Value Injection (LVI) [2/6].
Tue, Mar 10, 10:19 AM · Restricted Project
sconstab created D75932: Move RDF from Hexagon to Codegen [1/6].
Tue, Mar 10, 10:19 AM · Restricted Project