From owner-freebsd-current@FreeBSD.ORG Wed Aug 25 00:05:06 2004 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 3F49116A4CE for ; Wed, 25 Aug 2004 00:05:06 +0000 (GMT) Received: from fledge.watson.org (fledge.watson.org [204.156.12.50]) by mx1.FreeBSD.org (Postfix) with ESMTP id DA37D43D39 for ; Wed, 25 Aug 2004 00:05:05 +0000 (GMT) (envelope-from robert@fledge.watson.org) Received: from fledge.watson.org (localhost [127.0.0.1]) by fledge.watson.org (8.12.11/8.12.11) with ESMTP id i7P02pvX015205; Tue, 24 Aug 2004 20:02:51 -0400 (EDT) (envelope-from robert@fledge.watson.org) Received: from localhost (robert@localhost)i7P02oU6015201; Tue, 24 Aug 2004 20:02:51 -0400 (EDT) (envelope-from robert@fledge.watson.org) Date: Tue, 24 Aug 2004 20:02:50 -0400 (EDT) From: Robert Watson X-Sender: robert@fledge.watson.org To: Jun Kuriyama In-Reply-To: <7misb86tk0.wl@black.imgsrc.co.jp> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: Current Subject: Re: suser: thread 0xc06aec80 (0 swapper) != curthread 0xc1ee9420 X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Aug 2004 00:05:06 -0000 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@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;