summaryrefslogtreecommitdiffstats
path: root/sys/rpc
diff options
context:
space:
mode:
authorrmacklem <rmacklem@FreeBSD.org>2009-07-01 16:42:03 +0000
committerrmacklem <rmacklem@FreeBSD.org>2009-07-01 16:42:03 +0000
commit53a5aa36f727a7601d32284c8e756c3469b6ccd7 (patch)
tree8f6df5fceb0e2a7cb9d84be29e6d7acc1eb22783 /sys/rpc
parentbad77de856a6138d1e3839ae0ac7a62a60e01332 (diff)
downloadFreeBSD-src-53a5aa36f727a7601d32284c8e756c3469b6ccd7.zip
FreeBSD-src-53a5aa36f727a7601d32284c8e756c3469b6ccd7.tar.gz
When unmounting an NFS mount using sec=krb5[ip], the umount system
call could get hung sleeping on "gsssta" if the credentials for a user that had been accessing the mount point have expired. This happened because rpc_gss_destroy_context() would end up calling itself when the "destroy context" RPC was attempted, trying to refresh the credentials. This patch just checks for this case in rpc_gss_refresh() and returns without attempting the refresh, which avoids the recursive call to rpc_gss_destroy_context() and the subsequent hang. Reviewed by: dfr Approved by: re (Ken Smith), kib (mentor)
Diffstat (limited to 'sys/rpc')
-rw-r--r--sys/rpc/rpcsec_gss/rpcsec_gss.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/sys/rpc/rpcsec_gss/rpcsec_gss.c b/sys/rpc/rpcsec_gss/rpcsec_gss.c
index e529b83..ec0c595 100644
--- a/sys/rpc/rpcsec_gss/rpcsec_gss.c
+++ b/sys/rpc/rpcsec_gss/rpcsec_gss.c
@@ -929,6 +929,20 @@ rpc_gss_refresh(AUTH *auth, void *msg)
{
struct rpc_msg *reply = (struct rpc_msg *) msg;
rpc_gss_options_ret_t options;
+ struct rpc_gss_data *gd;
+
+ gd = AUTH_PRIVATE(auth);
+
+ /*
+ * If the context is in DESTROYING state, then just return, since
+ * there is no point in refreshing the credentials.
+ */
+ mtx_lock(&gd->gd_lock);
+ if (gd->gd_state == RPCSEC_GSS_DESTROYING) {
+ mtx_unlock(&gd->gd_lock);
+ return (FALSE);
+ }
+ mtx_unlock(&gd->gd_lock);
/*
* If the error was RPCSEC_GSS_CREDPROBLEM of
OpenPOWER on IntegriCloud