Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 73425
b: refs/heads/master
c: 3c5fd9c
h: refs/heads/master
i:
  73423: d47c73f
v: v3
  • Loading branch information
David Miller authored and Linus Torvalds committed Nov 10, 2007
1 parent dbd8df1 commit c3adfa3
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 8 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: 8fc543c8f004fc9dfe0a262dc452dfe2eca4589b
refs/heads/master: 3c5fd9c77d609b51c0bab682c9d40cbb496ec6f1
26 changes: 19 additions & 7 deletions trunk/kernel/futex_compat.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,15 @@ fetch_robust_entry(compat_uptr_t *uentry, struct robust_list __user **entry,
return 0;
}

static void __user *futex_uaddr(struct robust_list *entry,
compat_long_t futex_offset)
{
compat_uptr_t base = ptr_to_compat(entry);
void __user *uaddr = compat_ptr(base + futex_offset);

return uaddr;
}

/*
* Walk curr->robust_list (very carefully, it's a userspace list!)
* and mark any locks found there dead, and notify any waiters.
Expand Down Expand Up @@ -76,11 +85,12 @@ void compat_exit_robust_list(struct task_struct *curr)
* A pending lock might already be on the list, so
* dont process it twice:
*/
if (entry != pending)
if (handle_futex_death((void __user *)entry + futex_offset,
curr, pi))
return;
if (entry != pending) {
void __user *uaddr = futex_uaddr(entry, futex_offset);

if (handle_futex_death(uaddr, curr, pi))
return;
}
if (rc)
return;
uentry = next_uentry;
Expand All @@ -94,9 +104,11 @@ void compat_exit_robust_list(struct task_struct *curr)

cond_resched();
}
if (pending)
handle_futex_death((void __user *)pending + futex_offset,
curr, pip);
if (pending) {
void __user *uaddr = futex_uaddr(pending, futex_offset);

handle_futex_death(uaddr, curr, pip);
}
}

asmlinkage long
Expand Down

0 comments on commit c3adfa3

Please sign in to comment.