All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [RFC PATCH 0/2] Verify hardened builds
@ 2018-05-03 14:31 Stefan Sørensen
  2018-05-03 14:31 ` [Buildroot] [RFC PATCH 1/2] annobin: New package Stefan Sørensen
  2018-05-03 14:31 ` [Buildroot] [RFC PATCH 2/2] core: Verify that hardening flags are used Stefan Sørensen
  0 siblings, 2 replies; 10+ messages in thread
From: Stefan Sørensen @ 2018-05-03 14:31 UTC (permalink / raw)
  To: buildroot

This patch series introduces a new package post install check that
verifies that the correct build hardening flags has been applied.

Most of the work here is done by the annobin GCC plugin that annotates
all objects files, libraries and executables with the flags used in
the build. 

The checking functionality is heavily based on the check-bin-arch
functionality with only minor adjustments, and with the validation
itself performed by the hardened.sh script from the annobin package.

At the end of the package install step, it will output any failed
checks:
hardened.sh: output/target/usr/bin/foo: FAIL: compiled with -fstack-protector-off
hardened.sh: output/target/usr/bin/foo: FAIL: optimization level of -O0 used
hardened.sh: output/target/usr/bin/foo: FAIL: insufficient value for -D_FORTIFY_SOURCE=0
hardened.sh: output/target/usr/bin/foo: FAIL: -Wl,-z,now not used

Stefan S?rensen (2):
  annobin: New package
  core: Verify that hardening flags are used

 Config.in                                     | 15 ++++
 ...1-Only-issue-warning-for-PIC-PIE-mix.patch | 47 ++++++++++++
 package/annobin/Config.in                     | 12 +++
 package/annobin/annobin.hash                  |  2 +
 package/annobin/annobin.mk                    | 44 +++++++++++
 package/gcc/gcc-final/gcc-final.mk            |  3 +
 package/pkg-generic.mk                        | 36 +++++++++
 support/scripts/check-hardened                | 74 +++++++++++++++++++
 toolchain/Config.in                           |  2 +
 .../pkg-toolchain-external.mk                 |  3 +
 toolchain/toolchain-wrapper.c                 |  3 +
 toolchain/toolchain/toolchain.mk              |  4 +
 12 files changed, 245 insertions(+)
 create mode 100644 package/annobin/0001-Only-issue-warning-for-PIC-PIE-mix.patch
 create mode 100644 package/annobin/Config.in
 create mode 100644 package/annobin/annobin.hash
 create mode 100644 package/annobin/annobin.mk
 create mode 100755 support/scripts/check-hardened

-- 
2.17.0

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2019-02-06 15:40 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-03 14:31 [Buildroot] [RFC PATCH 0/2] Verify hardened builds Stefan Sørensen
2018-05-03 14:31 ` [Buildroot] [RFC PATCH 1/2] annobin: New package Stefan Sørensen
2018-05-03 22:13   ` Arnout Vandecappelle
2018-05-04  8:32     ` Sørensen, Stefan
2018-05-04 10:35       ` Arnout Vandecappelle
2019-02-06 15:04   ` Thomas Petazzoni
2019-02-06 15:27     ` Sørensen, Stefan
2019-02-06 15:40       ` Thomas Petazzoni
2018-05-03 14:31 ` [Buildroot] [RFC PATCH 2/2] core: Verify that hardening flags are used Stefan Sørensen
2018-05-03 22:42   ` Arnout Vandecappelle

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.