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 libc/20975] New: Deferred cancellation triggers in __check_pf and looses lock leading to deadlock.


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

            Bug ID: 20975
           Summary: Deferred cancellation triggers in __check_pf and
                    looses lock leading to deadlock.
           Product: glibc
           Version: 2.25
            Status: NEW
          Severity: normal
          Priority: P2
         Component: libc
          Assignee: unassigned at sourceware dot org
          Reporter: carlos at redhat dot com
                CC: drepper.fsp at gmail dot com
  Target Milestone: ---

In sysdeps/unix/sysv/linux/check_pf.c

The following path can cause deferred cancellation to trigger:

__check_pf -> make_request -> __sendto / __recvmsg.

296 void
297 attribute_hidden
298 __check_pf (bool *seen_ipv4, bool *seen_ipv6,
299             struct in6addrinfo **in6ai, size_t *in6ailen)
300 {
301   *in6ai = NULL;
302   *in6ailen = 0;
303 
304   struct cached_data *olddata = NULL;
305   struct cached_data *data = NULL;
306 
307   __libc_lock_lock (lock);

Once cancellation happens for one thread, the above lock is locked, and
deadlocks any other calls to __check_pf.

We need to push a cancellation cleanup handler to unlock the 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]