From nobody@FreeBSD.org  Tue Feb 24 09:26:38 2009
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id C73E9106568B
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 24 Feb 2009 09:26:38 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21])
	by mx1.freebsd.org (Postfix) with ESMTP id B59488FC18
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 24 Feb 2009 09:26:38 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.14.3/8.14.3) with ESMTP id n1O9QcVu099524
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 24 Feb 2009 09:26:38 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.14.3/8.14.3/Submit) id n1O9QciE099523;
	Tue, 24 Feb 2009 09:26:38 GMT
	(envelope-from nobody)
Message-Id: <200902240926.n1O9QciE099523@www.freebsd.org>
Date: Tue, 24 Feb 2009 09:26:38 GMT
From: david gueluy <david.gueluy@netasq.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: bad usage of the shutdown system call produce a packet with null ip addresses
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         132050
>Category:       kern
>Synopsis:       bad usage of the shutdown system call produce a packet with null ip addresses
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    rwatson
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Feb 24 09:30:00 UTC 2009
>Closed-Date:    Tue Mar 17 10:20:52 UTC 2009
>Last-Modified:  Tue Mar 17 10:20:52 UTC 2009
>Originator:     david gueluy
>Release:        7.1-PRERELEASE
>Organization:
netasq
>Environment:
/usr/obj/usr/src/sys/GENERIC  i386
>Description:
By using a PFIL_HOOK on FreeBSD 7.1-prerelease, I notice that I receive some packets from 0.0.0.0 to 0.0.0.0.

A bugged software in userland produce these packets when the shutdown system call is used on a socket which is not connected.

Even if it's a bad usage of a system call, this case can produce strange behaviours, I think it's necessary to add some checks in tcp_usr_shutdown.

>How-To-Repeat:
Just open a socket and call directly the shutdown function

fd = socket(AF_INET, SOCK_STREAM, 0);
shutdown(fd, SHUT_RDWR);
close(fd);

Add some debug in usr/src/sys/netinet/ip_output.c to dump outgoing packets

./test
proto 6 src 0.0.0.0 dst 0.0.0.0 ttl 64

>Fix:


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->rwatson 
Responsible-Changed-By: rwatson 
Responsible-Changed-When: Tue Feb 24 10:24:24 UTC 2009 
Responsible-Changed-Why:  
Grab ownership; this is likely a result of the changes to preserve the 
inpcb after close, and perhaps an INP_DROPPED check is required 
somewhere.  I'll investigate in the next week or so. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=132050 
State-Changed-From-To: open->analyzed 
State-Changed-By: rwatson 
State-Changed-When: Tue Feb 24 11:14:10 UTC 2009 
State-Changed-Why:  
Indeed, two (tp != NULL) checks were not converted to (!(inp->inp_vflag & 
INP_DROPPED)) checks, leading to tcp_output() being called at a moment 
where it was not appropriate to do so.  Fix should go into the tree 
shortly. 


http://www.freebsd.org/cgi/query-pr.cgi?pr=132050 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/132050: commit references a PR
Date: Tue, 24 Feb 2009 11:17:59 +0000 (UTC)

 Author: rwatson
 Date: Tue Feb 24 11:17:50 2009
 New Revision: 188992
 URL: http://svn.freebsd.org/changeset/base/188992
 
 Log:
   In tcp_usr_shutdown() and tcp_usr_send(), I missed converting NULL
   checks for the tcpcb, previously used to detect complete disconnection,
   with INP_DROPPED checks.  Correct that, preventing shutdown() from
   improperly generating a TCP segment with destination IP and port of
   0.0.0.0:0.
   
   PR:		kern/132050
   Reported by:	david gueluy <david.gueluy at netasq.com>
   MFC after:	3 weeks
 
 Modified:
   head/sys/netinet/tcp_usrreq.c
 
 Modified: head/sys/netinet/tcp_usrreq.c
 ==============================================================================
 --- head/sys/netinet/tcp_usrreq.c	Tue Feb 24 10:48:15 2009	(r188991)
 +++ head/sys/netinet/tcp_usrreq.c	Tue Feb 24 11:17:50 2009	(r188992)
 @@ -695,7 +695,8 @@ tcp_usr_shutdown(struct socket *so)
  	TCPDEBUG1();
  	socantsendmore(so);
  	tcp_usrclosed(tp);
 -	error = tcp_output_disconnect(tp);
 +	if (!(inp->inp_vflag & INP_DROPPED))
 +		error = tcp_output_disconnect(tp);
  
  out:
  	TCPDEBUG2(PRU_SHUTDOWN);
 @@ -828,7 +829,7 @@ tcp_usr_send(struct socket *so, int flag
  			INP_INFO_WUNLOCK(&V_tcbinfo);
  			headlocked = 0;
  		}
 -		if (tp != NULL) {
 +		if (!(inp->inp_vflag & INP_DROPPED)) {
  			if (flags & PRUS_MORETOCOME)
  				tp->t_flags |= TF_MORETOCOME;
  			error = tcp_output_send(tp);
 _______________________________________________
 svn-src-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-src-all
 To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
 
State-Changed-From-To: analyzed->patched 
State-Changed-By: rwatson 
State-Changed-When: Tue Feb 24 11:55:35 UTC 2009 
State-Changed-Why:  
Now believed to be fixed in 8.x with the committed patch -- transition 
to patched until MFC to 7.x.  If you're able to test the patch to 
confirm it DTRT in your environment, that would be most helpful.  Thanks! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=132050 

From: =?ISO-8859-1?Q?david_gu=E9luy?= <david.gueluy@netasq.com>
To: bug-followup@FreeBSD.org, david.gueluy@netasq.com
Cc: Robert Watson <rwatson@FreeBSD.org>
Subject: Re: kern/132050: bad usage of the shutdown system call produce a packet with null ip addresses
Date: Wed, 25 Feb 2009 09:45:46 +0100

 --Apple-Mail-8--453691099
 Content-Type: multipart/alternative;
 	boundary=Apple-Mail-7--453691198
 
 
 --Apple-Mail-7--453691198
 Content-Type: text/plain;
 	charset=ISO-8859-1;
 	format=flowed;
 	delsp=yes
 Content-Transfer-Encoding: quoted-printable
 
 
 I test the patch and don't have null ip adresses anymore,  this bug =20
 seems fixed.
 
 Thank you
 
 Gu=E9luy David=
 
 --Apple-Mail-7--453691198
 Content-Type: text/html;
 	charset=ISO-8859-1
 Content-Transfer-Encoding: quoted-printable
 
 <html><body style=3D"word-wrap: break-word; -webkit-nbsp-mode: space; =
 -webkit-line-break: after-white-space; "><div><br></div><div>I test the =
 patch and don't have null ip adresses anymore,&nbsp;&nbsp;this bug seems =
 fixed.</div><div><br></div><div>Thank you</div><br><div =
 apple-content-edited=3D"true"> <span class=3D"Apple-style-span" =
 style=3D"border-collapse: separate; color: rgb(0, 0, 0); font-family: =
 Helvetica; font-size: 12px; font-style: normal; font-variant: normal; =
 font-weight: normal; letter-spacing: normal; line-height: normal; =
 orphans: 2; text-align: auto; text-indent: 0px; text-transform: none; =
 white-space: normal; widows: 2; word-spacing: 0px; =
 -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: =
 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: =
 auto; -webkit-text-stroke-width: 0; "><div style=3D"word-wrap: =
 break-word; -webkit-nbsp-mode: space; -webkit-line-break: =
 after-white-space; "><span class=3D"Apple-style-span" =
 style=3D"border-collapse: separate; color: rgb(0, 0, 0); font-family: =
 Helvetica; font-size: 12px; font-style: normal; font-variant: normal; =
 font-weight: normal; letter-spacing: normal; line-height: normal; =
 orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; =
 widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; =
 -webkit-border-vertical-spacing: 0px; =
 -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: =
 auto; -webkit-text-stroke-width: 0px; "><div style=3D"word-wrap: =
 break-word; -webkit-nbsp-mode: space; -webkit-line-break: =
 after-white-space; "><span class=3D"Apple-style-span" =
 style=3D"border-collapse: separate; color: rgb(0, 0, 0); font-family: =
 Helvetica; font-size: 12px; font-style: normal; font-variant: normal; =
 font-weight: normal; letter-spacing: normal; line-height: normal; =
 orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; =
 widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; =
 -webkit-border-vertical-spacing: 0px; =
 -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: =
 auto; -webkit-text-stroke-width: 0px; "><div style=3D"word-wrap: =
 break-word; -webkit-nbsp-mode: space; -webkit-line-break: =
 after-white-space; "><span class=3D"Apple-style-span" =
 style=3D"border-collapse: separate; color: rgb(0, 0, 0); font-family: =
 Helvetica; font-size: 12px; font-style: normal; font-variant: normal; =
 font-weight: normal; letter-spacing: normal; line-height: normal; =
 orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; =
 widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; =
 -webkit-border-vertical-spacing: 0px; =
 -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: =
 auto; -webkit-text-stroke-width: 0px; "><div style=3D"word-wrap: =
 break-word; -webkit-nbsp-mode: space; -webkit-line-break: =
 after-white-space; "><span class=3D"Apple-style-span" =
 style=3D"border-collapse: separate; color: rgb(0, 0, 0); font-family: =
 Helvetica; font-size: 12px; font-style: normal; font-variant: normal; =
 font-weight: normal; letter-spacing: normal; line-height: normal; =
 orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; =
 widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; =
 -webkit-border-vertical-spacing: 0px; =
 -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: =
 auto; -webkit-text-stroke-width: 0px; "><div style=3D"word-wrap: =
 break-word; -webkit-nbsp-mode: space; -webkit-line-break: =
 after-white-space; "><span class=3D"Apple-style-span" =
 style=3D"border-collapse: separate; color: rgb(0, 0, 0); font-family: =
 Helvetica; font-size: 12px; font-style: normal; font-variant: normal; =
 font-weight: normal; letter-spacing: normal; line-height: normal; =
 orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; =
 widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; =
 -webkit-border-vertical-spacing: 0px; =
 -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: =
 auto; -webkit-text-stroke-width: 0px; "><span class=3D"Apple-style-span" =
 style=3D"border-collapse: separate; color: rgb(0, 0, 0); font-family: =
 Helvetica; font-size: 12px; font-style: normal; font-variant: normal; =
 font-weight: normal; letter-spacing: normal; line-height: normal; =
 orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; =
 widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; =
 -webkit-border-vertical-spacing: 0px; =
 -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: =
 auto; -webkit-text-stroke-width: 0px; "><span class=3D"Apple-style-span" =
 style=3D"border-collapse: separate; color: rgb(0, 0, 0); font-family: =
 Helvetica; font-size: 12px; font-style: normal; font-variant: normal; =
 font-weight: normal; letter-spacing: normal; line-height: normal; =
 orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; =
 widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; =
 -webkit-border-vertical-spacing: 0px; =
 -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: =
 auto; -webkit-text-stroke-width: 0px; "><span class=3D"Apple-style-span" =
 style=3D"border-collapse: separate; color: rgb(0, 0, 0); font-family: =
 Helvetica; font-size: 12px; font-style: normal; font-variant: normal; =
 font-weight: normal; letter-spacing: normal; line-height: normal; =
 orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; =
 widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; =
 -webkit-border-vertical-spacing: 0px; =
 -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: =
 auto; -webkit-text-stroke-width: 0px; "><div style=3D"word-wrap: =
 break-word; -webkit-nbsp-mode: space; -webkit-line-break: =
 after-white-space; "><div><span class=3D"Apple-style-span" =
 style=3D"font-family: Verdana; font-size: 13px; ">Gu=E9luy =
 David</span></div></div></span></span></span></span></div></span></div></s=
 pan></div></span></div></span></div></span></div></body></html>=
 
 --Apple-Mail-7--453691198--
 
 --Apple-Mail-8--453691099
 Content-Disposition: attachment;
 	filename=smime.p7s
 Content-Type: application/pkcs7-signature;
 	name=smime.p7s
 Content-Transfer-Encoding: base64
 
 MIAGCSqGSIb3DQEHAqCAMIACAQExCzAJBgUrDgMCGgUAMIAGCSqGSIb3DQEHAQAAoIIGeTCCBnUw
 ggVdoAMCAQICCnDGsUgWa/KQanIwDQYJKoZIhvcNAQEEBQAwgZExCzAJBgNVBAYTAkZSMQ0wCwYD
 VQQIEwROb3JkMRowGAYDVQQHExFWaWxsZW5ldXZlIGQnQXNjcTEuMCwGA1UEChMlTkVUQVNRIC0g
 U2VjdXJlIEludGVybmV0IENvbm5lY3Rpdml0eTEnMCUGA1UECxMeTkVUQVNRIENlcnRpZmljYXRp
 b24gQXV0aG9yaXR5MB4XDTA4MDEyODExMjI1OFoXDTEwMDEyNzExMjI1OFowgdAxCzAJBgNVBAYU
 AkZSMQ0wCwYDVQQIFAROb3JkMS4wLAYDVQQKFCVORVRBU1EgLSBTZWN1cmUgSW50ZXJuZXQgQ29u
 bmVjdGl2aXR5MScwJQYDVQQLFB5ORVRBU1EgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkxGjAYBgNV
 BAcUEVZpbGxlbmV1dmUgZCdBc2NxMRUwEwYDVQQDFAxEYXZpZCBHVUVMVVkxJjAkBgkqhkiG9w0B
 CQEWF2RhdmlkLmd1ZWx1eUBuZXRhc3EuY29tMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKC
 AQEA3lkk8R2HPiFxRxUSvrbX9b9m2cQBg1eMjIvhAzYeM5i7WXZgJojI44mie+AqlY6DropneX07
 9cw7UC8VQrNcc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QQLEx5ORVRBU1EgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkCCnDGsUgW
 a/KQanIwgbMGCyqGSIb3DQEJEAILMYGjoIGgMIGRMQswCQYDVQQGEwJGUjENMAsGA1UECBMETm9y
 ZDEaMBgGA1UEBxMRVmlsbGVuZXV2ZSBkJ0FzY3ExLjAsBgNVBAoTJU5FVEFTUSAtIFNlY3VyZSBJ
 bnRlcm5ldCBDb25uZWN0aXZpdHkxJzAlBgNVBAsTHk5FVEFTUSBDZXJ0aWZpY2F0aW9uIEF1dGhv
 cml0eQIKcMaxSBZr8pBqcjANBgkqhkiG9w0BAQEFAASCAQAU+YJOjsVUVc/W8zsc1O56LG2uZ97o
 Vpa09DX0uhM+fGssOd/okGBB1Kf2eUY5MyW8o/uexoiZwywnU0KMct45VAspgMBZCYECnZ8s51q5
 couIVHrJWSi59A9M/j8LRBjMMwAERcOKSdQ65mlSiU36cfsHNaAANzRHgdpgly1+kNRzQYNZ3nTQ
 F3i1bf+Djy9UTncswDFRWYTD+x+rvB1qlczW6ky1c8OCLsONyAc5FRwtiVYt+6gif6/0MNrKD1PN
 JMhNK7ptnQKyKCv0/XC0LKb1EJeONoJBDyL8HNTN8jVYb6O2oXcOwHWneij7iYVdiLWv/XaTZb7f
 Qo9ovOxOAAAAAAAA
 
 --Apple-Mail-8--453691099--
 

From: =?ISO-8859-1?Q?david_gu=E9luy?= <david.gueluy@netasq.com>
To: bug-followup@FreeBSD.org, david.gueluy@netasq.com
Cc: Robert Watson <rwatson@FreeBSD.org>
Subject: Re: kern/132050: bad usage of the shutdown system call produce a packet with null ip addresses
Date: Wed, 25 Feb 2009 09:45:46 +0100

 --Apple-Mail-8--453691099
 Content-Type: multipart/alternative;
 	boundary=Apple-Mail-7--453691198
 
 
 --Apple-Mail-7--453691198
 Content-Type: text/plain;
 	charset=ISO-8859-1;
 	format=flowed;
 	delsp=yes
 Content-Transfer-Encoding: quoted-printable
 
 
 I test the patch and don't have null ip adresses anymore,  this bug =20
 seems fixed.
 
 Thank you
 
 Gu=E9luy David=
 
 --Apple-Mail-7--453691198
 Content-Type: text/html;
 	charset=ISO-8859-1
 Content-Transfer-Encoding: quoted-printable
 
 <html><body style=3D"word-wrap: break-word; -webkit-nbsp-mode: space; =
 -webkit-line-break: after-white-space; "><div><br></div><div>I test the =
 patch and don't have null ip adresses anymore,&nbsp;&nbsp;this bug seems =
 fixed.</div><div><br></div><div>Thank you</div><br><div =
 apple-content-edited=3D"true"> <span class=3D"Apple-style-span" =
 style=3D"border-collapse: separate; color: rgb(0, 0, 0); font-family: =
 Helvetica; font-size: 12px; font-style: normal; font-variant: normal; =
 font-weight: normal; letter-spacing: normal; line-height: normal; =
 orphans: 2; text-align: auto; text-indent: 0px; text-transform: none; =
 white-space: normal; widows: 2; word-spacing: 0px; =
 -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: =
 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: =
 auto; -webkit-text-stroke-width: 0; "><div style=3D"word-wrap: =
 break-word; -webkit-nbsp-mode: space; -webkit-line-break: =
 after-white-space; "><span class=3D"Apple-style-span" =
 style=3D"border-collapse: separate; color: rgb(0, 0, 0); font-family: =
 Helvetica; font-size: 12px; font-style: normal; font-variant: normal; =
 font-weight: normal; letter-spacing: normal; line-height: normal; =
 orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; =
 widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; =
 -webkit-border-vertical-spacing: 0px; =
 -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: =
 auto; -webkit-text-stroke-width: 0px; "><div style=3D"word-wrap: =
 break-word; -webkit-nbsp-mode: space; -webkit-line-break: =
 after-white-space; "><span class=3D"Apple-style-span" =
 style=3D"border-collapse: separate; color: rgb(0, 0, 0); font-family: =
 Helvetica; font-size: 12px; font-style: normal; font-variant: normal; =
 font-weight: normal; letter-spacing: normal; line-height: normal; =
 orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; =
 widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; =
 -webkit-border-vertical-spacing: 0px; =
 -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: =
 auto; -webkit-text-stroke-width: 0px; "><div style=3D"word-wrap: =
 break-word; -webkit-nbsp-mode: space; -webkit-line-break: =
 after-white-space; "><span class=3D"Apple-style-span" =
 style=3D"border-collapse: separate; color: rgb(0, 0, 0); font-family: =
 Helvetica; font-size: 12px; font-style: normal; font-variant: normal; =
 font-weight: normal; letter-spacing: normal; line-height: normal; =
 orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; =
 widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; =
 -webkit-border-vertical-spacing: 0px; =
 -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: =
 auto; -webkit-text-stroke-width: 0px; "><div style=3D"word-wrap: =
 break-word; -webkit-nbsp-mode: space; -webkit-line-break: =
 after-white-space; "><span class=3D"Apple-style-span" =
 style=3D"border-collapse: separate; color: rgb(0, 0, 0); font-family: =
 Helvetica; font-size: 12px; font-style: normal; font-variant: normal; =
 font-weight: normal; letter-spacing: normal; line-height: normal; =
 orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; =
 widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; =
 -webkit-border-vertical-spacing: 0px; =
 -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: =
 auto; -webkit-text-stroke-width: 0px; "><div style=3D"word-wrap: =
 break-word; -webkit-nbsp-mode: space; -webkit-line-break: =
 after-white-space; "><span class=3D"Apple-style-span" =
 style=3D"border-collapse: separate; color: rgb(0, 0, 0); font-family: =
 Helvetica; font-size: 12px; font-style: normal; font-variant: normal; =
 font-weight: normal; letter-spacing: normal; line-height: normal; =
 orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; =
 widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; =
 -webkit-border-vertical-spacing: 0px; =
 -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: =
 auto; -webkit-text-stroke-width: 0px; "><span class=3D"Apple-style-span" =
 style=3D"border-collapse: separate; color: rgb(0, 0, 0); font-family: =
 Helvetica; font-size: 12px; font-style: normal; font-variant: normal; =
 font-weight: normal; letter-spacing: normal; line-height: normal; =
 orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; =
 widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; =
 -webkit-border-vertical-spacing: 0px; =
 -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: =
 auto; -webkit-text-stroke-width: 0px; "><span class=3D"Apple-style-span" =
 style=3D"border-collapse: separate; color: rgb(0, 0, 0); font-family: =
 Helvetica; font-size: 12px; font-style: normal; font-variant: normal; =
 font-weight: normal; letter-spacing: normal; line-height: normal; =
 orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; =
 widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; =
 -webkit-border-vertical-spacing: 0px; =
 -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: =
 auto; -webkit-text-stroke-width: 0px; "><span class=3D"Apple-style-span" =
 style=3D"border-collapse: separate; color: rgb(0, 0, 0); font-family: =
 Helvetica; font-size: 12px; font-style: normal; font-variant: normal; =
 font-weight: normal; letter-spacing: normal; line-height: normal; =
 orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; =
 widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; =
 -webkit-border-vertical-spacing: 0px; =
 -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: =
 auto; -webkit-text-stroke-width: 0px; "><div style=3D"word-wrap: =
 break-word; -webkit-nbsp-mode: space; -webkit-line-break: =
 after-white-space; "><div><span class=3D"Apple-style-span" =
 style=3D"font-family: Verdana; font-size: 13px; ">Gu=E9luy =
 David</span></div></div></span></span></span></span></div></span></div></s=
 pan></div></span></div></span></div></span></div></body></html>=
 
 --Apple-Mail-7--453691198--
 
 --Apple-Mail-8--453691099
 Content-Disposition: attachment;
 	filename=smime.p7s
 Content-Type: application/pkcs7-signature;
 	name=smime.p7s
 Content-Transfer-Encoding: base64
 
 MIAGCSqGSIb3DQEHAqCAMIACAQExCzAJBgUrDgMCGgUAMIAGCSqGSIb3DQEHAQAAoIIGeTCCBnUw
 ggVdoAMCAQICCnDGsUgWa/KQanIwDQYJKoZIhvcNAQEEBQAwgZExCzAJBgNVBAYTAkZSMQ0wCwYD
 VQQIEwROb3JkMRowGAYDVQQHExFWaWxsZW5ldXZlIGQnQXNjcTEuMCwGA1UEChMlTkVUQVNRIC0g
 U2VjdXJlIEludGVybmV0IENvbm5lY3Rpdml0eTEnMCUGA1UECxMeTkVUQVNRIENlcnRpZmljYXRp
 b24gQXV0aG9yaXR5MB4XDTA4MDEyODExMjI1OFoXDTEwMDEyNzExMjI1OFowgdAxCzAJBgNVBAYU
 AkZSMQ0wCwYDVQQIFAROb3JkMS4wLAYDVQQKFCVORVRBU1EgLSBTZWN1cmUgSW50ZXJuZXQgQ29u
 bmVjdGl2aXR5MScwJQYDVQQLFB5ORVRBU1EgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkxGjAYBgNV
 BAcUEVZpbGxlbmV1dmUgZCdBc2NxMRUwEwYDVQQDFAxEYXZpZCBHVUVMVVkxJjAkBgkqhkiG9w0B
 CQEWF2RhdmlkLmd1ZWx1eUBuZXRhc3EuY29tMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKC
 AQEA3lkk8R2HPiFxRxUSvrbX9b9m2cQBg1eMjIvhAzYeM5i7WXZgJojI44mie+AqlY6DropneX07
 9cw7UC8VQrNcc9mJ4iUd+SD0mFWj1K2jB/F0GRK7rEhLI2wfBAR75LxVWYA9/X6uZ0JE3mTYrWfo
 Hy40fCIfW+Wi47UPQtfmfDGdfcirmp+Ed7csIQ18PyiRIWCUjkvd2suEPHNt1KG8M0XvjRwkbYE+
 xAft2SYVPX/OKSqOqt3gf0yL1Z443CuE8WOJZQ/mzM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JU5FVEFTUSAtIFNlY3VyZSBJ
 bnRlcm5ldCBDb25uZWN0aXZpdHkxJzAlBgNVBAsTHk5FVEFTUSBDZXJ0aWZpY2F0aW9uIEF1dGhv
 cml0eQIKcMaxSBZr8pBqcjANBgkqhkiG9w0BAQEFAASCAQAU+YJOjsVUVc/W8zsc1O56LG2uZ97o
 Vpa09DX0uhM+fGssOd/okGBB1Kf2eUY5MyW8o/uexoiZwywnU0KMct45VAspgMBZCYECnZ8s51q5
 couIVHrJWSi59A9M/j8LRBjMMwAERcOKSdQ65mlSiU36cfsHNaAANzRHgdpgly1+kNRzQYNZ3nTQ
 F3i1bf+Djy9UTncswDFRWYTD+x+rvB1qlczW6ky1c8OCLsONyAc5FRwtiVYt+6gif6/0MNrKD1PN
 JMhNK7ptnQKyKCv0/XC0LKb1EJeONoJBDyL8HNTN8jVYb6O2oXcOwHWneij7iYVdiLWv/XaTZb7f
 Qo9ovOxOAAAAAAAA
 
 --Apple-Mail-8--453691099--

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/132050: commit references a PR
Date: Tue, 17 Mar 2009 10:16:00 +0000 (UTC)

 Author: rwatson
 Date: Tue Mar 17 10:15:49 2009
 New Revision: 189920
 URL: http://svn.freebsd.org/changeset/base/189920
 
 Log:
   Merge r188992 from head to stable/7:
   
     In tcp_usr_shutdown() and tcp_usr_send(), I missed converting NULL
     checks for the tcpcb, previously used to detect complete disconnection,
     with INP_DROPPED checks.  Correct that, preventing shutdown() from
     improperly generating a TCP segment with destination IP and port of
     0.0.0.0:0.
   
     PR:           kern/132050
     Reported by:  david gueluy <david.gueluy at netasq.com>
 
 Modified:
   stable/7/sys/   (props changed)
   stable/7/sys/contrib/pf/   (props changed)
   stable/7/sys/dev/ath/ath_hal/   (props changed)
   stable/7/sys/dev/cxgb/   (props changed)
   stable/7/sys/netinet/tcp_usrreq.c
 
 Modified: stable/7/sys/netinet/tcp_usrreq.c
 ==============================================================================
 --- stable/7/sys/netinet/tcp_usrreq.c	Tue Mar 17 09:50:40 2009	(r189919)
 +++ stable/7/sys/netinet/tcp_usrreq.c	Tue Mar 17 10:15:49 2009	(r189920)
 @@ -712,7 +712,8 @@ tcp_usr_shutdown(struct socket *so)
  	TCPDEBUG1();
  	socantsendmore(so);
  	tcp_usrclosed(tp);
 -	error = tcp_output_disconnect(tp);
 +	if (!(inp->inp_vflag & INP_DROPPED))
 +		error = tcp_output_disconnect(tp);
  
  out:
  	TCPDEBUG2(PRU_SHUTDOWN);
 @@ -844,7 +845,7 @@ tcp_usr_send(struct socket *so, int flag
  			INP_INFO_WUNLOCK(&tcbinfo);
  			headlocked = 0;
  		}
 -		if (tp != NULL) {
 +		if (!(inp->inp_vflag & INP_DROPPED)) {
  			if (flags & PRUS_MORETOCOME)
  				tp->t_flags |= TF_MORETOCOME;
  			error = tcp_output_send(tp);
 _______________________________________________
 svn-src-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-src-all
 To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
 
State-Changed-From-To: patched->closed 
State-Changed-By: rwatson 
State-Changed-When: Tue Mar 17 10:20:18 UTC 2009 
State-Changed-Why:  
Close now that the fix is merged to 7.x; it should appear in the forthcoming 
7.2.  Thanks for the report! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=132050 
>Unformatted:
