diff mbox

[Version,5,01/17] SUNRPC handle unsupported RPCSEC_GSS security service

Message ID 20170224221953.5502-2-andros@netapp.com (mailing list archive)
State New, archived
Headers show

Commit Message

Andy Adamson Feb. 24, 2017, 10:19 p.m. UTC
From: Andy Adamson <andros@netapp.com>

Signed-off-by: Andy Adamson <andros@netapp.com>
---
 net/sunrpc/auth_gss/auth_gss.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

Comments

J. Bruce Fields March 9, 2017, 9:54 p.m. UTC | #1
I don't think these cases are possible; ->gc_service is set from a
gss_auth->service, which is set to the return value from
gss_pseudoflavor_to_service, which shouldn't return arbitrary values.

Well, maybe there's no great harm in checking anyway, but I probably
wouldn't.

--b.

On Fri, Feb 24, 2017 at 05:19:37PM -0500, andros@netapp.com wrote:
> From: Andy Adamson <andros@netapp.com>
> 
> Signed-off-by: Andy Adamson <andros@netapp.com>
> ---
>  net/sunrpc/auth_gss/auth_gss.c | 10 ++++++++++
>  1 file changed, 10 insertions(+)
> 
> diff --git a/net/sunrpc/auth_gss/auth_gss.c b/net/sunrpc/auth_gss/auth_gss.c
> index cdeb1d8..d8395ce 100644
> --- a/net/sunrpc/auth_gss/auth_gss.c
> +++ b/net/sunrpc/auth_gss/auth_gss.c
> @@ -1869,6 +1869,11 @@ gss_wrap_req(struct rpc_task *task,
>  	case RPC_GSS_SVC_PRIVACY:
>  		status = gss_wrap_req_priv(cred, ctx, encode, rqstp, p, obj);
>  		break;
> +	default:
> +		status = -EIO;
> +		pr_warn("RPC    Unsupported service level %d\n",
> +			gss_cred->gc_service);
> +		break;
>  	}
>  out:
>  	gss_put_ctx(ctx);
> @@ -1979,6 +1984,11 @@ gss_unwrap_resp(struct rpc_task *task,
>  		if (status)
>  			goto out;
>  		break;
> +	default:
> +		status = -EIO;
> +		pr_warn("RPC    Unsupported service level %d\n",
> +			gss_cred->gc_service);
> +		goto out;
>  	}
>  	/* take into account extra slack for integrity and privacy cases: */
>  	cred->cr_auth->au_rslack = cred->cr_auth->au_verfsize + (p - savedp)
> -- 
> 2.9.3
--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/net/sunrpc/auth_gss/auth_gss.c b/net/sunrpc/auth_gss/auth_gss.c
index cdeb1d8..d8395ce 100644
--- a/net/sunrpc/auth_gss/auth_gss.c
+++ b/net/sunrpc/auth_gss/auth_gss.c
@@ -1869,6 +1869,11 @@  gss_wrap_req(struct rpc_task *task,
 	case RPC_GSS_SVC_PRIVACY:
 		status = gss_wrap_req_priv(cred, ctx, encode, rqstp, p, obj);
 		break;
+	default:
+		status = -EIO;
+		pr_warn("RPC    Unsupported service level %d\n",
+			gss_cred->gc_service);
+		break;
 	}
 out:
 	gss_put_ctx(ctx);
@@ -1979,6 +1984,11 @@  gss_unwrap_resp(struct rpc_task *task,
 		if (status)
 			goto out;
 		break;
+	default:
+		status = -EIO;
+		pr_warn("RPC    Unsupported service level %d\n",
+			gss_cred->gc_service);
+		goto out;
 	}
 	/* take into account extra slack for integrity and privacy cases: */
 	cred->cr_auth->au_rslack = cred->cr_auth->au_verfsize + (p - savedp)