Red Hat Bugzilla – Bug 171237
app connects to itself using loopback device
Last modified: 2007-11-30 17:07:08 EST
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.12) Gecko/20050921 Red Hat/1.0.7-1.4.1 Firefox/1.0.7
Description of problem:
This program exposes a Linux bug where you can actually get connected to yourself when trying to connect to a server on the local host.
Compile this program with "g++ -o sample sample.C"
Pick a port number >= 32768 that's currently not in use
(verify that "netstat -a 2> /dev/null | grep portNumber" produces no output).
Run "sample [portNumber]"
Briefly, it will report that it's connected and print netstat output showing a socket connection to itself:
tcp 0 0 localhost.localdomain:51000 localhost.localdomain:51000 ESTABLISHED
The key to exposing the bug is attempting to connect as fast as possible with no delay between connection attempts.
Version-Release number of selected component (if applicable):
kernel-2.6.9-11 & kernel-2.4.21-32.0.1
Steps to Reproduce:
1. See description
Actual Results: See description
Expected Results: According to the developer: On Solaris the same program will not connect to itself and our app functions properly. I've attached an example program that can cause this to occur. We've coded around it but I'd like to find out if it is a bug or a linux-ism.
Created attachment 120169 [details]
test case for bug report
This bug is filed against RHEL 3, which is in maintenance phase.
During the maintenance phase, only security errata and select mission
critical bug fixes will be released for enterprise products. Since
this bug does not meet that criteria, it is now being closed.
For more information of the RHEL errata support policy, please visit:
If you feel this bug is indeed mission critical, please contact your
support representative. You may be asked to provide detailed
information on how this bug is affecting you.