[PATCH] D54555: [clang][slh] add attribute for speculative load hardening

Aaron Ballman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 20 06:24:02 PST 2018


aaron.ballman added inline comments.


================
Comment at: clang/include/clang/Basic/Attr.td:3092
+  let Spellings = [Clang<"speculative_load_hardening">];
+  let Subjects = SubjectList<[Function], ErrorDiag>;
+  let Documentation = [SpeculativeLoadHardeningDocs];
----------------
On reflection, I think this could make sense being applied to Obj-C methods as well, correct?


================
Comment at: clang/include/clang/Basic/AttrDocs.td:3611
+  let Content = [{
+This attribute indicates that
+`Speculative Load Hardening <https://llvm.org/docs/SpeculativeLoadHardening.html>`_
----------------
I think the docs should also mention that the attribute can only be applied to a function declaration (and Obj-C methods if you decide to update the `SubjectList` above).


================
Comment at: clang/include/clang/Basic/AttrDocs.td:3614
+should be enabled for the function body. This is a best-effort attempt to
+mitigate all known speculative execution information leak vulnerabilities by hardening loads that are executed speculatively. Typically these vulnerabilities are classified as "Spectre
+variant #1" vulnerabilities. Notably, this does not attempt to
----------------
80-col


Repository:
  rL LLVM

https://reviews.llvm.org/D54555





More information about the llvm-commits mailing list