Skip to content

Commit

Permalink
SUNRPC: Don't call gss_delete_sec_context() from an rcu context
Browse files Browse the repository at this point in the history
Doing so may not be safe...

Signed-off-by: Trond Myklebust <[email protected]>
  • Loading branch information
Trond Myklebust authored and Trond Myklebust committed Aug 7, 2007
1 parent 905f8d1 commit a4deb81
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions net/sunrpc/auth_gss/auth_gss.c
Original file line number Diff line number Diff line change
Expand Up @@ -736,9 +736,6 @@ gss_do_free_ctx(struct gss_cl_ctx *ctx)
{
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);
}
Expand All @@ -753,7 +750,13 @@ gss_free_ctx_callback(struct rcu_head *head)
static void
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);
if (gc_gss_ctx)
gss_delete_sec_context(&gc_gss_ctx);
}

static void
Expand Down

0 comments on commit a4deb81

Please sign in to comment.