aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfsd/nfs4xdr.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/nfsd/nfs4xdr.c')
-rw-r--r--fs/nfsd/nfs4xdr.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/fs/nfsd/nfs4xdr.c b/fs/nfsd/nfs4xdr.c
index 7fdee828f44e..059d4aad39b8 100644
--- a/fs/nfsd/nfs4xdr.c
+++ b/fs/nfsd/nfs4xdr.c
@@ -189,6 +189,11 @@ static __be32 *read_buf(struct nfsd4_compoundargs *argp, u32 nbytes)
189 return p; 189 return p;
190} 190}
191 191
192static int zero_clientid(clientid_t *clid)
193{
194 return (clid->cl_boot == 0) && (clid->cl_id == 0);
195}
196
192static int 197static int
193defer_free(struct nfsd4_compoundargs *argp, 198defer_free(struct nfsd4_compoundargs *argp,
194 void (*release)(const void *), void *p) 199 void (*release)(const void *), void *p)
@@ -584,6 +589,8 @@ nfsd4_decode_lockt(struct nfsd4_compoundargs *argp, struct nfsd4_lockt *lockt)
584 READ_BUF(lockt->lt_owner.len); 589 READ_BUF(lockt->lt_owner.len);
585 READMEM(lockt->lt_owner.data, lockt->lt_owner.len); 590 READMEM(lockt->lt_owner.data, lockt->lt_owner.len);
586 591
592 if (argp->minorversion && !zero_clientid(&lockt->lt_clientid))
593 return nfserr_inval;
587 DECODE_TAIL; 594 DECODE_TAIL;
588} 595}
589 596
@@ -994,6 +1001,8 @@ nfsd4_decode_release_lockowner(struct nfsd4_compoundargs *argp, struct nfsd4_rel
994 READ_BUF(rlockowner->rl_owner.len); 1001 READ_BUF(rlockowner->rl_owner.len);
995 READMEM(rlockowner->rl_owner.data, rlockowner->rl_owner.len); 1002 READMEM(rlockowner->rl_owner.data, rlockowner->rl_owner.len);
996 1003
1004 if (argp->minorversion && !zero_clientid(&rlockowner->rl_clientid))
1005 return nfserr_inval;
997 DECODE_TAIL; 1006 DECODE_TAIL;
998} 1007}
999 1008