Bug 171237

Summary: app connects to itself using loopback device
Product: Red Hat Enterprise Linux 3 Reporter: Marc Mondragon <marcmo>
Component: kernelAssignee: David Miller <davem>
Status: CLOSED WONTFIX QA Contact: Brian Brock <bbrock>
Severity: medium Docs Contact:
Priority: medium    
Version: 3.0CC: petrides
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2007-10-19 18:52:28 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
test case for bug report none

Description Marc Mondragon 2005-10-19 19:50:00 UTC
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

How reproducible:
Always

Steps to Reproduce:
1. See description
2.
3.
  

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.

Additional info:

Comment 1 Marc Mondragon 2005-10-19 19:52:37 UTC
Created attachment 120169 [details]
test case for bug report

Comment 2 RHEL Program Management 2007-10-19 18:52:28 UTC
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:
http://www.redhat.com/security/updates/errata/
 
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.