public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libc/18156] New: getaddrinfo race condition in 'reopen' function
@ 2015-03-23 19:40 sourceware-bugs at internot dot info
  2015-03-23 20:10 ` [Bug libc/18156] " sourceware-bugs at internot dot info
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: sourceware-bugs at internot dot info @ 2015-03-23 19:40 UTC (permalink / raw)
  To: glibc-bugs

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

            Bug ID: 18156
           Summary: getaddrinfo race condition in 'reopen' function
           Product: glibc
           Version: unspecified
            Status: NEW
          Severity: normal
          Priority: P2
         Component: libc
          Assignee: unassigned at sourceware dot org
          Reporter: sourceware-bugs at internot dot info
                CC: drepper.fsp at gmail dot com

Per https://sourceware.org/ml/libc-help/2015-03/msg00055.html

"The bug should say that this is a benign race that needs fixing."

There is a benign(non-"important") race condition in the resolv component of
glibc.

In res_send.c:

#ifndef __ASSUME_SOCK_CLOEXEC
static int __have_o_nonblock;
#else
# define __have_o_nonblock 0
#endif


However, also in res_send.c, in the 'reopen' function:

                                if (__have_o_nonblock == 0)
                                        __have_o_nonblock
                                          = (EXT(statp).nssocks[ns] == -1
                                             && errno == EINVAL ? -1 : 1);


'reopen' is called in threads.


Here is a valgrind(drd) output: http://pastebin.com/VhdwRkUx

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


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug libc/18156] getaddrinfo race condition in 'reopen' function
  2015-03-23 19:40 [Bug libc/18156] New: getaddrinfo race condition in 'reopen' function sourceware-bugs at internot dot info
@ 2015-03-23 20:10 ` sourceware-bugs at internot dot info
  2015-03-23 21:54 ` joseph at codesourcery dot com
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: sourceware-bugs at internot dot info @ 2015-03-23 20:10 UTC (permalink / raw)
  To: glibc-bugs

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

--- Comment #1 from Joshua Rogers <sourceware-bugs at internot dot info> ---
Also, this particular race condition happens in my code between

getXXbyYY_r.c:266
and
getXXbyYY_r.c:281

per the manual:
http://valgrind.org/docs/manual/drd-manual.html#drd-manual.data-races

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


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug libc/18156] getaddrinfo race condition in 'reopen' function
  2015-03-23 19:40 [Bug libc/18156] New: getaddrinfo race condition in 'reopen' function sourceware-bugs at internot dot info
  2015-03-23 20:10 ` [Bug libc/18156] " sourceware-bugs at internot dot info
@ 2015-03-23 21:54 ` joseph at codesourcery dot com
  2015-03-24 14:13 ` schwab@linux-m68k.org
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: joseph at codesourcery dot com @ 2015-03-23 21:54 UTC (permalink / raw)
  To: glibc-bugs

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

--- Comment #2 from joseph at codesourcery dot com <joseph at codesourcery dot com> ---
__ASSUME_SOCK_CLOEXEC is always defined for Linux, so the only current 
configuration this could possibly affect is Hurd.

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


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug libc/18156] getaddrinfo race condition in 'reopen' function
  2015-03-23 19:40 [Bug libc/18156] New: getaddrinfo race condition in 'reopen' function sourceware-bugs at internot dot info
  2015-03-23 20:10 ` [Bug libc/18156] " sourceware-bugs at internot dot info
  2015-03-23 21:54 ` joseph at codesourcery dot com
@ 2015-03-24 14:13 ` schwab@linux-m68k.org
  2015-06-05  9:48 ` fweimer at redhat dot com
  2015-08-22 20:40 ` [Bug network/18156] " jsm28 at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: schwab@linux-m68k.org @ 2015-03-24 14:13 UTC (permalink / raw)
  To: glibc-bugs

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

--- Comment #3 from Andreas Schwab <schwab@linux-m68k.org> ---
Every thread will always write the same value.

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


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug libc/18156] getaddrinfo race condition in 'reopen' function
  2015-03-23 19:40 [Bug libc/18156] New: getaddrinfo race condition in 'reopen' function sourceware-bugs at internot dot info
                   ` (2 preceding siblings ...)
  2015-03-24 14:13 ` schwab@linux-m68k.org
@ 2015-06-05  9:48 ` fweimer at redhat dot com
  2015-08-22 20:40 ` [Bug network/18156] " jsm28 at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: fweimer at redhat dot com @ 2015-06-05  9:48 UTC (permalink / raw)
  To: glibc-bugs

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

Florian Weimer <fweimer at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |fweimer at redhat dot com
              Flags|                            |security-

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


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug network/18156] getaddrinfo race condition in 'reopen' function
  2015-03-23 19:40 [Bug libc/18156] New: getaddrinfo race condition in 'reopen' function sourceware-bugs at internot dot info
                   ` (3 preceding siblings ...)
  2015-06-05  9:48 ` fweimer at redhat dot com
@ 2015-08-22 20:40 ` jsm28 at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: jsm28 at gcc dot gnu.org @ 2015-08-22 20:40 UTC (permalink / raw)
  To: glibc-bugs

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

Joseph Myers <jsm28 at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
          Component|libc                        |network

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


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2015-08-22 20:40 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-23 19:40 [Bug libc/18156] New: getaddrinfo race condition in 'reopen' function sourceware-bugs at internot dot info
2015-03-23 20:10 ` [Bug libc/18156] " sourceware-bugs at internot dot info
2015-03-23 21:54 ` joseph at codesourcery dot com
2015-03-24 14:13 ` schwab@linux-m68k.org
2015-06-05  9:48 ` fweimer at redhat dot com
2015-08-22 20:40 ` [Bug network/18156] " jsm28 at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).