diff options
author | Alexandre Oliva <oliva@adacore.com> | 2021-10-28 00:51:02 -0300 |
---|---|---|
committer | Alexandre Oliva <oliva@gnu.org> | 2021-10-28 00:51:02 -0300 |
commit | 95bb87b2458bfab4f8557a2dfdc867fb14305455 (patch) | |
tree | f2631aca2523d8600de2182a5722c4d0b48f9100 /gcc/Makefile.in | |
parent | 5f9ef1339e9d0d709af6a70b60e584bf7decd761 (diff) | |
download | gcc-95bb87b2458bfab4f8557a2dfdc867fb14305455.tar.gz |
hardened conditionals
This patch introduces optional passes to harden conditionals used in
branches, and in computing boolean expressions, by adding redundant
tests of the reversed conditions, and trapping in case of unexpected
results. Though in abstract machines the redundant tests should never
fail, CPUs may be led to misbehave under certain kinds of attacks,
such as of power deprivation, and these tests reduce the likelihood of
going too far down an unexpected execution path.
for gcc/ChangeLog
* common.opt (fharden-compares): New.
(fharden-conditional-branches): New.
* doc/invoke.texi: Document new options.
* gimple-harden-conditionals.cc: New.
* Makefile.in (OBJS): Build it.
* passes.def: Add new passes.
* tree-pass.h (make_pass_harden_compares): Declare.
(make_pass_harden_conditional_branches): Declare.
for gcc/ada/ChangeLog
* doc/gnat_rm/security_hardening_features.rst
(Hardened Conditionals): New.
for gcc/testsuite/ChangeLog
* c-c++-common/torture/harden-comp.c: New.
* c-c++-common/torture/harden-cond.c: New.
Diffstat (limited to 'gcc/Makefile.in')
-rw-r--r-- | gcc/Makefile.in | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/gcc/Makefile.in b/gcc/Makefile.in index 658093c11c0..ec74a3a4bf3 100644 --- a/gcc/Makefile.in +++ b/gcc/Makefile.in @@ -1391,6 +1391,7 @@ OBJS = \ gimple-if-to-switch.o \ gimple-iterator.o \ gimple-fold.o \ + gimple-harden-conditionals.o \ gimple-laddress.o \ gimple-loop-interchange.o \ gimple-loop-jam.o \ |