This is the mail archive of the glibc-cvs@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]

GNU C Library master sources branch master updated. glibc-2.25-221-g2604882


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, master has been updated
       via  2604882cefd3281679b8177245fdebc7061b8695 (commit)
      from  a12ae89f860229cbe5ba91f1f9cf17cc5a9ede31 (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 -----------------------------------------------------------------
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=2604882cefd3281679b8177245fdebc7061b8695

commit 2604882cefd3281679b8177245fdebc7061b8695
Author: Rabin Vincent <rabinv@axis.com>
Date:   Mon Apr 17 12:03:44 2017 -0300

    [BZ 21357] unwind-dw2-fde: Call free() outside of unwind mutex
    
    __deregister_frame_info_bases() calls free() while holding a mutex which
    is also used from _Unwind_Find_FDE().  This leads to a deadlock if
    AddressSanitizer uses _Unwind_Backtrace() from its free()
    implementation.
    
    Checked on mips-linux-gnu and x86_64-linux-gnu.
    
    	[BZ #21357]
    	* sysdeps/generic/unwind-dw2-fde.c (__deregister_frame_info_bases):
    	Call free() outside of mutex.

diff --git a/ChangeLog b/ChangeLog
index b209f9c..bfda0e1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2017-04-17  Rabin Vincent  <rabinv@axis.com>
+
+	[BZ #21357]
+	* sysdeps/generic/unwind-dw2-fde.c (__deregister_frame_info_bases):
+	Call free() outside of mutex.
+
 2017-04-13  Florian Weimer  <fweimer@redhat.com>
 
 	* csu/check_fds.c (__libc_check_standard_fds): Assume O_NOFOLLOW
diff --git a/sysdeps/generic/unwind-dw2-fde.c b/sysdeps/generic/unwind-dw2-fde.c
index 2f0bcd2..104a255 100644
--- a/sysdeps/generic/unwind-dw2-fde.c
+++ b/sysdeps/generic/unwind-dw2-fde.c
@@ -202,6 +202,7 @@ __deregister_frame_info_bases (void *begin)
 {
   struct object **p;
   struct object *ob = 0;
+  struct fde_vector *tofree = NULL;
 
   /* If .eh_frame is empty, we haven't registered.  */
   if (*(uword *) begin == 0)
@@ -225,7 +226,7 @@ __deregister_frame_info_bases (void *begin)
 	  {
 	    ob = *p;
 	    *p = ob->next;
-	    free (ob->u.sort);
+	    tofree = ob->u.sort;
 	    goto out;
 	  }
       }
@@ -244,6 +245,7 @@ __deregister_frame_info_bases (void *begin)
 
  out:
   __gthread_mutex_unlock (&object_mutex);
+  free (tofree);
   return (void *) ob;
 }
 hidden_def (__deregister_frame_info_bases)

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

Summary of changes:
 ChangeLog                        |    6 ++++++
 sysdeps/generic/unwind-dw2-fde.c |    4 +++-
 2 files changed, 9 insertions(+), 1 deletions(-)


hooks/post-receive
-- 
GNU C Library master sources


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