]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
nfsd: Limit end of page list when decoding NFSv4 WRITE
authorChuck Lever <chuck.lever@oracle.com>
Fri, 18 Aug 2017 15:12:19 +0000 (11:12 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 30 Aug 2017 08:16:56 +0000 (10:16 +0200)
commita2a7cf08c9ce65e997b5714bd078cd0de3efe8ee
tree2f36776d7e56d453ae3e5f5083f66c73abc28586
parent5ff5bac0eb20305cd5d8d8639a9b410ed9ca70f3
nfsd: Limit end of page list when decoding NFSv4 WRITE

commit fc788f64f1f3eb31e87d4f53bcf1ab76590d5838 upstream.

When processing an NFSv4 WRITE operation, argp->end should never
point past the end of the data in the final page of the page list.
Otherwise, nfsd4_decode_compound can walk into uninitialized memory.

More critical, nfsd4_decode_write is failing to increment argp->pagelen
when it increments argp->pagelist.  This can cause later xdr decoders
to assume more data is available than really is, which can cause server
crashes on malformed requests.

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/nfsd/nfs4xdr.c