NFSD: Error out when getting more than one fsloc/secinfo/uuid
authorKinglong Mee <kinglongmee@gmail.com>
Sat, 24 May 2014 03:19:57 +0000 (11:19 +0800)
committerJ. Bruce Fields <bfields@redhat.com>
Fri, 30 May 2014 21:32:25 +0000 (17:32 -0400)
Signed-off-by: Kinglong Mee <kinglongmee@gmail.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
fs/nfsd/export.c

index 7884051070069a4fd143ef356aa7147791cf304f..13b85f94d9e25e052fed8edf83095950a8b6927e 100644 (file)
@@ -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)
This page took 0.025142 seconds and 5 git commands to generate.