From nobody@FreeBSD.org  Tue Dec  8 16:21:58 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 471E510656AC
	for <freebsd-gnats-submit@FreeBSD.org>; Tue,  8 Dec 2009 16:21:58 +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 369838FC17
	for <freebsd-gnats-submit@FreeBSD.org>; Tue,  8 Dec 2009 16:21:58 +0000 (UTC)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.14.3/8.14.3) with ESMTP id nB8GLvjX097256
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 8 Dec 2009 16:21:57 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.14.3/8.14.3/Submit) id nB8GLvsW097255;
	Tue, 8 Dec 2009 16:21:57 GMT
	(envelope-from nobody)
Message-Id: <200912081621.nB8GLvsW097255@www.freebsd.org>
Date: Tue, 8 Dec 2009 16:21:57 GMT
From: Petr Lampa <lampa@fit.vutbr.cz>
To: freebsd-gnats-submit@FreeBSD.org
Subject: newnfs panic "nfs sent cache" with IPv6
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         141289
>Category:       kern
>Synopsis:       [nfs] [panic] newnfs panic "nfs sent cache" with IPv6
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    delphij
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Dec 08 16:30:06 UTC 2009
>Closed-Date:    Tue Dec 15 01:15:07 UTC 2009
>Last-Modified:  Tue Dec 15 01:20:00 UTC 2009
>Originator:     Petr Lampa
>Release:        8.0-STABLE
>Organization:
FIT BUT
>Environment:
FreeBSD 8.0-STABLE FreeBSD 8.0-STABLE #4: Tue Dec  8 15:49:48 CET 2009     root@:/usr/src/sys/i386/compile/XXX i386
>Description:
If newnfs server is accessed using IPv6, it immediately panics with "nfs sent cache". The reason is missing AF_INET6 check at line 526 in fs/nfsserver/nfs_nfsdcache.c:

                 if (so->so_proto->pr_domain->dom_family != AF_INET ||
                    so->so_proto->pr_protocol != IPPROTO_TCP)
                        panic("nfs sent cache");

>How-To-Repeat:
Mount NFSv4 using IPv6 and newnfs server.
>Fix:
Change the line 526-527 sys/fs/nfsserver/nfs_nfsdcache.c to:

                if ((so->so_proto->pr_domain->dom_family != AF_INET &&
                    so->so_proto->pr_domain->dom_family != AF_INET6) ||
                    so->so_proto->pr_protocol != IPPROTO_TCP)
                        panic("nfs sent cache");

It works after that.

>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->freebsd-fs 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Tue Dec 8 17:44:06 UTC 2009 
Responsible-Changed-Why:  
Over to maintainer(s). 

http://www.freebsd.org/cgi/query-pr.cgi?pr=141289 
State-Changed-From-To: open->patched 
State-Changed-By: delphij 
State-Changed-When: Tue Dec 8 23:44:34 UTC 2009 
State-Changed-Why:  
Patch applied against -HEAD, MFC reminder. 


Responsible-Changed-From-To: freebsd-fs->delphij 
Responsible-Changed-By: delphij 
Responsible-Changed-When: Tue Dec 8 23:44:34 UTC 2009 
Responsible-Changed-Why:  
Take. 

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

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/141289: commit references a PR
Date: Tue,  8 Dec 2009 23:43:59 +0000 (UTC)

 Author: delphij
 Date: Tue Dec  8 23:43:50 2009
 New Revision: 200287
 URL: http://svn.freebsd.org/changeset/base/200287
 
 Log:
   Allow using IPv6 in nfsrvd_sentcache() callback.
   
   PR:		kern/141289
   Submitted by:	Petr Lampa <lampa fit vutbr cz>
   Approved by:	rmacklem
   MFC after:	1 week
 
 Modified:
   head/sys/fs/nfsserver/nfs_nfsdcache.c
 
 Modified: head/sys/fs/nfsserver/nfs_nfsdcache.c
 ==============================================================================
 --- head/sys/fs/nfsserver/nfs_nfsdcache.c	Tue Dec  8 23:34:34 2009	(r200286)
 +++ head/sys/fs/nfsserver/nfs_nfsdcache.c	Tue Dec  8 23:43:50 2009	(r200287)
 @@ -522,8 +522,9 @@ nfsrvd_sentcache(struct nfsrvcache *rp, 
  	if (!(rp->rc_flag & RC_LOCKED))
  		panic("nfsrvd_sentcache not locked");
  	if (!err) {
 -		if (so->so_proto->pr_domain->dom_family != AF_INET ||
 -		    so->so_proto->pr_protocol != IPPROTO_TCP)
 +		if ((so->so_proto->pr_domain->dom_family != AF_INET &&
 +		     so->so_proto->pr_domain->dom_family != AF_INET6) ||
 +		     so->so_proto->pr_protocol != IPPROTO_TCP)
  			panic("nfs sent cache");
  		if (nfsrv_getsockseqnum(so, &rp->rc_tcpseq))
  			rp->rc_flag |= RC_TCPSEQ;
 _______________________________________________
 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: delphij 
State-Changed-When: Tue Dec 15 01:14:46 UTC 2009 
State-Changed-Why:  
Patch applied to 8.0-STABLE.  Thanks for your submission! 

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

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/141289: commit references a PR
Date: Tue, 15 Dec 2009 01:14:52 +0000 (UTC)

 Author: delphij
 Date: Tue Dec 15 01:14:33 2009
 New Revision: 200562
 URL: http://svn.freebsd.org/changeset/base/200562
 
 Log:
   MFC r200287:
   
   Allow using IPv6 in nfsrvd_sentcache() callback.
   
   PR:		kern/141289
   Submitted by:	Petr Lampa <lampa fit vutbr cz>
 
 Modified:
   stable/8/sys/fs/nfsserver/nfs_nfsdcache.c
 Directory Properties:
   stable/8/sys/   (props changed)
   stable/8/sys/amd64/include/xen/   (props changed)
   stable/8/sys/cddl/contrib/opensolaris/   (props changed)
   stable/8/sys/contrib/dev/acpica/   (props changed)
   stable/8/sys/contrib/pf/   (props changed)
   stable/8/sys/dev/xen/xenpci/   (props changed)
 
 Modified: stable/8/sys/fs/nfsserver/nfs_nfsdcache.c
 ==============================================================================
 --- stable/8/sys/fs/nfsserver/nfs_nfsdcache.c	Tue Dec 15 00:44:33 2009	(r200561)
 +++ stable/8/sys/fs/nfsserver/nfs_nfsdcache.c	Tue Dec 15 01:14:33 2009	(r200562)
 @@ -522,8 +522,9 @@ nfsrvd_sentcache(struct nfsrvcache *rp, 
  	if (!(rp->rc_flag & RC_LOCKED))
  		panic("nfsrvd_sentcache not locked");
  	if (!err) {
 -		if (so->so_proto->pr_domain->dom_family != AF_INET ||
 -		    so->so_proto->pr_protocol != IPPROTO_TCP)
 +		if ((so->so_proto->pr_domain->dom_family != AF_INET &&
 +		     so->so_proto->pr_domain->dom_family != AF_INET6) ||
 +		     so->so_proto->pr_protocol != IPPROTO_TCP)
  			panic("nfs sent cache");
  		if (nfsrv_getsockseqnum(so, &rp->rc_tcpseq))
  			rp->rc_flag |= RC_TCPSEQ;
 _______________________________________________
 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"
 
>Unformatted:
