From: David Teigland Date: Mon, 14 Jan 2008 21:48:58 +0000 (-0600) Subject: dlm: fix possible use-after-free X-Git-Tag: v2.6.25-rc1~1139^2~5 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=ce5246b972f7514af899a63c0faf831d05ed5ee1;p=linux-2.6-omap-h63xx.git dlm: fix possible use-after-free 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 --- diff --git a/fs/dlm/user.c b/fs/dlm/user.c index 4f741546f4b..eb616481694 100644 --- a/fs/dlm/user.c +++ b/fs/dlm/user.c @@ -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);