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

From: Robert Watson <rwatson_at_FreeBSD.org>
Date: Tue, 24 Aug 2004 20:02:50 -0400 (EDT)
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
_at__at_ -1139,11 +1139,9 _at__at_
 	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;
_at__at_ -1206,10 +1204,10 _at__at_
 		   (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;
Received on Tue Aug 24 2004 - 22:05:06 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:38:08 UTC