From 5608fd23c27fa1e8ee595d7b678cbfd35d657fbe Mon Sep 17 00:00:00 2001 From: Bryan Drewery Date: Tue, 19 Aug 2014 15:04:32 +0000 Subject: Revert r267233 for now. PIE support needs to be reworked. 1. 50+% of NO_PIE use is fixed by adding -fPIC to INTERNALLIB and other build-only utility libraries. 2. Another 40% is fixed by generating _pic.a variants of various libraries. 3. Some of the NO_PIE use is a bit absurd as it is disabling PIE (and ASLR) where it never would work anyhow, such as csu or loader. This suggests there may be better ways of adding support to the tree. Many of these cases can be fixed such that -fPIE will work but there is really no reason to have it in those cases. 4. Some of the uses are working around hacks done to some Makefiles that are really building libraries but have been using bsd.prog.mk because the code is cleaner. Had they been using bsd.lib.mk then NO_PIE would not have been needed. We likely do want to enable PIE by default (opt-out) for non-tree consumers (such as ports). For in-tree though we probably want to only enable PIE (opt-in) for common attack targets such as remote service daemons and setuid utilities. This is also a great performance compromise since ASLR is expected to reduce performance. As such it does not make sense to enable it in all utilities such as ls(1) that have little benefit to having it enabled. Reported by: kib --- sbin/ipf/ipf/Makefile | 2 -- sbin/ipf/ipfstat/Makefile | 2 -- sbin/ipf/ipftest/Makefile | 2 -- sbin/ipf/ipmon/Makefile | 2 -- sbin/ipf/ipnat/Makefile | 2 -- sbin/ipf/ippool/Makefile | 2 -- sbin/ipf/ipresend/Makefile | 2 -- 7 files changed, 14 deletions(-) (limited to 'sbin/ipf') diff --git a/sbin/ipf/ipf/Makefile b/sbin/ipf/ipf/Makefile index 73888b29ba6f..c3938c63af61 100644 --- a/sbin/ipf/ipf/Makefile +++ b/sbin/ipf/ipf/Makefile @@ -39,6 +39,4 @@ DPADD+= ${LIBPCAP} LDADD+= -lpcap .endif -NO_PIE= yes - .include diff --git a/sbin/ipf/ipfstat/Makefile b/sbin/ipf/ipfstat/Makefile index c2b422df42f4..a33c5df38d8f 100644 --- a/sbin/ipf/ipfstat/Makefile +++ b/sbin/ipf/ipfstat/Makefile @@ -8,6 +8,4 @@ MAN= ipfstat.8 DPADD+= ${LIBCURSES} LDADD+= -lcurses -NO_PIE= yes - .include diff --git a/sbin/ipf/ipftest/Makefile b/sbin/ipf/ipftest/Makefile index 57f3c4e7de83..32b074cb93f4 100644 --- a/sbin/ipf/ipftest/Makefile +++ b/sbin/ipf/ipftest/Makefile @@ -32,8 +32,6 @@ CLEANFILES+= ipnat.tab.c ipnat.tab.h CLEANFILES+= ippool_y.c ippool_l.c CLEANFILES+= ippool.tab.c ippool.tab.h -NO_PIE= yes - ipnat_y.c: ipnat_y.y ${YACC} -b ipnat -d ${.ALLSRC} sed -e 's/yy/ipnat_yy/g' \ diff --git a/sbin/ipf/ipmon/Makefile b/sbin/ipf/ipmon/Makefile index 2ecfed1aa1b8..3639f8733c1e 100644 --- a/sbin/ipf/ipmon/Makefile +++ b/sbin/ipf/ipmon/Makefile @@ -11,8 +11,6 @@ DPSRCS+= ${GENHDRS} CLEANFILES+= ${GENHDRS} ipmon_y.c ipmon_l.c -NO_PIE= yes - ipmon_y.c: ipmon_y.y ${YACC} -d ${.ALLSRC} sed -e 's/yy/ipmon_yy/g' \ diff --git a/sbin/ipf/ipnat/Makefile b/sbin/ipf/ipnat/Makefile index aafb0147ec57..1c017e182cb1 100644 --- a/sbin/ipf/ipnat/Makefile +++ b/sbin/ipf/ipnat/Makefile @@ -11,8 +11,6 @@ DPSRCS+= ${GENHDRS} CLEANFILES+= ${GENHDRS} ipnat_y.c ipnat_l.c -NO_PIE= yes - ipnat_y.c: ipnat_y.y ${YACC} -d ${.ALLSRC} sed -e 's/yy/ipnat_yy/g' \ diff --git a/sbin/ipf/ippool/Makefile b/sbin/ipf/ippool/Makefile index bb7e9ceb24b9..6e3f85da847d 100644 --- a/sbin/ipf/ippool/Makefile +++ b/sbin/ipf/ippool/Makefile @@ -10,8 +10,6 @@ DPSRCS+= ${GENHDRS} CLEANFILES+= ${GENHDRS} ippool_y.c ippool_l.c -NO_PIE= yes - ippool_y.c: ippool_y.y ${YACC} -d ${.ALLSRC} sed -e 's/yy/ippool_yy/g' \ diff --git a/sbin/ipf/ipresend/Makefile b/sbin/ipf/ipresend/Makefile index 492451cebfc2..5e0ac15cbb1f 100644 --- a/sbin/ipf/ipresend/Makefile +++ b/sbin/ipf/ipresend/Makefile @@ -4,8 +4,6 @@ PROG= ipresend SRCS= ipresend.c ip.c resend.c sbpf.c sock.c 44arp.c MAN= ipresend.1 -NO_PIE= yes - .PATH: ${.CURDIR}/../../../contrib/ipfilter/ipsend .include -- cgit v1.2.3