lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <Pine.LNX.4.64.0610011337250.29459@frodo.shire>
Date:	Sun, 1 Oct 2006 13:37:49 +0200 (CEST)
From:	Esben Nielsen <nielsen.esben@...glemail.com>
To:	Ingo Molnar <mingo@...e.hu>
cc:	linux-kernel@...r.kernel.org, Thomas Gleixner <tglx@...utronix.de>,
	Steven Rostedt <rostedt@...dmis.org>
Subject: [patch 5/5] Fix timeout bug in rtmutex in 2.6.18-rt

  kernel/futex.c |   11 +++++++++--
  1 file changed, 9 insertions(+), 2 deletions(-)

Index: linux-2.6.18-rt/kernel/futex.c
===================================================================
--- linux-2.6.18-rt.orig/kernel/futex.c
+++ linux-2.6.18-rt/kernel/futex.c
@@ -567,6 +567,7 @@ static int wake_futex_pi(u32 __user *uad
  	if (!pi_state)
  		return -EINVAL;

+	spin_lock(&pi_state->pi_mutex.wait_lock);
  	new_owner = rt_mutex_next_owner(&pi_state->pi_mutex);

  	/*
@@ -589,10 +590,14 @@ static int wake_futex_pi(u32 __user *uad
  		inc_preempt_count();
  		curval = futex_atomic_cmpxchg_inatomic(uaddr, uval, newval);
  		dec_preempt_count();
-		if (curval == -EFAULT)
+		if (curval == -EFAULT) {
+			spin_unlock(&pi_state->pi_mutex.wait_lock);
  			return -EFAULT;
-		if (curval != uval)
+		}
+		if (curval != uval) {
+			spin_unlock(&pi_state->pi_mutex.wait_lock);
  			return -EINVAL;
+		}
  	}

  	spin_lock_irq(&pi_state->owner->pi_lock);
@@ -606,6 +611,8 @@ static int wake_futex_pi(u32 __user *uad
  	pi_state->owner = new_owner;
  	spin_unlock_irq(&new_owner->pi_lock);

+	spin_unlock(&pi_state->pi_mutex.wait_lock);
+
  	rt_mutex_unlock(&pi_state->pi_mutex);

  	return 0;

--
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ