Bug 141289 - [nfs] [panic] newnfs panic "nfs sent cache" with IPv6
Summary: [nfs] [panic] newnfs panic "nfs sent cache" with IPv6
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: 8.0-STABLE
Hardware: Any Any
: Normal Affects Only Me
Assignee: Xin LI
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-12-08 16:30 UTC by lampa
Modified: 2009-12-15 01:20 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description lampa 2009-12-08 16:30:06 UTC
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");

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.
How-To-Repeat: Mount NFSv4 using IPv6 and newnfs server.
Comment 1 Mark Linimon freebsd_committer freebsd_triage 2009-12-08 17:44:06 UTC
Responsible Changed
From-To: freebsd-bugs->freebsd-fs

Over to maintainer(s).
Comment 2 dfilter service freebsd_committer freebsd_triage 2009-12-08 23:43:59 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"
Comment 3 Xin LI freebsd_committer freebsd_triage 2009-12-08 23:44:34 UTC
State Changed
From-To: open->patched

Patch applied against -HEAD, MFC reminder. 


Comment 4 Xin LI freebsd_committer freebsd_triage 2009-12-08 23:44:34 UTC
Responsible Changed
From-To: freebsd-fs->delphij

Take.
Comment 5 Xin LI freebsd_committer freebsd_triage 2009-12-15 01:14:46 UTC
State Changed
From-To: patched->closed

Patch applied to 8.0-STABLE.  Thanks for your submission!
Comment 6 dfilter service freebsd_committer freebsd_triage 2009-12-15 01:14:52 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"