diff options
Diffstat (limited to 'net/sunrpc')
-rw-r--r-- | net/sunrpc/auth_gss/auth_gss.c | 17 | ||||
-rw-r--r-- | net/sunrpc/auth_gss/gss_krb5_mech.c | 4 | ||||
-rw-r--r-- | net/sunrpc/auth_gss/gss_mech_switch.c | 2 |
3 files changed, 20 insertions, 3 deletions
diff --git a/net/sunrpc/auth_gss/auth_gss.c b/net/sunrpc/auth_gss/auth_gss.c index 3c3c50f38a1c..f7a7f8380e38 100644 --- a/net/sunrpc/auth_gss/auth_gss.c +++ b/net/sunrpc/auth_gss/auth_gss.c | |||
@@ -644,7 +644,22 @@ gss_pipe_downcall(struct file *filp, const char __user *src, size_t mlen) | |||
644 | p = gss_fill_context(p, end, ctx, gss_msg->auth->mech); | 644 | p = gss_fill_context(p, end, ctx, gss_msg->auth->mech); |
645 | if (IS_ERR(p)) { | 645 | if (IS_ERR(p)) { |
646 | err = PTR_ERR(p); | 646 | err = PTR_ERR(p); |
647 | gss_msg->msg.errno = (err == -EAGAIN) ? -EAGAIN : -EACCES; | 647 | switch (err) { |
648 | case -EACCES: | ||
649 | gss_msg->msg.errno = err; | ||
650 | err = mlen; | ||
651 | break; | ||
652 | case -EFAULT: | ||
653 | case -ENOMEM: | ||
654 | case -EINVAL: | ||
655 | case -ENOSYS: | ||
656 | gss_msg->msg.errno = -EAGAIN; | ||
657 | break; | ||
658 | default: | ||
659 | printk(KERN_CRIT "%s: bad return from " | ||
660 | "gss_fill_context: %zd\n", __func__, err); | ||
661 | BUG(); | ||
662 | } | ||
648 | goto err_release_msg; | 663 | goto err_release_msg; |
649 | } | 664 | } |
650 | gss_msg->ctx = gss_get_ctx(ctx); | 665 | gss_msg->ctx = gss_get_ctx(ctx); |
diff --git a/net/sunrpc/auth_gss/gss_krb5_mech.c b/net/sunrpc/auth_gss/gss_krb5_mech.c index ef45eba22485..2deb0ed72ff4 100644 --- a/net/sunrpc/auth_gss/gss_krb5_mech.c +++ b/net/sunrpc/auth_gss/gss_krb5_mech.c | |||
@@ -131,8 +131,10 @@ 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_NOFS))) | 134 | if (!(ctx = kzalloc(sizeof(*ctx), GFP_NOFS))) { |
135 | p = ERR_PTR(-ENOMEM); | ||
135 | goto out_err; | 136 | goto out_err; |
137 | } | ||
136 | 138 | ||
137 | p = simple_get_bytes(p, end, &ctx->initiate, sizeof(ctx->initiate)); | 139 | p = simple_get_bytes(p, end, &ctx->initiate, sizeof(ctx->initiate)); |
138 | if (IS_ERR(p)) | 140 | if (IS_ERR(p)) |
diff --git a/net/sunrpc/auth_gss/gss_mech_switch.c b/net/sunrpc/auth_gss/gss_mech_switch.c index 6efbb0cd3c7c..76e4c6f4ac3c 100644 --- a/net/sunrpc/auth_gss/gss_mech_switch.c +++ b/net/sunrpc/auth_gss/gss_mech_switch.c | |||
@@ -252,7 +252,7 @@ gss_import_sec_context(const void *input_token, size_t bufsize, | |||
252 | struct gss_ctx **ctx_id) | 252 | struct gss_ctx **ctx_id) |
253 | { | 253 | { |
254 | if (!(*ctx_id = kzalloc(sizeof(**ctx_id), GFP_KERNEL))) | 254 | if (!(*ctx_id = kzalloc(sizeof(**ctx_id), GFP_KERNEL))) |
255 | return GSS_S_FAILURE; | 255 | return -ENOMEM; |
256 | (*ctx_id)->mech_type = gss_mech_get(mech); | 256 | (*ctx_id)->mech_type = gss_mech_get(mech); |
257 | 257 | ||
258 | return mech->gm_ops | 258 | return mech->gm_ops |