summaryrefslogtreecommitdiffstats
path: root/net/sunrpc/auth_gss/gss_rpc_xdr.h
diff options
context:
space:
mode:
authorJ. Bruce Fields <bfields@redhat.com>2013-08-20 18:13:27 -0400
committerJ. Bruce Fields <bfields@redhat.com>2013-09-06 11:45:58 -0400
commit9dfd87da1aeb0fd364167ad199f40fe96a6a87be (patch)
treeadf9d2edff56be3fa54e330b55b3c76fe51c25cf /net/sunrpc/auth_gss/gss_rpc_xdr.h
parent6a36978e6931e6601be586eb313375335f2cfaa3 (diff)
downloadlinux-stable-9dfd87da1aeb0fd364167ad199f40fe96a6a87be.tar.gz
linux-stable-9dfd87da1aeb0fd364167ad199f40fe96a6a87be.tar.bz2
linux-stable-9dfd87da1aeb0fd364167ad199f40fe96a6a87be.zip
rpc: fix huge kmalloc's in gss-proxy
The reply to a gssproxy can include up to NGROUPS_MAX gid's, which will take up more than a page. We therefore need to allocate an array of pages to hold the reply instead of trying to allocate a single huge buffer. Tested-by: Simo Sorce <simo@redhat.com> Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Diffstat (limited to 'net/sunrpc/auth_gss/gss_rpc_xdr.h')
-rw-r--r--net/sunrpc/auth_gss/gss_rpc_xdr.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/net/sunrpc/auth_gss/gss_rpc_xdr.h b/net/sunrpc/auth_gss/gss_rpc_xdr.h
index 1c98b27d870c..685a688f3d8a 100644
--- a/net/sunrpc/auth_gss/gss_rpc_xdr.h
+++ b/net/sunrpc/auth_gss/gss_rpc_xdr.h
@@ -147,6 +147,8 @@ struct gssx_arg_accept_sec_context {
struct gssx_cb *input_cb;
u32 ret_deleg_cred;
struct gssx_option_array options;
+ struct page **pages;
+ unsigned int npages;
};
struct gssx_res_accept_sec_context {
@@ -240,7 +242,8 @@ int gssx_dec_accept_sec_context(struct rpc_rqst *rqstp,
2 * GSSX_max_princ_sz + \
8 + 8 + 4 + 4 + 4)
#define GSSX_max_output_token_sz 1024
-#define GSSX_max_creds_sz (4 + 4 + 4 + NGROUPS_MAX * 4)
+/* grouplist not included; we allocate separate pages for that: */
+#define GSSX_max_creds_sz (4 + 4 + 4 /* + NGROUPS_MAX*4 */)
#define GSSX_RES_accept_sec_context_sz (GSSX_default_status_sz + \
GSSX_default_ctx_sz + \
GSSX_max_output_token_sz + \