[PATCH 02/03] Cpuset: unsafe mm reference fix

From: Paul Jackson
Date: Wed Mar 29 2006 - 04:08:28 EST


From: Paul Jackson <pj@xxxxxxx>

Fix unsafe reference to a tasks mm struct, by moving the
reference inside of a convenient nearby properly guarded
code block.

Signed-off-by: Paul Jackson <pj@xxxxxxx>

---

kernel/cpuset.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

--- 2.6.16-mm1.orig/kernel/cpuset.c 2006-03-27 08:44:26.165846244 -0800
+++ 2.6.16-mm1/kernel/cpuset.c 2006-03-27 08:44:27.405861502 -0800
@@ -1183,11 +1183,11 @@ static int attach_task(struct cpuset *cs
mm = get_task_mm(tsk);
if (mm) {
mpol_rebind_mm(mm, &to);
+ if (is_memory_migrate(cs))
+ do_migrate_pages(mm, &from, &to, MPOL_MF_MOVE_ALL);
mmput(mm);
}

- if (is_memory_migrate(cs))
- do_migrate_pages(tsk->mm, &from, &to, MPOL_MF_MOVE_ALL);
put_task_struct(tsk);
synchronize_rcu();
if (atomic_dec_and_test(&oldcs->count))

--
I won't rest till it's the best ...
Programmer, Linux Scalability
Paul Jackson <pj@xxxxxxx> 1.650.933.1373
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/