Skip to content

Commit

Permalink
dlm: fix possible use-after-free
Browse files Browse the repository at this point in the history
The dlm_put_lkb() can free the lkb and its associated ua structure,
so we can't depend on using the ua struct after the put.

Signed-off-by: David Teigland <teigland@redhat.com>
  • Loading branch information
David Teigland committed Jan 30, 2008
1 parent 755b5eb commit ce5246b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions fs/dlm/user.c
Original file line number Diff line number Diff line change
Expand Up @@ -236,12 +236,12 @@ void dlm_user_add_ast(struct dlm_lkb *lkb, int type)
spin_unlock(&proc->asts_spin);

if (eol) {
spin_lock(&ua->proc->locks_spin);
spin_lock(&proc->locks_spin);
if (!list_empty(&lkb->lkb_ownqueue)) {
list_del_init(&lkb->lkb_ownqueue);
dlm_put_lkb(lkb);
}
spin_unlock(&ua->proc->locks_spin);
spin_unlock(&proc->locks_spin);
}
out:
mutex_unlock(&ls->ls_clear_proc_locks);
Expand Down

0 comments on commit ce5246b

Please sign in to comment.