diff options
author | Thomas Gleixner <tglx@linutronix.de> | 2009-12-01 08:02:00 -0500 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2009-12-09 08:22:14 -0500 |
commit | f409adf5b1db55ece7e80b67a944f9c0d3fe93e9 (patch) | |
tree | b7bf1b249767764ef8899f8b44cd436a966fe863 | |
parent | 2b876f95d03e226394b5d360c86127cbefaf614b (diff) |
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>
-rw-r--r-- | kernel/futex_compat.c | 6 |
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, | |||
146 | struct task_struct *p; | 146 | struct task_struct *p; |
147 | 147 | ||
148 | ret = -ESRCH; | 148 | ret = -ESRCH; |
149 | read_lock(&tasklist_lock); | 149 | rcu_read_lock(); |
150 | p = find_task_by_vpid(pid); | 150 | p = find_task_by_vpid(pid); |
151 | if (!p) | 151 | if (!p) |
152 | goto err_unlock; | 152 | goto err_unlock; |
@@ -157,7 +157,7 @@ compat_sys_get_robust_list(int pid, compat_uptr_t __user *head_ptr, | |||
157 | !capable(CAP_SYS_PTRACE)) | 157 | !capable(CAP_SYS_PTRACE)) |
158 | goto err_unlock; | 158 | goto err_unlock; |
159 | head = p->compat_robust_list; | 159 | head = p->compat_robust_list; |
160 | read_unlock(&tasklist_lock); | 160 | rcu_read_unlock(); |
161 | } | 161 | } |
162 | 162 | ||
163 | if (put_user(sizeof(*head), len_ptr)) | 163 | if (put_user(sizeof(*head), len_ptr)) |
@@ -165,7 +165,7 @@ compat_sys_get_robust_list(int pid, compat_uptr_t __user *head_ptr, | |||
165 | return put_user(ptr_to_compat(head), head_ptr); | 165 | return put_user(ptr_to_compat(head), head_ptr); |
166 | 166 | ||
167 | err_unlock: | 167 | err_unlock: |
168 | read_unlock(&tasklist_lock); | 168 | rcu_read_unlock(); |
169 | 169 | ||
170 | return ret; | 170 | return ret; |
171 | } | 171 | } |