Skip to contentSkip to conversation

dlm: fix possible use-after-free

PATCH In review David Teigland 1 participant 1 message Jan 24, 2008 Distributed lock manager (DLM)

lore
Share & tools
lore

David Teigland

author maintainer
#0 lore raw

PATCH 16/19 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.

---
 fs/dlm/user.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
fs/dlm/user.c +2 -2
index 4f74154..eb61648 100644
@@ -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);
Signature · 1 line
1.5.3.3