|
|
4999bf |
2010-12-09 Andreas Schwab <schwab@redhat.com>
|
|
|
4999bf |
|
|
|
4999bf |
* elf/dl-object.c (_dl_new_object): Ignore origin of privileged
|
|
|
4999bf |
program.
|
|
|
4999bf |
|
|
|
4999bf |
2010-10-18 Andreas Schwab <schwab@redhat.com>
|
|
|
4999bf |
|
|
|
4999bf |
* elf/dl-open.c (dl_open_worker): Don't expand DST here, let
|
|
|
4999bf |
_dl_map_object do it.
|
|
|
4999bf |
|
|
|
4999bf |
Index: glibc-2.12-2-gc4ccff1/elf/dl-object.c
|
|
|
4999bf |
===================================================================
|
|
|
4999bf |
--- glibc-2.12-2-gc4ccff1.orig/elf/dl-object.c
|
|
|
4999bf |
+++ glibc-2.12-2-gc4ccff1/elf/dl-object.c
|
|
|
4999bf |
@@ -214,6 +214,9 @@ _dl_new_object (char *realname, const ch
|
|
|
4999bf |
out:
|
|
|
4999bf |
new->l_origin = origin;
|
|
|
4999bf |
}
|
|
|
4999bf |
+ else if (INTUSE(__libc_enable_secure) && type == lt_executable)
|
|
|
4999bf |
+ /* The origin of a privileged program cannot be trusted. */
|
|
|
4999bf |
+ new->l_origin = (char *) -1;
|
|
|
4999bf |
|
|
|
4999bf |
return new;
|
|
|
4999bf |
}
|
|
|
4999bf |
Index: glibc-2.12-2-gc4ccff1/elf/dl-open.c
|
|
|
4999bf |
===================================================================
|
|
|
4999bf |
--- glibc-2.12-2-gc4ccff1.orig/elf/dl-open.c
|
|
|
4999bf |
+++ glibc-2.12-2-gc4ccff1/elf/dl-open.c
|
|
|
4999bf |
@@ -221,35 +221,6 @@ dl_open_worker (void *a)
|
|
|
4999bf |
|
|
|
4999bf |
assert (_dl_debug_initialize (0, args->nsid)->r_state == RT_CONSISTENT);
|
|
|
4999bf |
|
|
|
4999bf |
- /* Maybe we have to expand a DST. */
|
|
|
4999bf |
- if (__builtin_expect (dst != NULL, 0))
|
|
|
4999bf |
- {
|
|
|
4999bf |
- size_t len = strlen (file);
|
|
|
4999bf |
-
|
|
|
4999bf |
- /* Determine how much space we need. We have to allocate the
|
|
|
4999bf |
- memory locally. */
|
|
|
4999bf |
- size_t required = DL_DST_REQUIRED (call_map, file, len,
|
|
|
4999bf |
- _dl_dst_count (dst, 0));
|
|
|
4999bf |
-
|
|
|
4999bf |
- /* Get space for the new file name. */
|
|
|
4999bf |
- char *new_file = (char *) alloca (required + 1);
|
|
|
4999bf |
-
|
|
|
4999bf |
- /* Generate the new file name. */
|
|
|
4999bf |
- _dl_dst_substitute (call_map, file, new_file, 0);
|
|
|
4999bf |
-
|
|
|
4999bf |
- /* If the substitution failed don't try to load. */
|
|
|
4999bf |
- if (*new_file == '\0')
|
|
|
4999bf |
- _dl_signal_error (0, "dlopen", NULL,
|
|
|
4999bf |
- N_("empty dynamic string token substitution"));
|
|
|
4999bf |
-
|
|
|
4999bf |
- /* Now we have a new file name. */
|
|
|
4999bf |
- file = new_file;
|
|
|
4999bf |
-
|
|
|
4999bf |
- /* It does not matter whether call_map is set even if we
|
|
|
4999bf |
- computed it only because of the DST. Since the path contains
|
|
|
4999bf |
- a slash the value is not used. See dl-load.c. */
|
|
|
4999bf |
- }
|
|
|
4999bf |
-
|
|
|
4999bf |
/* Load the named object. */
|
|
|
4999bf |
struct link_map *new;
|
|
|
4999bf |
args->map = new = _dl_map_object (call_map, file, 0, lt_loaded, 0,
|