aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfsd/export.c
diff options
context:
space:
mode:
authorKinglong Mee <kinglongmee@gmail.com>2014-05-23 23:19:57 -0400
committerJ. Bruce Fields <bfields@redhat.com>2014-05-30 17:32:25 -0400
commitbe69da8052af38a9d72ed32fb765fd4446e4091c (patch)
treeb1b673b6f276a8eefbcaa984bd31cab5e5b2c62b /fs/nfsd/export.c
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>
Diffstat (limited to 'fs/nfsd/export.c')
-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)
389 int len; 389 int len;
390 int migrated, i, err; 390 int migrated, i, err;
391 391
392 /* more than one fsloc */
393 if (fsloc->locations)
394 return -EINVAL;
395
392 /* listsize */ 396 /* listsize */
393 err = get_uint(mesg, &fsloc->locations_count); 397 err = get_uint(mesg, &fsloc->locations_count);
394 if (err) 398 if (err)
@@ -442,6 +446,10 @@ static int secinfo_parse(char **mesg, char *buf, struct svc_export *exp)
442 u32 listsize; 446 u32 listsize;
443 int err; 447 int err;
444 448
449 /* more than one secinfo */
450 if (exp->ex_nflavors)
451 return -EINVAL;
452
445 err = get_uint(mesg, &listsize); 453 err = get_uint(mesg, &listsize);
446 if (err) 454 if (err)
447 return err; 455 return err;
@@ -481,6 +489,10 @@ uuid_parse(char **mesg, char *buf, unsigned char **puuid)
481{ 489{
482 int len; 490 int len;
483 491
492 /* more than one uuid */
493 if (*puuid)
494 return -EINVAL;
495
484 /* expect a 16 byte uuid encoded as \xXXXX... */ 496 /* expect a 16 byte uuid encoded as \xXXXX... */
485 len = qword_get(mesg, buf, PAGE_SIZE); 497 len = qword_get(mesg, buf, PAGE_SIZE);
486 if (len != EX_UUID_LEN) 498 if (len != EX_UUID_LEN)