projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
1f64d69
)
mm/mempolicy.c: add rcu read lock to protect pid structure
author
Zeng Zhaoming
<
[email protected]
>
Thu, 2 Dec 2010 22:31:13 +0000
(14:31 -0800)
committer
Linus Torvalds
<
[email protected]
>
Thu, 2 Dec 2010 22:51:14 +0000
(14:51 -0800)
find_task_by_vpid() should be protected by rcu_read_lock(), to prevent
free_pid() reclaiming pid.
Signed-off-by: Zeng Zhaoming <
[email protected]
>
Cc: "Paul E. McKenney" <
[email protected]
>
Cc: KOSAKI Motohiro <
[email protected]
>
Cc: Christoph Lameter <
[email protected]
>
Signed-off-by: Andrew Morton <
[email protected]
>
Signed-off-by: Linus Torvalds <
[email protected]
>
mm/mempolicy.c
patch
|
blob
|
history
diff --git
a/mm/mempolicy.c
b/mm/mempolicy.c
index 4a57f135b76e74741e7c7d285642067a3e18efe6..11ff260fb282b778657a872aec0947d5f15616c6 100644
(file)
--- a/
mm/mempolicy.c
+++ b/
mm/mempolicy.c
@@
-1307,15
+1307,18
@@
SYSCALL_DEFINE4(migrate_pages, pid_t, pid, unsigned long, maxnode,
goto out;
/* Find the mm_struct */
+ rcu_read_lock();
read_lock(&tasklist_lock);
task = pid ? find_task_by_vpid(pid) : current;
if (!task) {
read_unlock(&tasklist_lock);
+ rcu_read_unlock();
err = -ESRCH;
goto out;
}
mm = get_task_mm(task);
read_unlock(&tasklist_lock);
+ rcu_read_unlock();
err = -EINVAL;
if (!mm)