summaryrefslogtreecommitdiffstats
path: root/lib/libc
diff options
context:
space:
mode:
authorpfg <pfg@FreeBSD.org>2015-08-14 03:03:13 +0000
committerpfg <pfg@FreeBSD.org>2015-08-14 03:03:13 +0000
commit9b366d35eed6cd2ffaa720799d9d53fdaf4bd9cc (patch)
tree79662eb10c6396b4741353e9ed4e5cbb01384bc7 /lib/libc
parent0488e0470dfbdecc7c8865fc260ffa15c3d5e91f (diff)
downloadFreeBSD-src-9b366d35eed6cd2ffaa720799d9d53fdaf4bd9cc.zip
FreeBSD-src-9b366d35eed6cd2ffaa720799d9d53fdaf4bd9cc.tar.gz
Move the stack protector to a new "secure" directory
As part of the code refactoring to support FORTIFY_SOURCE we want a new subdirectory "secure" to keep the files related to security. Move the stack protector functions to this new directory. No functional change. Differential Review: https://reviews.freebsd.org/D3333
Diffstat (limited to 'lib/libc')
-rw-r--r--lib/libc/Makefile1
-rw-r--r--lib/libc/secure/Makefile.inc12
-rw-r--r--lib/libc/secure/Symbol.map14
-rw-r--r--lib/libc/secure/stack_protector.c (renamed from lib/libc/sys/stack_protector.c)0
-rw-r--r--lib/libc/secure/stack_protector_compat.c (renamed from lib/libc/sys/stack_protector_compat.c)0
-rw-r--r--lib/libc/sys/Makefile.inc2
-rw-r--r--lib/libc/sys/Symbol.map3
7 files changed, 27 insertions, 5 deletions
diff --git a/lib/libc/Makefile b/lib/libc/Makefile
index b6d3f9f..2f8865c 100644
--- a/lib/libc/Makefile
+++ b/lib/libc/Makefile
@@ -95,6 +95,7 @@ NOASM=
.include "${LIBC_SRCTOP}/stdtime/Makefile.inc"
.include "${LIBC_SRCTOP}/string/Makefile.inc"
.include "${LIBC_SRCTOP}/sys/Makefile.inc"
+.include "${LIBC_SRCTOP}/secure/Makefile.inc"
.include "${LIBC_SRCTOP}/rpc/Makefile.inc"
.include "${LIBC_SRCTOP}/uuid/Makefile.inc"
.include "${LIBC_SRCTOP}/xdr/Makefile.inc"
diff --git a/lib/libc/secure/Makefile.inc b/lib/libc/secure/Makefile.inc
new file mode 100644
index 0000000..6f18bde
--- /dev/null
+++ b/lib/libc/secure/Makefile.inc
@@ -0,0 +1,12 @@
+# $FreeBSD$
+#
+# libc sources related to security
+
+.PATH: ${LIBC_SRCTOP}/secure
+
+# Sources common to both syscall interfaces:
+SRCS+= \
+ stack_protector.c \
+ stack_protector_compat.c
+
+SYM_MAPS+= ${LIBC_SRCTOP}/secure/Symbol.map
diff --git a/lib/libc/secure/Symbol.map b/lib/libc/secure/Symbol.map
new file mode 100644
index 0000000..11bad3a
--- /dev/null
+++ b/lib/libc/secure/Symbol.map
@@ -0,0 +1,14 @@
+/*
+ * $FreeBSD$
+ */
+
+/*
+ * It'd be nice to have this automatically generated, but we don't
+ * know to what version they will eventually belong, so for now
+ * it has to be manual.
+ */
+FBSD_1.0 {
+ __chk_fail;
+ __stack_chk_fail;
+ __stack_chk_guard;
+};
diff --git a/lib/libc/sys/stack_protector.c b/lib/libc/secure/stack_protector.c
index cd5f166..cd5f166 100644
--- a/lib/libc/sys/stack_protector.c
+++ b/lib/libc/secure/stack_protector.c
diff --git a/lib/libc/sys/stack_protector_compat.c b/lib/libc/secure/stack_protector_compat.c
index cacb863..cacb863 100644
--- a/lib/libc/sys/stack_protector_compat.c
+++ b/lib/libc/secure/stack_protector_compat.c
diff --git a/lib/libc/sys/Makefile.inc b/lib/libc/sys/Makefile.inc
index e672b69..fad970c 100644
--- a/lib/libc/sys/Makefile.inc
+++ b/lib/libc/sys/Makefile.inc
@@ -21,8 +21,6 @@ PSEUDO+= _clock_gettime.o _gettimeofday.o
# Sources common to both syscall interfaces:
SRCS+= \
- stack_protector.c \
- stack_protector_compat.c \
__error.c \
interposing_table.c
diff --git a/lib/libc/sys/Symbol.map b/lib/libc/sys/Symbol.map
index a3a613e..45833ab 100644
--- a/lib/libc/sys/Symbol.map
+++ b/lib/libc/sys/Symbol.map
@@ -56,7 +56,6 @@ FBSD_1.0 {
bind;
chdir;
chflags;
- __chk_fail;
chmod;
chown;
chroot;
@@ -281,8 +280,6 @@ FBSD_1.0 {
sigwaitinfo;
socket;
socketpair;
- __stack_chk_fail;
- __stack_chk_guard;
stat;
statfs;
swapoff;
OpenPOWER on IntegriCloud