On Tue, 11 Oct 2005, Alexander E. Patrakov wrote:


It is not an issue in the ssh itself. Testcase:

gcc -o test -ldl test.c
rm -rf /tmp/foobar; mkdir /tmp/foobar
./test

Dug out the patch from the libc-hacker archives, but I had to apply it by hand, I think the line numbers changed a bit too much for patch to figure it out. Can you confirm this is what you want put in, and can I stick your name in the 'submitted by' ? I was thinking of calling it glibc-2.3.4-open_path_segfault-1.patch.

My understanding from what Jakub put in the posting is that this only applies if the standard directories are empty, e.g. in a chroot.

Ken


Submitted By: Date: 2005-10-14
Initial Package Version: 3.3.4
Upstream Status: From glibc-cvs
Origin: http://sources.redhat.com/ml/libc-hacker/2005-02/msg00005.html
        Applied by hand and rediffed by Ken Moffat.
Description: Avoid segfault if open_path doesn't find any of the standard search directories.

2005-01-07  Jakub Jelinek  <[EMAIL PROTECTED]>

        * elf/dl-load.c (open_path): If rtld_search_dirs is in RELRO segment,
        avoid writing to it if none of the standard search directories
        exist.


diff -Naurp glibc-2.3.4.orig/elf/dl-load.c glibc-2.3.4/elf/dl-load.c
--- glibc-2.3.4.orig/elf/dl-load.c      2004-12-12 20:49:28.000000000 +0000
+++ glibc-2.3.4/elf/dl-load.c   2005-10-14 00:03:55.000000000 +0100
@@ -1788,6 +1788,11 @@ open_path (const char *name, size_t name
         must not be freed using the general free() in libc.  */
       if (sps->malloced)
        free (sps->dirs);
+#ifdef HAVE_Z_RELRO
+      /* rtld_search_dirs is attribute_relro, therefore avoid writing
+        into it.  */
+      if (sps != &rtld_search_dirs)
+#endif
       sps->dirs = (void *) -1;
     }


--
 das eine Mal als Tragödie, das andere Mal als Farce
-- 
http://linuxfromscratch.org/mailman/listinfo/lfs-dev
FAQ: http://www.linuxfromscratch.org/faq/
Unsubscribe: See the above information page

Reply via email to