aboutsummaryrefslogtreecommitdiff
path: root/sys/nfsclient/nfs_vfsops.c
diff options
context:
space:
mode:
authorRick Macklem <rmacklem@FreeBSD.org>2011-05-18 18:36:40 +0000
committerRick Macklem <rmacklem@FreeBSD.org>2011-05-18 18:36:40 +0000
commitb70cddba44edd768b7ee4c659a6dbdf189c98fb3 (patch)
tree5a357fb45313bbb4f9ed4284c2c98143e7f28c83 /sys/nfsclient/nfs_vfsops.c
parent0bd47e8362e1eee02d034e0479dd79673ec06bcc (diff)
downloadsrc-b70cddba44edd768b7ee4c659a6dbdf189c98fb3.tar.gz
src-b70cddba44edd768b7ee4c659a6dbdf189c98fb3.zip
Add a sanity check for the existence of an "addr" option
to both NFS clients. This avoids the crash reported by Sergey Kandaurov (pluknet@gmail.com) to the freebsd-fs@ list with subject "[old nfsclient] different nmount() args passed from mount vs mount_nfs" dated May 17, 2011. Tested by: pluknet at gmail.com (old nfs client) MFC after: 2 weeks
Notes
Notes: svn path=/head/; revision=222075
Diffstat (limited to 'sys/nfsclient/nfs_vfsops.c')
-rw-r--r--sys/nfsclient/nfs_vfsops.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/sys/nfsclient/nfs_vfsops.c b/sys/nfsclient/nfs_vfsops.c
index 04fd37500669..79659d04ddba 100644
--- a/sys/nfsclient/nfs_vfsops.c
+++ b/sys/nfsclient/nfs_vfsops.c
@@ -1149,6 +1149,10 @@ nfs_mount(struct mount *mp)
goto out;
}
}
+ } else if (has_addr_opt == 0) {
+ vfs_mount_error(mp, "No server address");
+ error = EINVAL;
+ goto out;
}
error = mountnfs(&args, mp, nam, args.hostname, &vp,
curthread->td_ucred, negnametimeo);