|
@@ -108,6 +108,7 @@ struct gss_auth {
|
|
static DEFINE_SPINLOCK(pipe_version_lock);
|
|
static DEFINE_SPINLOCK(pipe_version_lock);
|
|
static struct rpc_wait_queue pipe_version_rpc_waitqueue;
|
|
static struct rpc_wait_queue pipe_version_rpc_waitqueue;
|
|
static DECLARE_WAIT_QUEUE_HEAD(pipe_version_waitqueue);
|
|
static DECLARE_WAIT_QUEUE_HEAD(pipe_version_waitqueue);
|
|
|
|
+static void gss_put_auth(struct gss_auth *gss_auth);
|
|
|
|
|
|
static void gss_free_ctx(struct gss_cl_ctx *);
|
|
static void gss_free_ctx(struct gss_cl_ctx *);
|
|
static const struct rpc_pipe_ops gss_upcall_ops_v0;
|
|
static const struct rpc_pipe_ops gss_upcall_ops_v0;
|
|
@@ -320,6 +321,7 @@ gss_release_msg(struct gss_upcall_msg *gss_msg)
|
|
if (gss_msg->ctx != NULL)
|
|
if (gss_msg->ctx != NULL)
|
|
gss_put_ctx(gss_msg->ctx);
|
|
gss_put_ctx(gss_msg->ctx);
|
|
rpc_destroy_wait_queue(&gss_msg->rpc_waitqueue);
|
|
rpc_destroy_wait_queue(&gss_msg->rpc_waitqueue);
|
|
|
|
+ gss_put_auth(gss_msg->auth);
|
|
kfree(gss_msg);
|
|
kfree(gss_msg);
|
|
}
|
|
}
|
|
|
|
|
|
@@ -498,9 +500,12 @@ gss_alloc_msg(struct gss_auth *gss_auth,
|
|
default:
|
|
default:
|
|
err = gss_encode_v1_msg(gss_msg, service_name, gss_auth->target_name);
|
|
err = gss_encode_v1_msg(gss_msg, service_name, gss_auth->target_name);
|
|
if (err)
|
|
if (err)
|
|
- goto err_free_msg;
|
|
|
|
|
|
+ goto err_put_pipe_version;
|
|
};
|
|
};
|
|
|
|
+ kref_get(&gss_auth->kref);
|
|
return gss_msg;
|
|
return gss_msg;
|
|
|
|
+err_put_pipe_version:
|
|
|
|
+ put_pipe_version(gss_auth->net);
|
|
err_free_msg:
|
|
err_free_msg:
|
|
kfree(gss_msg);
|
|
kfree(gss_msg);
|
|
err:
|
|
err:
|
|
@@ -991,6 +996,8 @@ gss_create_new(struct rpc_auth_create_args *args, struct rpc_clnt *clnt)
|
|
gss_auth->service = gss_pseudoflavor_to_service(gss_auth->mech, flavor);
|
|
gss_auth->service = gss_pseudoflavor_to_service(gss_auth->mech, flavor);
|
|
if (gss_auth->service == 0)
|
|
if (gss_auth->service == 0)
|
|
goto err_put_mech;
|
|
goto err_put_mech;
|
|
|
|
+ if (!gssd_running(gss_auth->net))
|
|
|
|
+ goto err_put_mech;
|
|
auth = &gss_auth->rpc_auth;
|
|
auth = &gss_auth->rpc_auth;
|
|
auth->au_cslack = GSS_CRED_SLACK >> 2;
|
|
auth->au_cslack = GSS_CRED_SLACK >> 2;
|
|
auth->au_rslack = GSS_VERF_SLACK >> 2;
|
|
auth->au_rslack = GSS_VERF_SLACK >> 2;
|
|
@@ -1061,6 +1068,12 @@ gss_free_callback(struct kref *kref)
|
|
gss_free(gss_auth);
|
|
gss_free(gss_auth);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+static void
|
|
|
|
+gss_put_auth(struct gss_auth *gss_auth)
|
|
|
|
+{
|
|
|
|
+ kref_put(&gss_auth->kref, gss_free_callback);
|
|
|
|
+}
|
|
|
|
+
|
|
static void
|
|
static void
|
|
gss_destroy(struct rpc_auth *auth)
|
|
gss_destroy(struct rpc_auth *auth)
|
|
{
|
|
{
|
|
@@ -1082,7 +1095,7 @@ gss_destroy(struct rpc_auth *auth)
|
|
gss_auth->gss_pipe[1] = NULL;
|
|
gss_auth->gss_pipe[1] = NULL;
|
|
rpcauth_destroy_credcache(auth);
|
|
rpcauth_destroy_credcache(auth);
|
|
|
|
|
|
- kref_put(&gss_auth->kref, gss_free_callback);
|
|
|
|
|
|
+ gss_put_auth(gss_auth);
|
|
}
|
|
}
|
|
|
|
|
|
/*
|
|
/*
|
|
@@ -1253,7 +1266,7 @@ gss_destroy_nullcred(struct rpc_cred *cred)
|
|
call_rcu(&cred->cr_rcu, gss_free_cred_callback);
|
|
call_rcu(&cred->cr_rcu, gss_free_cred_callback);
|
|
if (ctx)
|
|
if (ctx)
|
|
gss_put_ctx(ctx);
|
|
gss_put_ctx(ctx);
|
|
- kref_put(&gss_auth->kref, gss_free_callback);
|
|
|
|
|
|
+ gss_put_auth(gss_auth);
|
|
}
|
|
}
|
|
|
|
|
|
static void
|
|
static void
|