aboutsummaryrefslogtreecommitdiffstats
path: root/net/sunrpc/auth_gss/gss_krb5_keys.c
diff options
context:
space:
mode:
authorTrond Myklebust <Trond.Myklebust@netapp.com>2010-05-13 12:51:02 -0400
committerTrond Myklebust <Trond.Myklebust@netapp.com>2010-05-14 15:09:33 -0400
commit1f4c86c0be9064ab4eebd9e67c84606c1cfeec4b (patch)
tree6ae9e8e6550f644335bbf6812edd7e6cfcde7e53 /net/sunrpc/auth_gss/gss_krb5_keys.c
parent8535b2be5181fc3019e4150567ef53210fe3b04f (diff)
NFS: Don't use GFP_KERNEL in rpcsec_gss downcalls
Again, we can deadlock if the memory reclaim triggers a writeback that requires a rpcsec_gss credential lookup. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'net/sunrpc/auth_gss/gss_krb5_keys.c')
-rw-r--r--net/sunrpc/auth_gss/gss_krb5_keys.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/net/sunrpc/auth_gss/gss_krb5_keys.c b/net/sunrpc/auth_gss/gss_krb5_keys.c
index 33b87f04b30b..76e42e6be755 100644
--- a/net/sunrpc/auth_gss/gss_krb5_keys.c
+++ b/net/sunrpc/auth_gss/gss_krb5_keys.c
@@ -150,7 +150,8 @@ static void krb5_nfold(u32 inbits, const u8 *in,
150u32 krb5_derive_key(const struct gss_krb5_enctype *gk5e, 150u32 krb5_derive_key(const struct gss_krb5_enctype *gk5e,
151 const struct xdr_netobj *inkey, 151 const struct xdr_netobj *inkey,
152 struct xdr_netobj *outkey, 152 struct xdr_netobj *outkey,
153 const struct xdr_netobj *in_constant) 153 const struct xdr_netobj *in_constant,
154 gfp_t gfp_mask)
154{ 155{
155 size_t blocksize, keybytes, keylength, n; 156 size_t blocksize, keybytes, keylength, n;
156 unsigned char *inblockdata, *outblockdata, *rawkey; 157 unsigned char *inblockdata, *outblockdata, *rawkey;
@@ -175,15 +176,15 @@ u32 krb5_derive_key(const struct gss_krb5_enctype *gk5e,
175 /* allocate and set up buffers */ 176 /* allocate and set up buffers */
176 177
177 ret = ENOMEM; 178 ret = ENOMEM;
178 inblockdata = kmalloc(blocksize, GFP_KERNEL); 179 inblockdata = kmalloc(blocksize, gfp_mask);
179 if (inblockdata == NULL) 180 if (inblockdata == NULL)
180 goto err_free_cipher; 181 goto err_free_cipher;
181 182
182 outblockdata = kmalloc(blocksize, GFP_KERNEL); 183 outblockdata = kmalloc(blocksize, gfp_mask);
183 if (outblockdata == NULL) 184 if (outblockdata == NULL)
184 goto err_free_in; 185 goto err_free_in;
185 186
186 rawkey = kmalloc(keybytes, GFP_KERNEL); 187 rawkey = kmalloc(keybytes, gfp_mask);
187 if (rawkey == NULL) 188 if (rawkey == NULL)
188 goto err_free_out; 189 goto err_free_out;
189 190