From: Jeff Layton <jlayton@redhat.com>
To: nfsv4@linux-nfs.org, nfs@lists.sourceforge.net
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH] NFSv4: handle lack of clientaddr in option string gracefully
Date: Wed, 18 Jul 2007 11:28:43 -0400 [thread overview]
Message-ID: <20070718112843.08644184.jlayton@redhat.com> (raw)
If a NFSv4 mount is attempted with string based options, and the
option string doesn't contain a clientaddr= option, the kernel will
currently oops. Check for this situation and return a proper error.
Signed-off-by: Jeff Layton <jlayton@redhat.com>
diff --git a/fs/nfs/super.c b/fs/nfs/super.c
index a2b1af8..ff06b95 100644
--- a/fs/nfs/super.c
+++ b/fs/nfs/super.c
@@ -1683,6 +1683,9 @@ static int nfs4_validate_mount_data(struct nfs4_mount_data **options,
dprintk("MNTPATH: %s\n", *mntpath);
+ if (args.client_address == NULL)
+ goto out_no_client_address;
+
*ip_addr = args.client_address;
break;
@@ -1703,6 +1706,10 @@ out_inval_auth:
out_no_address:
dfprintk(MOUNT, "NFS4: mount program didn't pass remote address\n");
return -EINVAL;
+
+out_no_client_address:
+ dfprintk(MOUNT, "NFS4: mount program didn't pass callback address\n");
+ return -EINVAL;
}
/*
reply other threads:[~2007-07-18 15:28 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20070718112843.08644184.jlayton@redhat.com \
--to=jlayton@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=nfs@lists.sourceforge.net \
--cc=nfsv4@linux-nfs.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®