SUNRPC: Don't call gss_delete_sec_context() from an rcu context
Doing so may not be safe... Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
This commit is contained in:
parent
905f8d16e3
commit
a4deb81ba8
1 changed files with 6 additions and 3 deletions
|
@ -736,9 +736,6 @@ gss_do_free_ctx(struct gss_cl_ctx *ctx)
|
||||||
{
|
{
|
||||||
dprintk("RPC: gss_free_ctx\n");
|
dprintk("RPC: gss_free_ctx\n");
|
||||||
|
|
||||||
if (ctx->gc_gss_ctx)
|
|
||||||
gss_delete_sec_context(&ctx->gc_gss_ctx);
|
|
||||||
|
|
||||||
kfree(ctx->gc_wire_ctx.data);
|
kfree(ctx->gc_wire_ctx.data);
|
||||||
kfree(ctx);
|
kfree(ctx);
|
||||||
}
|
}
|
||||||
|
@ -753,7 +750,13 @@ gss_free_ctx_callback(struct rcu_head *head)
|
||||||
static void
|
static void
|
||||||
gss_free_ctx(struct gss_cl_ctx *ctx)
|
gss_free_ctx(struct gss_cl_ctx *ctx)
|
||||||
{
|
{
|
||||||
|
struct gss_ctx *gc_gss_ctx;
|
||||||
|
|
||||||
|
gc_gss_ctx = rcu_dereference(ctx->gc_gss_ctx);
|
||||||
|
rcu_assign_pointer(ctx->gc_gss_ctx, NULL);
|
||||||
call_rcu(&ctx->gc_rcu, gss_free_ctx_callback);
|
call_rcu(&ctx->gc_rcu, gss_free_ctx_callback);
|
||||||
|
if (gc_gss_ctx)
|
||||||
|
gss_delete_sec_context(&gc_gss_ctx);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
Loading…
Reference in a new issue