From 03e42462223cf4553163d8b6ad6cf9637dca9096 Mon Sep 17 00:00:00 2001 From: rmacklem Date: Wed, 18 May 2011 18:36:40 +0000 Subject: 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 --- sys/nfsclient/nfs_vfsops.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'sys/nfsclient') 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); -- cgit v1.1