summaryrefslogtreecommitdiff
path: root/kernel
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2007-03-16 13:38:31 -0800
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-03-16 19:25:06 -0700
commit21778867b1c8e0feb567addb6dc0a7e2ca6ecdec (patch)
treea88a1a8f9a469f0b9e94a2025a6d1990ee9fc407 /kernel
parentd3a7b6df4951170079252402fd0c2dc70cb0ca2a (diff)
downloadlinux-3.10-21778867b1c8e0feb567addb6dc0a7e2ca6ecdec.tar.gz
linux-3.10-21778867b1c8e0feb567addb6dc0a7e2ca6ecdec.tar.bz2
linux-3.10-21778867b1c8e0feb567addb6dc0a7e2ca6ecdec.zip
[PATCH] futex: PI state locking fix
Testing of -rt by IBM uncovered a locking bug in wake_futex_pi(): the PI state needs to be locked before we access it. Signed-off-by: Ingo Molnar <mingo@elte.hu> Acked-by: Thomas Gleixner <tglx@linutronix.de> Cc: Chuck Ebbert <cebbert@redhat.com> Cc: <stable@kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/futex.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/kernel/futex.c b/kernel/futex.c
index e749e7df14b..5a270b5e3f9 100644
--- a/kernel/futex.c
+++ b/kernel/futex.c
@@ -565,6 +565,7 @@ static int wake_futex_pi(u32 __user *uaddr, u32 uval, struct futex_q *this)
if (!pi_state)
return -EINVAL;
+ spin_lock(&pi_state->pi_mutex.wait_lock);
new_owner = rt_mutex_next_owner(&pi_state->pi_mutex);
/*
@@ -604,6 +605,7 @@ static int wake_futex_pi(u32 __user *uaddr, u32 uval, struct futex_q *this)
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;