From 3e539cb47e9fabfdda295926b4270b0f3cc7fa65 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Thu, 13 Jan 2005 02:08:37 +0000 Subject: * elf/dl-load.c (_dl_map_object_from_fd): We don't have to allow callers from libc anymore. * elf/dl-open.c (dl_open_worker): Pass __RTLD_AUDIT flag from caller to _dl_map_object_deps. * elf/dl-load.c (_dl_map_object_from_fd): Don't change memory protections when loading auditing modules. * dlfcn/dlopen.c (dlopen_doit): Catch invalid mode arguments and fail. --- dlfcn/dlopen.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'dlfcn') diff --git a/dlfcn/dlopen.c b/dlfcn/dlopen.c index 1e2111e71f..bffb512aa3 100644 --- a/dlfcn/dlopen.c +++ b/dlfcn/dlopen.c @@ -1,5 +1,5 @@ /* Load a shared object at run time. - Copyright (C) 1995,96,97,98,99,2000,2003,2004 Free Software Foundation, Inc. + Copyright (C) 1995-2000,2003,2004,2005 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -18,6 +18,7 @@ 02111-1307 USA. */ #include +#include #include #include #include @@ -58,6 +59,10 @@ dlopen_doit (void *a) { struct dlopen_args *args = (struct dlopen_args *) a; + if (args->mode & ~(RTLD_BINDING_MASK | RTLD_NOLOAD | RTLD_DEEPBIND + | RTLD_GLOBAL | RTLD_LOCAL | RTLD_NODELETE)) + GLRO(dl_signal_error) (0, NULL, NULL, _("invalid mode parameter")); + args->new = GLRO(dl_open) (args->file ?: "", args->mode | __RTLD_DLOPEN, args->caller, args->file == NULL ? LM_ID_BASE : NS, -- cgit v1.2.3