suser: thread 0xc06aec80 (0 swapper) != curthread 0xc1ee9420

Robert Watson rwatson at FreeBSD.org
Tue Aug 24 17:05:06 PDT 2004


On Wed, 25 Aug 2004, Jun Kuriyama wrote:

> suser: thread 0xc06aec80 (0 swapper) != curthread 0xc1ee9420 (60 swi5:
> clock sio) 

Hmm.  The attached patch replaces one bogus use of a credential with
another, but one that won't trigger an assertion.  Really, a lot of these
socket APIs should be passing credentials rather than threads.

Robert N M Watson             FreeBSD Core Team, TrustedBSD Projects
robert at fledge.watson.org      Principal Research Scientist, McAfee Research

Index: nfs_socket.c
===================================================================
RCS file: /home/ncvs/src/sys/nfsclient/nfs_socket.c,v
retrieving revision 1.114
diff -u -r1.114 nfs_socket.c
--- nfs_socket.c	13 Jul 2004 05:42:59 -0000	1.114
+++ nfs_socket.c	25 Aug 2004 00:02:25 -0000
@@ -1139,11 +1139,9 @@
 	struct nfsmount *nmp;
 	int timeo;
 	int s, error;
-	struct thread *td;
 	struct timeval now;
 
 	getmicrouptime(&now);
-	td = &thread0; /* XXX for credentials, may break if sleep */
 	s = splnet();
 	TAILQ_FOREACH(rep, &nfs_reqq, r_chain) {
 		nmp = rep->r_nmp;
@@ -1206,10 +1204,10 @@
 		   (m = m_copym(rep->r_mreq, 0, M_COPYALL, M_DONTWAIT))){
 			if ((nmp->nm_flag & NFSMNT_NOCONN) == 0)
 			    error = (*so->so_proto->pr_usrreqs->pru_send)
-				    (so, 0, m, NULL, NULL, td);
+				    (so, 0, m, NULL, NULL, curthread);
 			else
 			    error = (*so->so_proto->pr_usrreqs->pru_send)
-				    (so, 0, m, nmp->nm_nam, NULL, td);
+				    (so, 0, m, nmp->nm_nam, NULL, curthread);
 			if (error) {
 				if (NFSIGNORE_SOERROR(nmp->nm_soflags, error))
 					so->so_error = 0;



More information about the freebsd-current mailing list