aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--kernel/futex.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/kernel/futex.c b/kernel/futex.c
index 17828033a639..06e8240d2abe 100644
--- a/kernel/futex.c
+++ b/kernel/futex.c
@@ -758,6 +758,13 @@ static int wake_futex_pi(u32 __user *uaddr, u32 uval, struct futex_q *this)
758 if (!pi_state) 758 if (!pi_state)
759 return -EINVAL; 759 return -EINVAL;
760 760
761 /*
762 * If current does not own the pi_state then the futex is
763 * inconsistent and user space fiddled with the futex value.
764 */
765 if (pi_state->owner != current)
766 return -EINVAL;
767
761 raw_spin_lock(&pi_state->pi_mutex.wait_lock); 768 raw_spin_lock(&pi_state->pi_mutex.wait_lock);
762 new_owner = rt_mutex_next_owner(&pi_state->pi_mutex); 769 new_owner = rt_mutex_next_owner(&pi_state->pi_mutex);
763 770