From: Oleg Nesterov Date: Thu, 9 Oct 2014 22:25:19 +0000 (-0700) Subject: fs/proc/task_mmu.c: don't use task->mm in m_start() and show_*map() X-Git-Tag: fixes-against-v3.18-rc2~137^2~140 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=46c298cf69d0e9a27d33ff992a81bd7b441c7933;p=pandora-kernel.git fs/proc/task_mmu.c: don't use task->mm in m_start() and show_*map() get_gate_vma(priv->task->mm) looks ugly and wrong, task->mm can be NULL or it can changed by exec right after mm_access(). And in theory this race is not harmless, the task can exec and then later exit and free the new mm_struct. In this case get_task_mm(oldmm) can't help, get_gate_vma(task->mm) can read the freed/unmapped memory. I think that priv->task should simply die and hold_task_mempolicy() logic can be simplified. tail_vma logic asks for cleanups too. Signed-off-by: Oleg Nesterov Acked-by: Kirill A. Shutemov Acked-by: Cyrill Gorcunov Cc: "Eric W. Biederman" Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- Reading git-diff-tree failed