summaryrefslogtreecommitdiff
path: root/kernel/futex_compat.c
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2009-12-01 14:02:00 +0100
committerThomas Gleixner <tglx@linutronix.de>2009-12-09 14:22:14 +0100
commitf409adf5b1db55ece7e80b67a944f9c0d3fe93e9 (patch)
treeb7bf1b249767764ef8899f8b44cd436a966fe863 /kernel/futex_compat.c
parent2b876f95d03e226394b5d360c86127cbefaf614b (diff)
downloadlwn-f409adf5b1db55ece7e80b67a944f9c0d3fe93e9.tar.gz
lwn-f409adf5b1db55ece7e80b67a944f9c0d3fe93e9.zip
futex: Protect pid lookup in compat code with RCU
find_task_by_vpid() in compat_sys_get_robust_list() does not require tasklist_lock. It can be protected with rcu_read_lock as done in sys_get_robust_list() already. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Cc: Darren Hart <dvhltc@us.ibm.com> Cc: Peter Zijlstra <peterz@infradead.org>
Diffstat (limited to 'kernel/futex_compat.c')
-rw-r--r--kernel/futex_compat.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/kernel/futex_compat.c b/kernel/futex_compat.c
index 235716556bf1..d49afb2395e5 100644
--- a/kernel/futex_compat.c
+++ b/kernel/futex_compat.c
@@ -146,7 +146,7 @@ compat_sys_get_robust_list(int pid, compat_uptr_t __user *head_ptr,
struct task_struct *p;
ret = -ESRCH;
- read_lock(&tasklist_lock);
+ rcu_read_lock();
p = find_task_by_vpid(pid);
if (!p)
goto err_unlock;
@@ -157,7 +157,7 @@ compat_sys_get_robust_list(int pid, compat_uptr_t __user *head_ptr,
!capable(CAP_SYS_PTRACE))
goto err_unlock;
head = p->compat_robust_list;
- read_unlock(&tasklist_lock);
+ rcu_read_unlock();
}
if (put_user(sizeof(*head), len_ptr))
@@ -165,7 +165,7 @@ compat_sys_get_robust_list(int pid, compat_uptr_t __user *head_ptr,
return put_user(ptr_to_compat(head), head_ptr);
err_unlock:
- read_unlock(&tasklist_lock);
+ rcu_read_unlock();
return ret;
}