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 network/17562] New: race in getaddrinfo sorting cached in6ai


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

            Bug ID: 17562
           Summary: race in getaddrinfo sorting cached in6ai
           Product: glibc
           Version: 2.21
            Status: NEW
          Severity: normal
          Priority: P2
         Component: network
          Assignee: unassigned at sourceware dot org
          Reporter: aoliva at sourceware dot org

check_pf may return a shared in6ai, saved in a cache and returned to multiple
concurrent threads.  getaddrinfo sorts this array regardless of other uses;
there's even a risk that multiple getaddrinfo concurrent runs corrupt the array
by sorting it concurrently.

Since __check_pf is an internal function, and its only user is getaddrinfo, it
shouldn't be too hard to fix this.  One possibility is to pass the sort
function to __check_pf, have __check_pf do the sorting before caching the
result, and for extra care use the compare function as part of the test on
whether the cache is valid (not much point in adding support for re-sorting
into a new cached entry for now, since we always use the same function).

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