summaryrefslogtreecommitdiff
path: root/lib/libc/dlfcn
diff options
context:
space:
mode:
authorPhilip Guenther <guenther@cvs.openbsd.org>2016-03-21 00:41:14 +0000
committerPhilip Guenther <guenther@cvs.openbsd.org>2016-03-21 00:41:14 +0000
commitd4c8db29044b848271e1a2a3de2d895b0df21c40 (patch)
tree88c86320f71355c915d72337a7a679b97b10299a /lib/libc/dlfcn
parent9a3f69d151bba1d087d38b790d50ba4970018753 (diff)
The asm in the MD_DISABLE_KBIND macro was too fragile and broke alpha and hppa.
So instead, do the kbind disabling with syscall(). debugging and ok deraadt@, ok kettenis@
Diffstat (limited to 'lib/libc/dlfcn')
-rw-r--r--lib/libc/dlfcn/init.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/libc/dlfcn/init.c b/lib/libc/dlfcn/init.c
index c0589dffb1a..9e6af9d92f2 100644
--- a/lib/libc/dlfcn/init.c
+++ b/lib/libc/dlfcn/init.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: init.c,v 1.2 2016/03/20 03:01:57 guenther Exp $ */
+/* $OpenBSD: init.c,v 1.3 2016/03/21 00:41:13 guenther Exp $ */
/*
* Copyright (c) 2014,2015 Philip Guenther <guenther@openbsd.org>
*
@@ -20,12 +20,12 @@
#include <sys/types.h>
#include <sys/exec_elf.h>
+#include <sys/syscall.h>
#include <limits.h> /* NAME_MAX */
#include <stdlib.h> /* atexit */
#include <string.h>
#include <unistd.h> /* _pagesize */
-#include "kbind.h"
/* XXX should be in an include file shared with csu */
char ***_csu_finish(char **_argv, char **_envp, void (*_cleanup)(void));
@@ -87,9 +87,10 @@ _csu_finish(char **argv, char **envp, void (*cleanup)(void))
static inline void
early_static_init(char **argv, char **envp)
{
- static char progname_storage[NAME_MAX+1] = "";
+ static char progname_storage[NAME_MAX+1];
- MD_DISABLE_KBIND;
+ /* disable kbind */
+ syscall(SYS_kbind, (void *)NULL, (size_t)0, (long long)0);
environ = envp;