summaryrefslogtreecommitdiffstats
path: root/sys/netsmb/smb_iod.c
diff options
context:
space:
mode:
authortjr <tjr@FreeBSD.org>2003-06-14 15:45:34 +0000
committertjr <tjr@FreeBSD.org>2003-06-14 15:45:34 +0000
commit5155733cbd5f018fd512ea8a09bc9154ab8f3bbd (patch)
tree79ad7846422b75ac6056ffc394883d7844dfdd7a /sys/netsmb/smb_iod.c
parent6b8ecd0152c48c169be36273563d97ae52bbe5a1 (diff)
downloadFreeBSD-src-5155733cbd5f018fd512ea8a09bc9154ab8f3bbd.zip
FreeBSD-src-5155733cbd5f018fd512ea8a09bc9154ab8f3bbd.tar.gz
Avoid dereferencing the thread pointer in smb_iod_addrq() if it's NULL.
Fixes mdconfig -t vnode on smbfs: mdsetcred()'s "horrible kludge" calls into smbfs VOP_READ with a NULL uio_td.
Diffstat (limited to 'sys/netsmb/smb_iod.c')
-rw-r--r--sys/netsmb/smb_iod.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/netsmb/smb_iod.c b/sys/netsmb/smb_iod.c
index 86536bb..2c5e2c3 100644
--- a/sys/netsmb/smb_iod.c
+++ b/sys/netsmb/smb_iod.c
@@ -401,7 +401,8 @@ smb_iod_addrq(struct smb_rq *rqp)
int error;
SMBIODEBUG("\n");
- if (rqp->sr_cred->scr_td->td_proc == iod->iod_p) {
+ if (rqp->sr_cred->scr_td != NULL &&
+ rqp->sr_cred->scr_td->td_proc == iod->iod_p) {
rqp->sr_flags |= SMBR_INTERNAL;
SMB_IOD_RQLOCK(iod);
TAILQ_INSERT_HEAD(&iod->iod_rqlist, rqp, sr_link);
OpenPOWER on IntegriCloud