From venglin@freebsd.lublin.pl  Fri Aug 10 05:05:04 2001
Return-Path: <venglin@freebsd.lublin.pl>
Received: from mailhost.freebsd.lublin.pl (mailhost.freebsd.lublin.pl [212.182.115.12])
	by hub.freebsd.org (Postfix) with ESMTP id C73E637B405
	for <FreeBSD-gnats-submit@freebsd.org>; Fri, 10 Aug 2001 05:05:02 -0700 (PDT)
	(envelope-from venglin@freebsd.lublin.pl)
Received: from lagoon.freebsd.lublin.pl (qmailr@lagoon.freebsd.lublin.pl [212.182.115.11])
	by mailhost.freebsd.lublin.pl (8.11.4/8.11.4) with SMTP id f7AC4iw26229
	for <FreeBSD-gnats-submit@freebsd.org>; Fri, 10 Aug 2001 14:04:44 +0200 (CEST)
	(envelope-from venglin@freebsd.lublin.pl)
Received: (qmail 26224 invoked by uid 1001); 10 Aug 2001 12:04:43 -0000
Message-Id: <20010810120443.26223.qmail@lagoon.freebsd.lublin.pl>
Date: 10 Aug 2001 12:04:43 -0000
From: Przemyslaw Frasunek <venglin@freebsd.lublin.pl>
Reply-To: Przemyslaw Frasunek <venglin@freebsd.lublin.pl>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: kernel doesn't check if newly allocated ephemerical port is occupied by ipnat rdr
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         29602
>Category:       kern
>Synopsis:       kernel doesn't check if newly allocated ephemerical port is occupied by ipnat rdr
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    darrenr
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Aug 10 05:10:01 PDT 2001
>Closed-Date:    Fri Oct 19 21:34:34 PDT 2001
>Last-Modified:  Fri Oct 19 21:34:51 PDT 2001
>Originator:     Przemyslaw Frasunek
>Release:        FreeBSD 4.3-STABLE i386
>Organization:
czuby.net
>Environment:
System: FreeBSD lagoon.freebsd.lublin.pl 4.3-STABLE FreeBSD 4.3-STABLE #0: Wed Jul 18 11:43:39 CEST 2001 root@riget.scene.pl:/mnt/lagoon/usr/src/sys/compile/RIGET i386

With ipfilter+ipnat.

>Description:

	When ephemerical port is allocated for outgoing connection, kernel
	doesn't check if port is already occupied by ipnat redirection.

	Such condition is very rare, but still possible:

intercom:root:/usr/src/sys/netinet# ipnat -l | grep 3389
rdr fxp0 195.205.36.110/32 port 3389 -> 192.168.0.100 port 3389 tcp
RDR 192.168.0.100   3389  <- -> 195.205.36.110  3389  [212.2.96.35 80]

	Source of redirected connection seems to be 212.2.96.35:80, which
	is impossible. 212.182.96.35:80 is destination of connection
	initiated from 195.205.36.110:3389 from local machine.

>How-To-Repeat:

	Set up an ipnat redirection on low epheremical port and do some
	connect()s.

>Fix:

	Unknown.
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->darrenr 
Responsible-Changed-By: kris 
Responsible-Changed-When: Fri Aug 10 15:00:47 PDT 2001 
Responsible-Changed-Why:  
Darrenr maintains ipfilter 

http://www.FreeBSD.org/cgi/query-pr.cgi?pr=29602 
State-Changed-From-To: open->closed 
State-Changed-By: darrenr 
State-Changed-When: Fri Oct 19 21:34:34 PDT 2001 
State-Changed-Why:  
this is a known restruction of ipfilter. 

http://www.FreeBSD.org/cgi/query-pr.cgi?pr=29602 
>Unformatted:
