Skip to content
Commit 6d1c0f3d authored by Anna Schumaker's avatar Anna Schumaker Committed by Trond Myklebust
Browse files

sunrpc: Avoid a KASAN slab-out-of-bounds bug in xdr_set_page_base()



This seems to happen fairly easily during READ_PLUS testing on NFS v4.2.
I found that we could end up accessing xdr->buf->pages[pgnr] with a pgnr
greater than the number of pages in the array. So let's just return
early if we're setting base to a point at the end of the page data and
let xdr_set_tail_base() handle setting up the buffer pointers instead.

Signed-off-by: default avatarAnna Schumaker <Anna.Schumaker@Netapp.com>
Fixes: 8d86e373 ("SUNRPC: Clean up helpers xdr_set_iov() and xdr_set_page_base()")
Signed-off-by: default avatarTrond Myklebust <trond.myklebust@hammerspace.com>
parent 3731d44b
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment