-
由 Kui-Feng Lee 提交于
Fix the system crash that happens when a task iterator travel through vma of tasks. In task iterators, we used to access mm by following the pointer on the task_struct; however, the death of a task will clear the pointer, even though we still hold the task_struct. That can cause an unexpected crash for a null pointer when an iterator is visiting a task that dies during the visit. Keeping a reference of mm on the iterator ensures we always have a valid pointer to mm. Co-developed-by: NSong Liu <song@kernel.org> Signed-off-by: NSong Liu <song@kernel.org> Signed-off-by: NKui-Feng Lee <kuifeng@meta.com> Reported-by: NNathan Slingerland <slinger@meta.com> Acked-by: NYonghong Song <yhs@fb.com> Link: https://lore.kernel.org/r/20221216221855.4122288-2-kuifeng@meta.comSigned-off-by: NAlexei Starovoitov <ast@kernel.org>
7ff94f27