From owner-svn-src-head@FreeBSD.ORG Wed Jul 1 16:42:03 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8C184106566C; Wed, 1 Jul 2009 16:42:03 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7A5FE8FC1B; Wed, 1 Jul 2009 16:42:03 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n61Gg3ZJ018132; Wed, 1 Jul 2009 16:42:03 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n61Gg3oi018130; Wed, 1 Jul 2009 16:42:03 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <200907011642.n61Gg3oi018130@svn.freebsd.org> From: Rick Macklem Date: Wed, 1 Jul 2009 16:42:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195246 - head/sys/rpc/rpcsec_gss X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Jul 2009 16:42:04 -0000 Author: rmacklem Date: Wed Jul 1 16:42:03 2009 New Revision: 195246 URL: http://svn.freebsd.org/changeset/base/195246 Log: 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) Modified: head/sys/rpc/rpcsec_gss/rpcsec_gss.c Modified: head/sys/rpc/rpcsec_gss/rpcsec_gss.c ============================================================================== --- head/sys/rpc/rpcsec_gss/rpcsec_gss.c Wed Jul 1 16:38:18 2009 (r195245) +++ head/sys/rpc/rpcsec_gss/rpcsec_gss.c Wed Jul 1 16:42:03 2009 (r195246) @@ -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