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]
Date:	Sun, 4 Oct 2009 07:54:41 GMT
From:	tip-bot for Thomas Gleixner <tglx@...utronix.de>
To:	linux-tip-commits@...r.kernel.org
Cc:	dvhltc@...ibm.com, linux-kernel@...r.kernel.org, hpa@...or.com,
	mingo@...hat.com, a.p.zijlstra@...llo.nl, stable@...nel.org,
	rercola@....jhu.edu, tglx@...utronix.de, mingo@...e.hu
Subject: [tip:core/futexes] futex: Fix locking imbalance

Commit-ID:  9694d494b7f462bffb86654fabe9e1ec2b2b0c47
Gitweb:     http://git.kernel.org/tip/9694d494b7f462bffb86654fabe9e1ec2b2b0c47
Author:     Thomas Gleixner <tglx@...utronix.de>
AuthorDate: Sun, 4 Oct 2009 09:34:17 +0200
Committer:  Thomas Gleixner <tglx@...utronix.de>
CommitDate: Sun, 4 Oct 2009 09:46:56 +0200

futex: Fix locking imbalance

Rich reported a lock imbalance in the futex code.
(http://bugzilla.kernel.org/show_bug.cgi?id=14288)

It's caused by the displacement of the retry_private label in
futex_wake_op(). The code unlocks the hash bucket locks in the error
handling path and retries without locking them again which makes the
next unlock fail.

Move retry_private so we lock the hash bucket locks when we retry.

Reported-by: Rich Ercolany <rercola@....jhu.edu>
Signed-off-by: Thomas Gleixner <tglx@...utronix.de>
LKML-Reference: <new-submission>
Cc: Ingo Molnar <mingo@...e.hu>
Cc: Peter Zijlstra <a.p.zijlstra@...llo.nl>
Cc: Darren Hart <dvhltc@...ibm.com>
Cc: stable-2.6.31 <stable@...nel.org>


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

diff --git a/kernel/futex.c b/kernel/futex.c
index b911adc..a2f7538 100644
--- a/kernel/futex.c
+++ b/kernel/futex.c
@@ -916,8 +916,8 @@ retry:
 	hb1 = hash_futex(&key1);
 	hb2 = hash_futex(&key2);
 
-	double_lock_hb(hb1, hb2);
 retry_private:
+	double_lock_hb(hb1, hb2);
 	op_ret = futex_atomic_op_inuser(op, uaddr2);
 	if (unlikely(op_ret < 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