aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorTrond Myklebust <Trond.Myklebust@netapp.com>2008-06-10 18:31:01 -0400
committerTrond Myklebust <Trond.Myklebust@netapp.com>2008-07-09 12:08:48 -0400
commit0f38b873aeaae698c3693748438547c8493165fb (patch)
treec858b2a08251c2f5792cf83582697dcd9909b7d8 /net
parent7e5f6146609eb9134fac7d1b6bfee43df1732188 (diff)
SUNRPC: Use GFP_NOFS when allocating credentials
Since the credentials may be allocated during the call to rpc_new_task(), which again may be called by a memory allocator... Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'net')
-rw-r--r--net/sunrpc/auth_gss/auth_gss.c10
-rw-r--r--net/sunrpc/auth_gss/gss_krb5_mech.c4
-rw-r--r--net/sunrpc/auth_gss/gss_spkm3_mech.c4
-rw-r--r--net/sunrpc/auth_gss/gss_spkm3_token.c2
-rw-r--r--net/sunrpc/auth_unix.c2
5 files changed, 11 insertions, 11 deletions
diff --git a/net/sunrpc/auth_gss/auth_gss.c b/net/sunrpc/auth_gss/auth_gss.c
index cc12d5f5d5da..bf7585b80543 100644
--- a/net/sunrpc/auth_gss/auth_gss.c
+++ b/net/sunrpc/auth_gss/auth_gss.c
@@ -146,7 +146,7 @@ simple_get_netobj(const void *p, const void *end, struct xdr_netobj *dest)
146 q = (const void *)((const char *)p + len); 146 q = (const void *)((const char *)p + len);
147 if (unlikely(q > end || q < p)) 147 if (unlikely(q > end || q < p))
148 return ERR_PTR(-EFAULT); 148 return ERR_PTR(-EFAULT);
149 dest->data = kmemdup(p, len, GFP_KERNEL); 149 dest->data = kmemdup(p, len, GFP_NOFS);
150 if (unlikely(dest->data == NULL)) 150 if (unlikely(dest->data == NULL))
151 return ERR_PTR(-ENOMEM); 151 return ERR_PTR(-ENOMEM);
152 dest->len = len; 152 dest->len = len;
@@ -171,7 +171,7 @@ gss_alloc_context(void)
171{ 171{
172 struct gss_cl_ctx *ctx; 172 struct gss_cl_ctx *ctx;
173 173
174 ctx = kzalloc(sizeof(*ctx), GFP_KERNEL); 174 ctx = kzalloc(sizeof(*ctx), GFP_NOFS);
175 if (ctx != NULL) { 175 if (ctx != NULL) {
176 ctx->gc_proc = RPC_GSS_PROC_DATA; 176 ctx->gc_proc = RPC_GSS_PROC_DATA;
177 ctx->gc_seq = 1; /* NetApp 6.4R1 doesn't accept seq. no. 0 */ 177 ctx->gc_seq = 1; /* NetApp 6.4R1 doesn't accept seq. no. 0 */
@@ -341,7 +341,7 @@ gss_alloc_msg(struct gss_auth *gss_auth, uid_t uid)
341{ 341{
342 struct gss_upcall_msg *gss_msg; 342 struct gss_upcall_msg *gss_msg;
343 343
344 gss_msg = kzalloc(sizeof(*gss_msg), GFP_KERNEL); 344 gss_msg = kzalloc(sizeof(*gss_msg), GFP_NOFS);
345 if (gss_msg != NULL) { 345 if (gss_msg != NULL) {
346 INIT_LIST_HEAD(&gss_msg->list); 346 INIT_LIST_HEAD(&gss_msg->list);
347 rpc_init_wait_queue(&gss_msg->rpc_waitqueue, "RPCSEC_GSS upcall waitq"); 347 rpc_init_wait_queue(&gss_msg->rpc_waitqueue, "RPCSEC_GSS upcall waitq");
@@ -503,7 +503,7 @@ gss_pipe_downcall(struct file *filp, const char __user *src, size_t mlen)
503 if (mlen > MSG_BUF_MAXSIZE) 503 if (mlen > MSG_BUF_MAXSIZE)
504 goto out; 504 goto out;
505 err = -ENOMEM; 505 err = -ENOMEM;
506 buf = kmalloc(mlen, GFP_KERNEL); 506 buf = kmalloc(mlen, GFP_NOFS);
507 if (!buf) 507 if (!buf)
508 goto out; 508 goto out;
509 509
@@ -806,7 +806,7 @@ gss_create_cred(struct rpc_auth *auth, struct auth_cred *acred, int flags)
806 dprintk("RPC: gss_create_cred for uid %d, flavor %d\n", 806 dprintk("RPC: gss_create_cred for uid %d, flavor %d\n",
807 acred->uid, auth->au_flavor); 807 acred->uid, auth->au_flavor);
808 808
809 if (!(cred = kzalloc(sizeof(*cred), GFP_KERNEL))) 809 if (!(cred = kzalloc(sizeof(*cred), GFP_NOFS)))
810 goto out_err; 810 goto out_err;
811 811
812 rpcauth_init_cred(&cred->gc_base, acred, auth, &gss_credops); 812 rpcauth_init_cred(&cred->gc_base, acred, auth, &gss_credops);
diff --git a/net/sunrpc/auth_gss/gss_krb5_mech.c b/net/sunrpc/auth_gss/gss_krb5_mech.c
index 60c3dba545d7..ef45eba22485 100644
--- a/net/sunrpc/auth_gss/gss_krb5_mech.c
+++ b/net/sunrpc/auth_gss/gss_krb5_mech.c
@@ -70,7 +70,7 @@ simple_get_netobj(const void *p, const void *end, struct xdr_netobj *res)
70 q = (const void *)((const char *)p + len); 70 q = (const void *)((const char *)p + len);
71 if (unlikely(q > end || q < p)) 71 if (unlikely(q > end || q < p))
72 return ERR_PTR(-EFAULT); 72 return ERR_PTR(-EFAULT);
73 res->data = kmemdup(p, len, GFP_KERNEL); 73 res->data = kmemdup(p, len, GFP_NOFS);
74 if (unlikely(res->data == NULL)) 74 if (unlikely(res->data == NULL))
75 return ERR_PTR(-ENOMEM); 75 return ERR_PTR(-ENOMEM);
76 res->len = len; 76 res->len = len;
@@ -131,7 +131,7 @@ gss_import_sec_context_kerberos(const void *p,
131 struct krb5_ctx *ctx; 131 struct krb5_ctx *ctx;
132 int tmp; 132 int tmp;
133 133
134 if (!(ctx = kzalloc(sizeof(*ctx), GFP_KERNEL))) 134 if (!(ctx = kzalloc(sizeof(*ctx), GFP_NOFS)))
135 goto out_err; 135 goto out_err;
136 136
137 p = simple_get_bytes(p, end, &ctx->initiate, sizeof(ctx->initiate)); 137 p = simple_get_bytes(p, end, &ctx->initiate, sizeof(ctx->initiate));
diff --git a/net/sunrpc/auth_gss/gss_spkm3_mech.c b/net/sunrpc/auth_gss/gss_spkm3_mech.c
index 5deb4b6e4514..035e1dd6af1b 100644
--- a/net/sunrpc/auth_gss/gss_spkm3_mech.c
+++ b/net/sunrpc/auth_gss/gss_spkm3_mech.c
@@ -76,7 +76,7 @@ simple_get_netobj(const void *p, const void *end, struct xdr_netobj *res)
76 q = (const void *)((const char *)p + len); 76 q = (const void *)((const char *)p + len);
77 if (unlikely(q > end || q < p)) 77 if (unlikely(q > end || q < p))
78 return ERR_PTR(-EFAULT); 78 return ERR_PTR(-EFAULT);
79 res->data = kmemdup(p, len, GFP_KERNEL); 79 res->data = kmemdup(p, len, GFP_NOFS);
80 if (unlikely(res->data == NULL)) 80 if (unlikely(res->data == NULL))
81 return ERR_PTR(-ENOMEM); 81 return ERR_PTR(-ENOMEM);
82 return q; 82 return q;
@@ -90,7 +90,7 @@ gss_import_sec_context_spkm3(const void *p, size_t len,
90 struct spkm3_ctx *ctx; 90 struct spkm3_ctx *ctx;
91 int version; 91 int version;
92 92
93 if (!(ctx = kzalloc(sizeof(*ctx), GFP_KERNEL))) 93 if (!(ctx = kzalloc(sizeof(*ctx), GFP_NOFS)))
94 goto out_err; 94 goto out_err;
95 95
96 p = simple_get_bytes(p, end, &version, sizeof(version)); 96 p = simple_get_bytes(p, end, &version, sizeof(version));
diff --git a/net/sunrpc/auth_gss/gss_spkm3_token.c b/net/sunrpc/auth_gss/gss_spkm3_token.c
index 6cdd241ad267..3308157436d2 100644
--- a/net/sunrpc/auth_gss/gss_spkm3_token.c
+++ b/net/sunrpc/auth_gss/gss_spkm3_token.c
@@ -90,7 +90,7 @@ asn1_bitstring_len(struct xdr_netobj *in, int *enclen, int *zerobits)
90int 90int
91decode_asn1_bitstring(struct xdr_netobj *out, char *in, int enclen, int explen) 91decode_asn1_bitstring(struct xdr_netobj *out, char *in, int enclen, int explen)
92{ 92{
93 if (!(out->data = kzalloc(explen,GFP_KERNEL))) 93 if (!(out->data = kzalloc(explen,GFP_NOFS)))
94 return 0; 94 return 0;
95 out->len = explen; 95 out->len = explen;
96 memcpy(out->data, in, enclen); 96 memcpy(out->data, in, enclen);
diff --git a/net/sunrpc/auth_unix.c b/net/sunrpc/auth_unix.c
index 44920b90bdc4..46b2647c5bd2 100644
--- a/net/sunrpc/auth_unix.c
+++ b/net/sunrpc/auth_unix.c
@@ -66,7 +66,7 @@ unx_create_cred(struct rpc_auth *auth, struct auth_cred *acred, int flags)
66 dprintk("RPC: allocating UNIX cred for uid %d gid %d\n", 66 dprintk("RPC: allocating UNIX cred for uid %d gid %d\n",
67 acred->uid, acred->gid); 67 acred->uid, acred->gid);
68 68
69 if (!(cred = kmalloc(sizeof(*cred), GFP_KERNEL))) 69 if (!(cred = kmalloc(sizeof(*cred), GFP_NOFS)))
70 return ERR_PTR(-ENOMEM); 70 return ERR_PTR(-ENOMEM);
71 71
72 rpcauth_init_cred(&cred->uc_base, acred, auth, &unix_credops); 72 rpcauth_init_cred(&cred->uc_base, acred, auth, &unix_credops);