]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
nfsd4: bug in read_buf
authorNeil Brown <neilb@suse.de>
Tue, 20 Apr 2010 02:16:52 +0000 (12:16 +1000)
committerGreg Kroah-Hartman <gregkh@suse.de>
Wed, 12 May 2010 21:57:01 +0000 (14:57 -0700)
commit9e27d5e6748f40b7c9835f3ef9b7ce64bed15e74
tree940a4ff6d9eecc26327b45b1bfb4aa7b1a6e4488
parentebab7082c82621967a08e6a2e79219fc3a5e5dd5
nfsd4: bug in read_buf

commit 2bc3c1179c781b359d4f2f3439cb3df72afc17fc upstream.

When read_buf is called to move over to the next page in the pagelist
of an NFSv4 request, it sets argp->end to essentially a random
number, certainly not an address within the page which argp->p now
points to.  So subsequent calls to READ_BUF will think there is much
more than a page of spare space (the cast to u32 ensures an unsigned
comparison) so we can expect to fall off the end of the second
page.

We never encountered thsi in testing because typically the only
operations which use more than two pages are write-like operations,
which have their own decoding logic.  Something like a getattr after a
write may cross a page boundary, but it would be very unusual for it to
cross another boundary after that.

Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
fs/nfsd/nfs4xdr.c