Skip to content
This repository has been archived by the owner on Mar 28, 2018. It is now read-only.

Commit

Permalink
Makefile: Ensure noexecstack and relro are enabled
Browse files Browse the repository at this point in the history
As we want to increase the security of the project, we want to make
sure we have both noexecstack and relro flags enabled. By default on
several distributions, gcc will enable those flags, but we don't want
to end up with a case where those flags are not enabled.

About the details of these flags, noexecstack protects the stack from
being executed, while relro protects against data relocation.

Notice that relro has been fully enabled by adding "-z now". A partial
relro would have omitted this option.

Signed-off-by: Sebastien Boeuf <[email protected]>
  • Loading branch information
Sebastien Boeuf committed Mar 28, 2017
1 parent 65dba07 commit a76a2f5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ AM_CFLAGS = -std=gnu99 -fstack-protector -Wall -pedantic \
-Wconversion -Wunreachable-code \
-fPIE

AM_LDFLAGS = -pie
AM_LDFLAGS = -pie -z noexecstack -z relro -z now

# We set --with-systemdunitdir here so make distcheck can run make install as a
# normal user and not fail.
Expand Down

0 comments on commit a76a2f5

Please sign in to comment.