The patch titled Subject: um: fix possible race on task->mm has been added to the -mm tree. Its filename is um-fix-possible-race-on-task-mm.patch Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/SubmitChecklist when testing your code *** The -mm tree is included into linux-next and is updated there every 3-4 working days ------------------------------------------------------ From: Anton Vorontsov <anton.vorontsov@xxxxxxxxxx> Subject: um: fix possible race on task->mm Checking for task->mm is dangerous as ->mm might disappear (exit_mm() assigns NULL under task_lock(), so tasklist lock is not enough). We can't use get_task_mm()/mmput() pair as mmput() might sleep, so let's take the task lock while we care about its mm. Note that we should also use find_lock_task_mm() to check all process' threads for a valid mm, but for uml we'll do it in a separate patch. Signed-off-by: Anton Vorontsov <anton.vorontsov@xxxxxxxxxx> Cc: Richard Weinberger <richard@xxxxxx> Cc: Oleg Nesterov <oleg@xxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- arch/um/kernel/reboot.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff -puN arch/um/kernel/reboot.c~um-fix-possible-race-on-task-mm arch/um/kernel/reboot.c --- a/arch/um/kernel/reboot.c~um-fix-possible-race-on-task-mm +++ a/arch/um/kernel/reboot.c @@ -25,10 +25,13 @@ static void kill_off_processes(void) read_lock(&tasklist_lock); for_each_process(p) { - if (p->mm == NULL) + task_lock(p); + if (!p->mm) { + task_unlock(p); continue; - + } pid = p->mm->context.id.u.pid; + task_unlock(p); os_kill_ptraced_process(pid, 1); } read_unlock(&tasklist_lock); _ Subject: Subject: um: fix possible race on task->mm Patches currently in -mm which might be from anton.vorontsov@xxxxxxxxxx are cpu-introduce-clear_tasks_mm_cpumask-helper.patch arm-use-clear_tasks_mm_cpumask.patch powerpc-use-clear_tasks_mm_cpumask.patch sh-use-clear_tasks_mm_cpumask.patch blackfin-a-couple-of-task-mm-handling-fixes.patch blackfin-fix-possible-deadlock-in-decode_address.patch um-should-hold-tasklist_lock-while-traversing-processes.patch um-fix-possible-race-on-task-mm.patch um-properly-check-all-process-threads-for-a-live-mm.patch -- To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html