All of lore.kernel.org
 help / color / mirror / Atom feed
From: Simo Sorce <simo@redhat.com>
To: Linux NFS Mailing list <linux-nfs@vger.kernel.org>,
	libtirpc-devel@lists.sourceforge.net
Cc: Steve Dickson <steved@redhat.com>
Subject: [PATCH 1/1] Fix private data giveaway
Date: Fri,  5 Apr 2013 18:37:04 -0400	[thread overview]
Message-ID: <1365201425-21702-2-git-send-email-simo@redhat.com> (raw)
In-Reply-To: <1365201425-21702-1-git-send-email-simo@redhat.com>

When the private data is given away the gss context also needs to go,
because the caller may destroy it, such as when the context is exported
into a lucid context to hand it to the kernel.
---
 src/auth_gss.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/auth_gss.c b/src/auth_gss.c
index 81ae8aee316c6f42f317f81cd1438369fb2102c5..703bc3f7b42236b0d4cc3ddbd8935df2aaccf85a 100644
--- a/src/auth_gss.c
+++ b/src/auth_gss.c
@@ -269,6 +269,7 @@ authgss_get_private_data(AUTH *auth, struct authgss_private_data *pd)
 	 * send an RPCSEC_GSS_DESTROY request which might inappropriately
 	 * destroy the context.
 	 */
+        gd->ctx = GSS_C_NO_CONTEXT;
 	gd->gc.gc_ctx.length = 0;
 	gd->gc.gc_ctx.value = NULL;
 
@@ -284,7 +285,8 @@ authgss_free_private_data(struct authgss_private_data *pd)
 	if (!pd)
 		return (FALSE);
 
-	pd->pd_ctx = NULL;
+	if (pd->pd_ctx != GSS_C_NO_CONTEXT)
+		gss_delete_sec_context(&min_stat, &pd->pd_ctx, NULL);
 	gss_release_buffer(&min_stat, &pd->pd_ctx_hndl);
 	memset(&pd->pd_ctx_hndl, 0, sizeof(pd->pd_ctx_hndl));
 	pd->pd_seq_win = 0;
-- 
1.8.1.4


  reply	other threads:[~2013-04-05 22:37 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-05 22:37 [PATCH 0/2] libtirpc and nfs-utils fix for export lucid context Simo Sorce
2013-04-05 22:37 ` Simo Sorce [this message]
2013-04-05 22:37   ` [PATCH 2/2] Fix double free when exporting " Simo Sorce
2013-04-10 15:39     ` Steve Dickson
2013-04-10 15:39   ` [PATCH 1/1] Fix private data giveaway Steve Dickson
2013-04-09 19:41 ` [PATCH 0/2] libtirpc and nfs-utils fix for export lucid context Steve Dickson
2013-04-09 20:05   ` Simo Sorce

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1365201425-21702-2-git-send-email-simo@redhat.com \
    --to=simo@redhat.com \
    --cc=libtirpc-devel@lists.sourceforge.net \
    --cc=linux-nfs@vger.kernel.org \
    --cc=steved@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.