Skip to content
This repository has been archived by the owner on Jan 31, 2020. It is now read-only.

autobuild: align to new hardening standard #6

Closed
MingcongBai opened this issue Aug 20, 2015 · 2 comments
Closed

autobuild: align to new hardening standard #6

MingcongBai opened this issue Aug 20, 2015 · 2 comments
Milestone

Comments

@MingcongBai
Copy link
Contributor

The issue

autobuild3, from tag v0.1.4.1 has added flags for further hardening, and with a recent commit AOSC-Archive/autobuild3@5de9897 switches for enabling/disabling those flags has been added.

Build failures are expected with PIE (position independent executable) flags passed to compiler and linker. Tests are needed to ensure that they will build under the new condition.

A sample of a fully hardened binary

root [ autobuild@dev/new-packages ] # /checksec.sh --file /usr/bin/lightdm
RELRO           STACK CANARY      NX            PIE             RPATH      RUNPATH      FILE
Full RELRO      Canary found      NX enabled    PIE enabled     No RPATH   No RUNPATH   /usr/bin/lightdm

Recommended practice

First of all, enable all hardening features when possible, to achieve the expected result above.

Use the $AB_FLAGS_* variables to control the hardening-related flags when possible, as listed in /etc/autobuild/defaults/hardening:

# Work in progress: factor hardening-related flags into options
# Parameters that are likely to cause trouble.

AB_FLAGS_PIC=1
AB_FLAGS_PIE=1
AB_FLAGS_SSP=1
AB_FLAGS_RRO=1
AB_FLAGS_NOW=1

Hacks are allowed, because in cases like core-libs/glibc, it is possible to control flags in different stages.

@MingcongBai MingcongBai added this to the 3.0.4 milestone Aug 20, 2015
@MingcongBai
Copy link
Contributor Author

All package updates added, now needs testing.

@MingcongBai
Copy link
Contributor Author

All tested and clear, as of ef84b8f.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant