[Bug 7064] New: Caching _dl_library_path is invalid

bugzilla at busybox.net bugzilla at busybox.net
Mon Apr 28 07:02:59 UTC 2014


https://bugs.busybox.net/show_bug.cgi?id=7064

           Summary: Caching _dl_library_path is invalid
           Product: uClibc
           Version: unspecified
          Platform: Other
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P5
         Component: Standard Compliance
        AssignedTo: unassigned at uclibc.org
        ReportedBy: awabik at opera.com
                CC: uclibc-cvs at uclibc.org
   Estimated Hours: 0.0


Created attachment 5372
  --> https://bugs.busybox.net/attachment.cgi?id=5372
The workaround patch that makes things work correctly, although may be
suboptimal solution

uClibc caches LD_LIBRARY_PATH env variable value in _dl_library_path, causing
two bugs:

1. Caching the pointer obtained from getenv() is forbidden, as the application
may change the environment afterwards, rendering the pointer invalid. In our
case the application is modifying the environ global variable by calling
setproctitle() (a function not present in uClibc, but provided by other
library), and then the cached _dl_library_path in uClibc contains program's
command line instead of the LD_LIBRARY_PATH value.

2. Caching such an env variable in any correct way which fixes problem 1 (eg.
by doing strdup()) is non-spec anyway, and should not be done. The application
may modify LD_LIBRARY_PATH and call dlopen() afterwards. It should cause
reading the modified LD_LIBRARY_PATH instead of using the cached value.

We currently use a workaround in libdl.c (see attachment), but a correct fix
would be to make _dl_library_path variable local.

-- 
Configure bugmail: https://bugs.busybox.net/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


More information about the uClibc-cvs mailing list