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 malloc/19182] New: malloc deadlock between ptmalloc_lock_all and _int_new_arena


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

            Bug ID: 19182
           Summary: malloc deadlock between ptmalloc_lock_all and
                    _int_new_arena
           Product: glibc
           Version: 2.23
            Status: NEW
          Severity: normal
          Priority: P2
         Component: malloc
          Assignee: unassigned at sourceware dot org
          Reporter: fweimer at redhat dot com
  Target Milestone: ---
             Flags: security-

ptmalloc_lock_all acquires list_lock, then arena locks.  _int_new_arena
acquires an arena lock, then list_lock.  This is a potential deadlock.

I think we can use a separate lock in ptmalloc_lock_all because this function
does not access any of the arena fields protected by list_lock.

There is also this bit which cannot be right.

      /* Suspend the thread until the `atfork' handlers have completed.
         By that time, the hooks will have been reset as well, so that
         mALLOc() can be used again. */
      (void) mutex_lock (&list_lock);
      (void) mutex_unlock (&list_lock);

-- 
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]