summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorAmbroise Vincent <ambroise.vincent@arm.com>2019-06-05 15:40:29 +0100
committerAmbroise Vincent <ambroise.vincent@arm.com>2019-06-12 10:18:48 +0100
commit2e302371734dd1c809cb44683d353b81d7aa9c85 (patch)
tree4ff03a2a350681a20f60e8fb9c4c0d9fcb3fc626 /docs
parentdc593ddc07fc942fd1c43106b7783550a8ad6714 (diff)
doc: Isolate security-related build options
Reference security specific build options from the user guide. Change-Id: I0e1efbf47d914cf3c473104175c702ff1a80eb67 Signed-off-by: Ambroise Vincent <ambroise.vincent@arm.com>
Diffstat (limited to 'docs')
-rw-r--r--docs/process/index.rst1
-rw-r--r--docs/process/security-hardening.rst58
2 files changed, 59 insertions, 0 deletions
diff --git a/docs/process/index.rst b/docs/process/index.rst
index aa5d6bba..a870c8f5 100644
--- a/docs/process/index.rst
+++ b/docs/process/index.rst
@@ -12,3 +12,4 @@ Processes & Policies
coding-guidelines
contributing
faq
+ security-hardening
diff --git a/docs/process/security-hardening.rst b/docs/process/security-hardening.rst
new file mode 100644
index 00000000..e2c68b8f
--- /dev/null
+++ b/docs/process/security-hardening.rst
@@ -0,0 +1,58 @@
+Security hardening
+==================
+
+This page contains guidance on what to check for additional security measures,
+including build options that can be modified to improve security or catch issues
+early in development.
+
+Build options
+-------------
+
+Several build options can be used to check for security issues. Refer to the
+`user guide`_ for detailed information on the specific build options.
+
+- The ``BRANCH_PROTECTION`` build flag can be used to enable Pointer
+ Authentication and Branch Target Identification.
+
+- The ``ENABLE_STACK_PROTECTOR`` build flag can be used to identify buffer
+ overflows.
+
+- The ``W`` build flag can be used to enable a number of compiler warning
+ options to detect potentially incorrect code.
+
+ - W=0 (default value)
+
+ The ``Wunused`` with ``Wno-unused-parameter``, ``Wdisabled-optimization``
+ and ``Wvla`` flags are enabled.
+
+ The ``Wunused-but-set-variable``, ``Wmaybe-uninitialized`` and
+ ``Wpacked-bitfield-compat`` are GCC specific flags that are also enabled.
+
+ - W=1
+
+ Adds ``Wextra``, ``Wmissing-declarations``, ``Wmissing-format-attribute``,
+ ``Wmissing-prototypes``, ``Wold-style-definition`` and
+ ``Wunused-const-variable``.
+
+ - W=2
+
+ Adds ``Waggregate-return``, ``Wcast-align``, ``Wnested-externs``,
+ ``Wshadow``, ``Wlogical-op``, ``Wmissing-field-initializers`` and
+ ``Wsign-compare``.
+
+ - W=3
+
+ Adds ``Wbad-function-cast``, ``Wcast-qual``, ``Wconversion``, ``Wpacked``,
+ ``Wpadded``, ``Wpointer-arith``, ``Wredundant-decls`` and
+ ``Wswitch-default``.
+
+ Refer to the GCC or Clang documentation for more information on the individual
+ options: https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html and
+ https://clang.llvm.org/docs/DiagnosticsReference.html.
+
+ NB: The ``Werror`` flag is enabled by default in TF-A and can be disabled by
+ setting the ``E`` build flag to 0.
+
+*Copyright (c) 2019, Arm Limited. All rights reserved.*
+
+.. _user guide: ../getting_started/user-guide.rst