Commit 521e761c authored by Neil Brown's avatar Neil Brown Committed by Linus Torvalds

[PATCH] Fix unsigned underflow in xdr decoding.

With 'len' being unsigned now, we must make sure it never tries
to go negative...

Thanks: griffon26@kfk4ever.com (Maurice van der Pot)
Signed-off-by: default avatarNeil Brown <neilb@cse.unsw.edu.au>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 72414cc1
......@@ -347,8 +347,8 @@ nfs3svc_decode_readargs(struct svc_rqst *rqstp, u32 *p,
svc_take_page(rqstp);
args->vec[v].iov_base = page_address(rqstp->rq_respages[pn]);
args->vec[v].iov_len = len < PAGE_SIZE? len : PAGE_SIZE;
len -= args->vec[v].iov_len;
v++;
len -= PAGE_SIZE;
}
args->vlen = v;
return xdr_argsize_check(rqstp, p);
......
......@@ -255,8 +255,8 @@ nfssvc_decode_readargs(struct svc_rqst *rqstp, u32 *p,
svc_take_page(rqstp);
args->vec[v].iov_base = page_address(rqstp->rq_respages[pn]);
args->vec[v].iov_len = len < PAGE_SIZE?len:PAGE_SIZE;
len -= args->vec[v].iov_len;
v++;
len -= PAGE_SIZE;
}
args->vlen = v;
return xdr_argsize_check(rqstp, p);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment