Blame SOURCES/glibc-rh643822.patch

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