This is the mail archive of the glibc-bugs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug dynamic-link/18778] ld.so crashes if failed dlopen causes libpthread to be forced unloaded


https://sourceware.org/bugzilla/show_bug.cgi?id=18778

--- Comment #4 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot gnu.org> ---
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".

The branch, release/2.22/master has been updated
       via  a34d1c6afc86521d6ad17662a3b5362d8481514c (commit)
      from  561a9f11a974a447acb3dd03550a05df701a900e (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=a34d1c6afc86521d6ad17662a3b5362d8481514c

commit a34d1c6afc86521d6ad17662a3b5362d8481514c
Author: Maxim Ostapenko <m.ostapenko@partner.samsung.com>
Date:   Mon Aug 10 10:47:54 2015 +0300

    Clear DF_1_NODELETE flag only for failed to load library.

    https://sourceware.org/bugzilla/show_bug.cgi?id=18778

    If dlopen fails to load an object that has triggered loading libpthread it
    causes ld.so to unload libpthread because its DF_1_NODELETE flags has been
    forcefully cleared. The next call to __rtdl_unlock_lock_recursive will
crash
    since pthread_mutex_unlock no longer exists.

    This patch moves l->l_flags_1 &= ~DF_1_NODELETE out of loop through all
loaded
    libraries and performs the action only on inconsistent one.

        [BZ #18778]
        * elf/Makefile (tests): Add Add tst-nodelete2.
        (modules-names): Add tst-nodelete2mod.
        (tst-nodelete2mod.so-no-z-defs): New.
        ($(objpfx)tst-nodelete2): Likewise.
        ($(objpfx)tst-nodelete2.out): Likewise.
        (LDFLAGS-tst-nodelete2): Likewise.
        * elf/dl-close.c (_dl_close_worker): Move DF_1_NODELETE clearing
        out of loop through all loaded libraries.
        * elf/tst-nodelete2.c: New file.
        * elf/tst-nodelete2mod.c: Likewise.

    (cherry picked from commit f25238ffe0455013174438376b3ee88df496f9d1)

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog                                         |   14 ++++++++
 NEWS                                              |    2 +-
 elf/Makefile                                      |   11 +++++-
 elf/dl-close.c                                    |   15 ++++----
 elf/tst-nodelete2.c                               |   37 +++++++++++++++++++++
 elf/{tst-znodelete-zlib.cc => tst-nodelete2mod.c} |    3 +-
 6 files changed, 71 insertions(+), 11 deletions(-)
 create mode 100644 elf/tst-nodelete2.c
 rename elf/{tst-znodelete-zlib.cc => tst-nodelete2mod.c} (50%)

-- 
You are receiving this mail because:
You are on the CC list for the bug.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]