summaryrefslogtreecommitdiffstats
path: root/sys/nfsclient
diff options
context:
space:
mode:
authorrmacklem <rmacklem@FreeBSD.org>2011-05-18 18:36:40 +0000
committerrmacklem <rmacklem@FreeBSD.org>2011-05-18 18:36:40 +0000
commit03e42462223cf4553163d8b6ad6cf9637dca9096 (patch)
tree5a357fb45313bbb4f9ed4284c2c98143e7f28c83 /sys/nfsclient
parenta02652f83d76b8b36af970922caf34ac8f0f2fa9 (diff)
downloadFreeBSD-src-03e42462223cf4553163d8b6ad6cf9637dca9096.zip
FreeBSD-src-03e42462223cf4553163d8b6ad6cf9637dca9096.tar.gz
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
Diffstat (limited to 'sys/nfsclient')
-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 04fd375..79659d0 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);
OpenPOWER on IntegriCloud