diff mbox

[1/2] SUNRPC: gss_alloc_msg - choose _either_ a v0 message or a v1 message

Message ID 1383001027-62282-1-git-send-email-Trond.Myklebust@netapp.com (mailing list archive)
State New, archived
Headers show

Commit Message

Trond Myklebust Oct. 28, 2013, 10:57 p.m. UTC
Add the missing 'break' to ensure that we don't corrupt a legacy 'v0' type
message by appending the 'v1'.

Cc: Bruce Fields <bfields@fieldses.org>
Cc: stable@vger.kernel.org
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
---
 net/sunrpc/auth_gss/auth_gss.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Trond Myklebust Oct. 28, 2013, 10:59 p.m. UTC | #1
> -----Original Message-----
> From: Myklebust, Trond
> Sent: Monday, October 28, 2013 6:57 PM
> To: linux-nfs@vger.kernel.org; Bruce Fields
> Cc: stable@vger.kernel.org
> Subject: [PATCH 1/2] SUNRPC: gss_alloc_msg - choose _either_ a v0 message
> or a v1 message
> 
> Add the missing 'break' to ensure that we don't corrupt a legacy 'v0' type
> message by appending the 'v1'.
> 
> Cc: Bruce Fields <bfields@fieldses.org>
> Cc: stable@vger.kernel.org
> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
> ---

I did not intend to send this to stable@vger.kernel .org before it has hit upstream...

Apologies,
   Trond
--
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
J. Bruce Fields Oct. 29, 2013, 12:48 a.m. UTC | #2
On Mon, Oct 28, 2013 at 06:57:06PM -0400, Trond Myklebust wrote:
> Add the missing 'break' to ensure that we don't corrupt a legacy 'v0' type
> message by appending the 'v1'.

ACK.  Looks like that was a regression from
bd4a3eb15bb42296e61d0fd16f2c7f8cc171b681 "RPCSEC_GSS: Clean up upcall
message allocation" ?

And it looks like it's overwriting, not appending, so the 'v0' case has
probably been broken since then.

--b.

> 
> Cc: Bruce Fields <bfields@fieldses.org>
> Cc: stable@vger.kernel.org
> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
> ---
>  net/sunrpc/auth_gss/auth_gss.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/net/sunrpc/auth_gss/auth_gss.c b/net/sunrpc/auth_gss/auth_gss.c
> index 084656671d6e..cc24323d3045 100644
> --- a/net/sunrpc/auth_gss/auth_gss.c
> +++ b/net/sunrpc/auth_gss/auth_gss.c
> @@ -482,6 +482,7 @@ gss_alloc_msg(struct gss_auth *gss_auth,
>  	switch (vers) {
>  	case 0:
>  		gss_encode_v0_msg(gss_msg);
> +		break;
>  	default:
>  		gss_encode_v1_msg(gss_msg, service_name, gss_auth->target_name);
>  	};
> -- 
> 1.8.3.1
> 
--
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
Greg KH Oct. 29, 2013, 3:12 p.m. UTC | #3
On Mon, Oct 28, 2013 at 10:59:45PM +0000, Myklebust, Trond wrote:
> > -----Original Message-----
> > From: Myklebust, Trond
> > Sent: Monday, October 28, 2013 6:57 PM
> > To: linux-nfs@vger.kernel.org; Bruce Fields
> > Cc: stable@vger.kernel.org
> > Subject: [PATCH 1/2] SUNRPC: gss_alloc_msg - choose _either_ a v0 message
> > or a v1 message
> > 
> > Add the missing 'break' to ensure that we don't corrupt a legacy 'v0' type
> > message by appending the 'v1'.
> > 
> > Cc: Bruce Fields <bfields@fieldses.org>
> > Cc: stable@vger.kernel.org
> > Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
> > ---
> 
> I did not intend to send this to stable@vger.kernel .org before it has hit upstream...

Don't worry, as you were just cc: stable@ with your normal patch
submission process, I can tell that this isn't to be applied now, it's
part of the development process.  So don't feel bad at all, lots of
other subsystems do it, and it doesn't bother me at all, no need to
filter it away.

greg k-h
--
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 084656671d6e..cc24323d3045 100644
--- a/net/sunrpc/auth_gss/auth_gss.c
+++ b/net/sunrpc/auth_gss/auth_gss.c
@@ -482,6 +482,7 @@  gss_alloc_msg(struct gss_auth *gss_auth,
 	switch (vers) {
 	case 0:
 		gss_encode_v0_msg(gss_msg);
+		break;
 	default:
 		gss_encode_v1_msg(gss_msg, service_name, gss_auth->target_name);
 	};