aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKinglong Mee2014-05-24 11:19:57 +0800
committerJ. Bruce Fields2014-05-30 17:32:25 -0400
commitbe69da8052af38a9d72ed32fb765fd4446e4091c (patch)
treeb1b673b6f276a8eefbcaa984bd31cab5e5b2c62b
parent1f53146da9cb2c941a3928320a6824d3b035455f (diff)
NFSD: Error out when getting more than one fsloc/secinfo/uuid
Signed-off-by: Kinglong Mee <kinglongmee@gmail.com> Signed-off-by: J. Bruce Fields <bfields@redhat.com>
-rw-r--r--fs/nfsd/export.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/fs/nfsd/export.c b/fs/nfsd/export.c
index 788405107006..13b85f94d9e2 100644
--- a/fs/nfsd/export.c
+++ b/fs/nfsd/export.c
@@ -389,6 +389,10 @@ fsloc_parse(char **mesg, char *buf, struct nfsd4_fs_locations *fsloc)
int len;
int migrated, i, err;
+ /* more than one fsloc */
+ if (fsloc->locations)
+ return -EINVAL;
+
/* listsize */
err = get_uint(mesg, &fsloc->locations_count);
if (err)
@@ -442,6 +446,10 @@ static int secinfo_parse(char **mesg, char *buf, struct svc_export *exp)
u32 listsize;
int err;
+ /* more than one secinfo */
+ if (exp->ex_nflavors)
+ return -EINVAL;
+
err = get_uint(mesg, &listsize);
if (err)
return err;
@@ -481,6 +489,10 @@ uuid_parse(char **mesg, char *buf, unsigned char **puuid)
{
int len;
+ /* more than one uuid */
+ if (*puuid)
+ return -EINVAL;
+
/* expect a 16 byte uuid encoded as \xXXXX... */
len = qword_get(mesg, buf, PAGE_SIZE);
if (len != EX_UUID_LEN)