summaryrefslogtreecommitdiffstats
path: root/sys/nfs/nfs_subs.c
diff options
context:
space:
mode:
authordillon <dillon@FreeBSD.org>1999-12-12 07:06:39 +0000
committerdillon <dillon@FreeBSD.org>1999-12-12 07:06:39 +0000
commit08e8d78b501bf7a046c5972d20a883d62ec5456b (patch)
treecf098b01da15fcb058627fac2994e8366d544280 /sys/nfs/nfs_subs.c
parent9c9d5f88d9b204e3a4bd9974961b1e1cfff5b952 (diff)
downloadFreeBSD-src-08e8d78b501bf7a046c5972d20a883d62ec5456b.zip
FreeBSD-src-08e8d78b501bf7a046c5972d20a883d62ec5456b.tar.gz
Fix a number of server-side issues related to aborting badly formed
NFS packets, mainly initializing structure pointers to NULL which are conditionally freed prior to return. PR: kern/15249 Submitted by: Ian Dowse <iedowse@maths.tcd.ie>
Diffstat (limited to 'sys/nfs/nfs_subs.c')
-rw-r--r--sys/nfs/nfs_subs.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/sys/nfs/nfs_subs.c b/sys/nfs/nfs_subs.c
index 0da996b..e63ba63 100644
--- a/sys/nfs/nfs_subs.c
+++ b/sys/nfs/nfs_subs.c
@@ -1974,6 +1974,7 @@ nfsrv_fhtovp(fhp, lockflag, vpp, cred, slp, nam, rdonlyp, kerbflag, pubflag)
if (saddr->sin_family == AF_INET &&
ntohs(saddr->sin_port) >= IPPORT_RESERVED) {
vput(*vpp);
+ *vpp = NULL;
return (NFSERR_AUTHERR | AUTH_TOOWEAK);
}
}
@@ -1984,10 +1985,12 @@ nfsrv_fhtovp(fhp, lockflag, vpp, cred, slp, nam, rdonlyp, kerbflag, pubflag)
if (exflags & MNT_EXKERB) {
if (!kerbflag) {
vput(*vpp);
+ *vpp = NULL;
return (NFSERR_AUTHERR | AUTH_TOOWEAK);
}
} else if (kerbflag) {
vput(*vpp);
+ *vpp = NULL;
return (NFSERR_AUTHERR | AUTH_TOOWEAK);
} else if (cred->cr_uid == 0 || (exflags & MNT_EXPORTANON)) {
cred->cr_uid = credanon->cr_uid;
OpenPOWER on IntegriCloud