linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/4] gss-proxy fixes for 3.11
@ 2013-08-01 13:17 J. Bruce Fields
  2013-08-01 13:17 ` [PATCH 1/4] svcrpc: fix gss_rpc_upcall create error J. Bruce Fields
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: J. Bruce Fields @ 2013-08-01 13:17 UTC (permalink / raw)
  To: linux-nfs; +Cc: J. Bruce Fields

From: "J. Bruce Fields" <bfields@redhat.com>

These are few gss proxy bugfixes, two found during the original testing
that I mistakenly dropped, two more than I found during more recent
testing (the last a regression introduced in 3.11).

With these applied I can do a krb5 mount with either rpc.svcgssd or
gss-proxy.

I intend to submit them for 3.11.

--b.

J. Bruce Fields (4):
  svcrpc: fix gss_rpc_upcall create error
  svcrpc: fix gss-proxy xdr decoding oops
  svcrpc: fix kfree oops in gss-proxy code
  svcrpc: set cr_gss_mech from gss-proxy as well as legacy upcall

 net/sunrpc/auth_gss/gss_rpc_upcall.c |    3 +--
 net/sunrpc/auth_gss/gss_rpc_xdr.c    |    9 +++++----
 net/sunrpc/auth_gss/svcauth_gss.c    |    2 +-
 3 files changed, 7 insertions(+), 7 deletions(-)

-- 
1.7.9.5


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH 1/4] svcrpc: fix gss_rpc_upcall create error
  2013-08-01 13:17 [PATCH 0/4] gss-proxy fixes for 3.11 J. Bruce Fields
@ 2013-08-01 13:17 ` J. Bruce Fields
  2013-08-01 13:17 ` [PATCH 2/4] svcrpc: fix gss-proxy xdr decoding oops J. Bruce Fields
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: J. Bruce Fields @ 2013-08-01 13:17 UTC (permalink / raw)
  To: linux-nfs; +Cc: J. Bruce Fields, stable

From: "J. Bruce Fields" <bfields@redhat.com>

Cc: stable@vger.kernel.org
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
---
 net/sunrpc/auth_gss/gss_rpc_upcall.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/sunrpc/auth_gss/gss_rpc_upcall.c b/net/sunrpc/auth_gss/gss_rpc_upcall.c
index d304f41..1e1ccf5 100644
--- a/net/sunrpc/auth_gss/gss_rpc_upcall.c
+++ b/net/sunrpc/auth_gss/gss_rpc_upcall.c
@@ -120,7 +120,7 @@ static int gssp_rpc_create(struct net *net, struct rpc_clnt **_clnt)
 	if (IS_ERR(clnt)) {
 		dprintk("RPC:       failed to create AF_LOCAL gssproxy "
 				"client (errno %ld).\n", PTR_ERR(clnt));
-		result = -PTR_ERR(clnt);
+		result = PTR_ERR(clnt);
 		*_clnt = NULL;
 		goto out;
 	}
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 2/4] svcrpc: fix gss-proxy xdr decoding oops
  2013-08-01 13:17 [PATCH 0/4] gss-proxy fixes for 3.11 J. Bruce Fields
  2013-08-01 13:17 ` [PATCH 1/4] svcrpc: fix gss_rpc_upcall create error J. Bruce Fields
@ 2013-08-01 13:17 ` J. Bruce Fields
  2013-08-01 13:17 ` [PATCH 3/4] svcrpc: fix kfree oops in gss-proxy code J. Bruce Fields
  2013-08-01 13:17 ` [PATCH 4/4] svcrpc: set cr_gss_mech from gss-proxy as well as legacy upcall J. Bruce Fields
  3 siblings, 0 replies; 5+ messages in thread
From: J. Bruce Fields @ 2013-08-01 13:17 UTC (permalink / raw)
  To: linux-nfs; +Cc: J. Bruce Fields, stable

From: "J. Bruce Fields" <bfields@redhat.com>

Uninitialized stack data was being used as the destination for memcpy's.

Longer term we'll just delete some of this code; all we're doing is
skipping over xdr that we don't care about.

Cc: stable@vger.kernel.org
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
---
 net/sunrpc/auth_gss/gss_rpc_xdr.c |    9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/net/sunrpc/auth_gss/gss_rpc_xdr.c b/net/sunrpc/auth_gss/gss_rpc_xdr.c
index 357f613..3c85d1c 100644
--- a/net/sunrpc/auth_gss/gss_rpc_xdr.c
+++ b/net/sunrpc/auth_gss/gss_rpc_xdr.c
@@ -430,7 +430,7 @@ static int dummy_enc_nameattr_array(struct xdr_stream *xdr,
 static int dummy_dec_nameattr_array(struct xdr_stream *xdr,
 				    struct gssx_name_attr_array *naa)
 {
-	struct gssx_name_attr dummy;
+	struct gssx_name_attr dummy = { .attr = {.len = 0} };
 	u32 count, i;
 	__be32 *p;
 
@@ -493,12 +493,13 @@ static int gssx_enc_name(struct xdr_stream *xdr,
 	return err;
 }
 
+
 static int gssx_dec_name(struct xdr_stream *xdr,
 			 struct gssx_name *name)
 {
-	struct xdr_netobj dummy_netobj;
-	struct gssx_name_attr_array dummy_name_attr_array;
-	struct gssx_option_array dummy_option_array;
+	struct xdr_netobj dummy_netobj = { .len = 0 };
+	struct gssx_name_attr_array dummy_name_attr_array = { .count = 0 };
+	struct gssx_option_array dummy_option_array = { .count = 0 };
 	int err;
 
 	/* name->display_name */
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 3/4] svcrpc: fix kfree oops in gss-proxy code
  2013-08-01 13:17 [PATCH 0/4] gss-proxy fixes for 3.11 J. Bruce Fields
  2013-08-01 13:17 ` [PATCH 1/4] svcrpc: fix gss_rpc_upcall create error J. Bruce Fields
  2013-08-01 13:17 ` [PATCH 2/4] svcrpc: fix gss-proxy xdr decoding oops J. Bruce Fields
@ 2013-08-01 13:17 ` J. Bruce Fields
  2013-08-01 13:17 ` [PATCH 4/4] svcrpc: set cr_gss_mech from gss-proxy as well as legacy upcall J. Bruce Fields
  3 siblings, 0 replies; 5+ messages in thread
From: J. Bruce Fields @ 2013-08-01 13:17 UTC (permalink / raw)
  To: linux-nfs; +Cc: J. Bruce Fields, stable

From: "J. Bruce Fields" <bfields@redhat.com>

mech_oid.data is an array, not kmalloc()'d memory.

Cc: stable@vger.kernel.org
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
---
 net/sunrpc/auth_gss/gss_rpc_upcall.c |    1 -
 1 file changed, 1 deletion(-)

diff --git a/net/sunrpc/auth_gss/gss_rpc_upcall.c b/net/sunrpc/auth_gss/gss_rpc_upcall.c
index 1e1ccf5..af7ffd4 100644
--- a/net/sunrpc/auth_gss/gss_rpc_upcall.c
+++ b/net/sunrpc/auth_gss/gss_rpc_upcall.c
@@ -328,7 +328,6 @@ void gssp_free_upcall_data(struct gssp_upcall_data *data)
 	kfree(data->in_handle.data);
 	kfree(data->out_handle.data);
 	kfree(data->out_token.data);
-	kfree(data->mech_oid.data);
 	free_svc_cred(&data->creds);
 }
 
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 4/4] svcrpc: set cr_gss_mech from gss-proxy as well as legacy upcall
  2013-08-01 13:17 [PATCH 0/4] gss-proxy fixes for 3.11 J. Bruce Fields
                   ` (2 preceding siblings ...)
  2013-08-01 13:17 ` [PATCH 3/4] svcrpc: fix kfree oops in gss-proxy code J. Bruce Fields
@ 2013-08-01 13:17 ` J. Bruce Fields
  3 siblings, 0 replies; 5+ messages in thread
From: J. Bruce Fields @ 2013-08-01 13:17 UTC (permalink / raw)
  To: linux-nfs; +Cc: J. Bruce Fields

From: "J. Bruce Fields" <bfields@redhat.com>

The change made to rsc_parse() in
0dc1531aca7fd1440918bd55844a054e9c29acad "svcrpc: store gss mech in
svc_cred" should also have been propagated to the gss-proxy codepath.
This fixes a crash in the gss-proxy case.

Signed-off-by: J. Bruce Fields <bfields@redhat.com>
---
 net/sunrpc/auth_gss/svcauth_gss.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/sunrpc/auth_gss/svcauth_gss.c b/net/sunrpc/auth_gss/svcauth_gss.c
index d0347d1..09fb638 100644
--- a/net/sunrpc/auth_gss/svcauth_gss.c
+++ b/net/sunrpc/auth_gss/svcauth_gss.c
@@ -1180,6 +1180,7 @@ static int gss_proxy_save_rsc(struct cache_detail *cd,
 		gm = gss_mech_get_by_OID(&ud->mech_oid);
 		if (!gm)
 			goto out;
+		rsci.cred.cr_gss_mech = gm;
 
 		status = -EINVAL;
 		/* mech-specific data: */
@@ -1195,7 +1196,6 @@ static int gss_proxy_save_rsc(struct cache_detail *cd,
 	rscp = rsc_update(cd, &rsci, rscp);
 	status = 0;
 out:
-	gss_mech_put(gm);
 	rsc_free(&rsci);
 	if (rscp)
 		cache_put(&rscp->h, cd);
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2013-08-01 13:17 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-08-01 13:17 [PATCH 0/4] gss-proxy fixes for 3.11 J. Bruce Fields
2013-08-01 13:17 ` [PATCH 1/4] svcrpc: fix gss_rpc_upcall create error J. Bruce Fields
2013-08-01 13:17 ` [PATCH 2/4] svcrpc: fix gss-proxy xdr decoding oops J. Bruce Fields
2013-08-01 13:17 ` [PATCH 3/4] svcrpc: fix kfree oops in gss-proxy code J. Bruce Fields
2013-08-01 13:17 ` [PATCH 4/4] svcrpc: set cr_gss_mech from gss-proxy as well as legacy upcall J. Bruce Fields

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).