Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 28 Jun 2010 17:45:01 +0000 (UTC)
From:      Attilio Rao <attilio@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r209577 - head/sys/kern
Message-ID:  <201006281745.o5SHj1Ph072948@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: attilio
Date: Mon Jun 28 17:45:00 2010
New Revision: 209577
URL: http://svn.freebsd.org/changeset/base/209577

Log:
  Fix a lock leak in the deadlock resolver in case the ticks counter
  wrapped up.
  
  Sponsored by:	Sandvine Incorporated
  Submitted by:	pluknet <pluknet at gmail dot com>
  Reported by:	Anton Yuzhaninov <citrin at citrin dot ru>
  Reviewed by:	jhb
  MFC after:	3 days

Modified:
  head/sys/kern/kern_clock.c

Modified: head/sys/kern/kern_clock.c
==============================================================================
--- head/sys/kern/kern_clock.c	Mon Jun 28 17:06:19 2010	(r209576)
+++ head/sys/kern/kern_clock.c	Mon Jun 28 17:45:00 2010	(r209577)
@@ -213,8 +213,10 @@ deadlkres(void)
 					MPASS(td->td_blocked != NULL);
 
 					/* Handle ticks wrap-up. */
-					if (ticks < td->td_blktick)
+					if (ticks < td->td_blktick) {
+						thread_unlock(td);
 						continue;
+					}
 					tticks = ticks - td->td_blktick;
 					thread_unlock(td);
 					if (tticks > blkticks) {
@@ -233,8 +235,10 @@ deadlkres(void)
 				} else if (TD_IS_SLEEPING(td)) {
 
 					/* Handle ticks wrap-up. */
-					if (ticks < td->td_blktick)
+					if (ticks < td->td_blktick) {
+						thread_unlock(td);
 						continue;
+					}
 
 					/*
 					 * Check if the thread is sleeping on a



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201006281745.o5SHj1Ph072948>