summaryrefslogtreecommitdiffstats
path: root/lib/libc/sys/stack_protector.c
diff options
context:
space:
mode:
authorguenther <guenther@openbsd.org>2015-09-10 18:13:46 +0000
committerguenther <guenther@openbsd.org>2015-09-10 18:13:46 +0000
commite6f98e3a163d69d2a20131b8c80e6fad49fe7683 (patch)
tree5ab5a47b62d9d534bee925c48d67d4c5031e09a1 /lib/libc/sys/stack_protector.c
parentWhen loading a DSA key from an raw (without DH parameters) ASN.1 serialization, (diff)
downloadwireguard-openbsd-e6f98e3a163d69d2a20131b8c80e6fad49fe7683.tar.xz
wireguard-openbsd-e6f98e3a163d69d2a20131b8c80e6fad49fe7683.zip
Pull in namespace.h when building all .c files using gcc's -include option,
so that we can provide asm labels for the memcpy/memset/__stack_smash_handler calls that it generates ab initio. Eliminate direct #includes of it. Make sure it's a dependency of all objects (unnecessary for asm, but close enough). ok deraadt@
Diffstat (limited to 'lib/libc/sys/stack_protector.c')
-rw-r--r--lib/libc/sys/stack_protector.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/lib/libc/sys/stack_protector.c b/lib/libc/sys/stack_protector.c
index 0e757841dc9..e4716f832b6 100644
--- a/lib/libc/sys/stack_protector.c
+++ b/lib/libc/sys/stack_protector.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: stack_protector.c,v 1.16 2015/01/16 16:48:51 deraadt Exp $ */
+/* $OpenBSD: stack_protector.c,v 1.17 2015/09/10 18:13:46 guenther Exp $ */
/*
* Copyright (c) 2002 Hiroaki Etoh, Federico G. Schwindt, and Miodrag Vallat.
@@ -32,11 +32,8 @@
#include <syslog.h>
#include <unistd.h>
-void __stack_smash_handler(char func[], int damaged __attribute__((unused)));
-
-/*ARGSUSED*/
void
-__stack_smash_handler(char func[], int damaged)
+__stack_smash_handler(const char func[], int damaged)
{
struct syslog_data sdata = SYSLOG_DATA_INIT;
const char message[] = "stack overflow in function %s";
@@ -61,3 +58,4 @@ __stack_smash_handler(char func[], int damaged)
_exit(127);
}
+DEF_STRONG(__stack_smash_handler);