aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorTrond Myklebust <Trond.Myklebust@netapp.com>2012-06-20 09:58:35 -0400
committerTrond Myklebust <Trond.Myklebust@netapp.com>2012-06-28 17:20:41 -0400
commitbfeea1dc1c9238f9e5a17a265489ecd0d19f66bb (patch)
tree009163b2f4c0255599d3c781a833c2dcfaa621ed /include/linux
parent1537693ceaa8d6484f1ce631bec85658bfa9816c (diff)
SUNRPC: Don't decode beyond the end of the RPC reply message
Now that xdr_inline_decode() will automatically cross into the page buffers, we need to ensure that it doesn't exceed the total reply message length. This patch sets up a counter that tracks the number of words remaining in the reply message, and ensures that xdr_inline_decode, xdr_read_pages and xdr_enter_page respect the end of message boundary. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/sunrpc/xdr.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/include/linux/sunrpc/xdr.h b/include/linux/sunrpc/xdr.h
index af70af333546..f1e7f884d1c3 100644
--- a/include/linux/sunrpc/xdr.h
+++ b/include/linux/sunrpc/xdr.h
@@ -205,6 +205,7 @@ struct xdr_stream {
205 struct kvec *iov; /* pointer to the current kvec */ 205 struct kvec *iov; /* pointer to the current kvec */
206 struct kvec scratch; /* Scratch buffer */ 206 struct kvec scratch; /* Scratch buffer */
207 struct page **page_ptr; /* pointer to the current page */ 207 struct page **page_ptr; /* pointer to the current page */
208 unsigned int nwords; /* Remaining decode buffer length */
208}; 209};
209 210
210/* 211/*