From d97c60ea32de0a8a99b5d664064a75f410d0cf8b Mon Sep 17 00:00:00 2001 From: guenther Date: Mon, 21 Mar 2016 00:41:13 +0000 Subject: 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@ --- lib/libc/dlfcn/init.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'lib/libc/dlfcn/init.c') 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 * @@ -20,12 +20,12 @@ #include #include +#include #include /* NAME_MAX */ #include /* atexit */ #include #include /* _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; -- cgit v1.2.3-59-g8ed1b