diff options
author | Trond Myklebust <Trond.Myklebust@netapp.com> | 2008-06-10 18:31:01 -0400 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2008-07-09 12:08:48 -0400 |
commit | 0f38b873aeaae698c3693748438547c8493165fb (patch) | |
tree | c858b2a08251c2f5792cf83582697dcd9909b7d8 /net/sunrpc/auth_gss | |
parent | 7e5f6146609eb9134fac7d1b6bfee43df1732188 (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/sunrpc/auth_gss')
-rw-r--r-- | net/sunrpc/auth_gss/auth_gss.c | 10 | ||||
-rw-r--r-- | net/sunrpc/auth_gss/gss_krb5_mech.c | 4 | ||||
-rw-r--r-- | net/sunrpc/auth_gss/gss_spkm3_mech.c | 4 | ||||
-rw-r--r-- | net/sunrpc/auth_gss/gss_spkm3_token.c | 2 |
4 files changed, 10 insertions, 10 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) | |||
90 | int | 90 | int |
91 | decode_asn1_bitstring(struct xdr_netobj *out, char *in, int enclen, int explen) | 91 | decode_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); |