|
@@ -758,6 +758,13 @@ static int wake_futex_pi(u32 __user *uaddr, u32 uval, struct futex_q *this)
|
|
if (!pi_state)
|
|
if (!pi_state)
|
|
return -EINVAL;
|
|
return -EINVAL;
|
|
|
|
|
|
|
|
+ /*
|
|
|
|
+ * If current does not own the pi_state then the futex is
|
|
|
|
+ * inconsistent and user space fiddled with the futex value.
|
|
|
|
+ */
|
|
|
|
+ if (pi_state->owner != current)
|
|
|
|
+ return -EINVAL;
|
|
|
|
+
|
|
raw_spin_lock(&pi_state->pi_mutex.wait_lock);
|
|
raw_spin_lock(&pi_state->pi_mutex.wait_lock);
|
|
new_owner = rt_mutex_next_owner(&pi_state->pi_mutex);
|
|
new_owner = rt_mutex_next_owner(&pi_state->pi_mutex);
|
|
|
|
|