From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6821 invoked by alias); 29 Jan 2015 02:43:33 -0000 Mailing-List: contact glibc-bugs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: glibc-bugs-owner@sourceware.org Received: (qmail 6670 invoked by uid 48); 29 Jan 2015 02:43:17 -0000 From: "jirka at fud dot cz" To: glibc-bugs@sourceware.org Subject: [Bug network/15946] getaddrinfo() writes DNS queries to random file descriptors under high load Date: Thu, 29 Jan 2015 02:43:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: glibc X-Bugzilla-Component: network X-Bugzilla-Version: unspecified X-Bugzilla-Keywords: X-Bugzilla-Severity: critical X-Bugzilla-Who: jirka at fud dot cz X-Bugzilla-Status: RESOLVED X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: 2.20 X-Bugzilla-Flags: security+ X-Bugzilla-Changed-Fields: bug_status cc resolution Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2015-01/txt/msg00226.txt.bz2 https://sourceware.org/bugzilla/show_bug.cgi?id=15946 Jiri Hruska changed: What |Removed |Added ---------------------------------------------------------------------------- Status|REOPENED |RESOLVED CC| |jirka at fud dot cz Resolution|--- |FIXED --- Comment #14 from Jiri Hruska --- That's a bug in the attached test case, though, not in glibc any more. Line 122 should have `m = -1` instead of `m = 0`. Otherwise if the very first dup() call fails, the close loop below will still do one iteration and close somebody else's random file descriptor at fds[0]. To verify this, you can add the following before the `break` at line 158: if (errno == EMFILE) { + if (m == 0) + printf("Yo Dawg I herd you like bugs so I put a bug in your bug.c\n"); break; } else { When running the program now, every alleged error was preceded by this message just before, and I wasn't able to trigger the bug at all when the code was corrected as suggested above. Marking as RESOLVED/FIXED again. -- You are receiving this mail because: You are on the CC list for the bug.