summaryrefslogtreecommitdiffstats
path: root/sys/nfsclient
diff options
context:
space:
mode:
authorrwatson <rwatson@FreeBSD.org>2004-08-25 01:23:38 +0000
committerrwatson <rwatson@FreeBSD.org>2004-08-25 01:23:38 +0000
commit68779f8b5efd844caa3e209348d6d3e5ffe2d818 (patch)
treedc4976540ab5738b9d4280dbddc67543478eaa69 /sys/nfsclient
parentce021c0ee9378c53330af503aa7de1610de5ca28 (diff)
downloadFreeBSD-src-68779f8b5efd844caa3e209348d6d3e5ffe2d818.zip
FreeBSD-src-68779f8b5efd844caa3e209348d6d3e5ffe2d818.tar.gz
In nfs_timer(), pass curthread rather than &thread0 into the protocol
send routine. In IPv6 UDP, the thread will be passed to suser(), which asserts that if a thread is used for a super user check, it be curthread. Many of these protocol entry points probably need to accept credentials instead of threads. MT5 candidate. Noticed/tested by: kuriyama
Diffstat (limited to 'sys/nfsclient')
-rw-r--r--sys/nfsclient/nfs_socket.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/sys/nfsclient/nfs_socket.c b/sys/nfsclient/nfs_socket.c
index e24b318..094a2e1 100644
--- a/sys/nfsclient/nfs_socket.c
+++ b/sys/nfsclient/nfs_socket.c
@@ -1139,11 +1139,9 @@ nfs_timer(void *arg)
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 @@ nfs_timer(void *arg)
(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;
OpenPOWER on IntegriCloud