Skip to content

Commit

Permalink
NFSD: Error out when getting more than one fsloc/secinfo/uuid
Browse files Browse the repository at this point in the history
Signed-off-by: Kinglong Mee <kinglongmee@gmail.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
  • Loading branch information
Kinglong Mee authored and J. Bruce Fields committed May 30, 2014
1 parent 1f53146 commit be69da8
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions fs/nfsd/export.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit be69da8

Please sign in to comment.