Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 180229
b: refs/heads/master
c: 59647b6
h: refs/heads/master
i:
  180227: 8891726
v: v3
  • Loading branch information
Thomas Gleixner committed Feb 3, 2010
1 parent fba6c1e commit 2d04a1d
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 51246bfd189064079c54421507236fd2723b18f3
refs/heads/master: 59647b6ac3050dd964bc556fe6ef22f4db5b935c
21 changes: 19 additions & 2 deletions trunk/kernel/futex.c
Original file line number Diff line number Diff line change
Expand Up @@ -530,8 +530,25 @@ lookup_pi_state(u32 uval, struct futex_hash_bucket *hb,
return -EINVAL;

WARN_ON(!atomic_read(&pi_state->refcount));
WARN_ON(pid && pi_state->owner &&
pi_state->owner->pid != pid);

/*
* When pi_state->owner is NULL then the owner died
* and another waiter is on the fly. pi_state->owner
* is fixed up by the task which acquires
* pi_state->rt_mutex.
*
* We do not check for pid == 0 which can happen when
* the owner died and robust_list_exit() cleared the
* TID.
*/
if (pid && pi_state->owner) {
/*
* Bail out if user space manipulated the
* futex value.
*/
if (pid != task_pid_vnr(pi_state->owner))
return -EINVAL;
}

atomic_inc(&pi_state->refcount);
*ps = pi_state;
Expand Down

0 comments on commit 2d04a1d

Please sign in to comment.