summaryrefslogtreecommitdiff
path: root/lib/csu
diff options
context:
space:
mode:
authorPhilip Guenther <guenther@cvs.openbsd.org>2016-03-12 23:28:48 +0000
committerPhilip Guenther <guenther@cvs.openbsd.org>2016-03-12 23:28:48 +0000
commit6b6c20daf573d5bf1ea13ff899c5b18a679d07c4 (patch)
tree5969b0cedf42f827cd8327255a80c98439bb10e8 /lib/csu
parent6a03f10f3616e75dc562dab3a90d54625a97abb7 (diff)
Call mprotect() via its hidden _lib_mprotect alias to avoid accidental
overriding ok deraadt@ kettenis@
Diffstat (limited to 'lib/csu')
-rw-r--r--lib/csu/boot.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/csu/boot.h b/lib/csu/boot.h
index a4867b3035f..66d12e808f0 100644
--- a/lib/csu/boot.h
+++ b/lib/csu/boot.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: boot.h,v 1.14 2015/12/06 23:36:12 guenther Exp $ */
+/* $OpenBSD: boot.h,v 1.15 2016/03/12 23:28:47 guenther Exp $ */
/*
* Copyright (c) 1998 Per Fogelstrom, Opsycon AB
@@ -50,6 +50,13 @@
#include "stdlib.h"
#include "dl_prebind.h"
+/*
+ * Use the internal, hidden name for any syscalls we need, to avoid
+ * accidental override by application code
+ */
+#define REDIRECT_SYSCALL(x) typeof(x) x asm("_libc_"#x) __dso_hidden
+REDIRECT_SYSCALL(mprotect);
+
#ifdef RCRT0
#define DT_PROC(n) ((n) - DT_LOPROC)