mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-12-01 08:04:22 +08:00
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>
This commit is contained in:
parent
1f53146da9
commit
be69da8052
@ -389,6 +389,10 @@ fsloc_parse(char **mesg, char *buf, struct nfsd4_fs_locations *fsloc)
|
|||||||
int len;
|
int len;
|
||||||
int migrated, i, err;
|
int migrated, i, err;
|
||||||
|
|
||||||
|
/* more than one fsloc */
|
||||||
|
if (fsloc->locations)
|
||||||
|
return -EINVAL;
|
||||||
|
|
||||||
/* listsize */
|
/* listsize */
|
||||||
err = get_uint(mesg, &fsloc->locations_count);
|
err = get_uint(mesg, &fsloc->locations_count);
|
||||||
if (err)
|
if (err)
|
||||||
@ -442,6 +446,10 @@ static int secinfo_parse(char **mesg, char *buf, struct svc_export *exp)
|
|||||||
u32 listsize;
|
u32 listsize;
|
||||||
int err;
|
int err;
|
||||||
|
|
||||||
|
/* more than one secinfo */
|
||||||
|
if (exp->ex_nflavors)
|
||||||
|
return -EINVAL;
|
||||||
|
|
||||||
err = get_uint(mesg, &listsize);
|
err = get_uint(mesg, &listsize);
|
||||||
if (err)
|
if (err)
|
||||||
return err;
|
return err;
|
||||||
@ -481,6 +489,10 @@ uuid_parse(char **mesg, char *buf, unsigned char **puuid)
|
|||||||
{
|
{
|
||||||
int len;
|
int len;
|
||||||
|
|
||||||
|
/* more than one uuid */
|
||||||
|
if (*puuid)
|
||||||
|
return -EINVAL;
|
||||||
|
|
||||||
/* expect a 16 byte uuid encoded as \xXXXX... */
|
/* expect a 16 byte uuid encoded as \xXXXX... */
|
||||||
len = qword_get(mesg, buf, PAGE_SIZE);
|
len = qword_get(mesg, buf, PAGE_SIZE);
|
||||||
if (len != EX_UUID_LEN)
|
if (len != EX_UUID_LEN)
|
||||||
|
Loading…
Reference in New Issue
Block a user