提交 3b8ecccd 编写于 作者: L Lijun Fang 提交者: Xie XiuQi

mm/cdm: new_pol can be NULL when mbind mode arg was MPOL_DEFAULT

hulk inclusion
category: bugfix
bugzilla: 16080
CVE: NA
-------------------

the pointer new_pol can be NULL when mbind() mode arg was MPOL_DEFAULT,
so, before using new_pol, make sure it was not NULL.

Fixes: a72a680ff761 ("mm: Tag VMA with VM_CDM flag explicitly during mbind(MPOL_BIND) and page fault")
Signed-off-by: NLijun Fang <fanglijun3@huawei.com>
Reviewed-by: NYang Yingliang <yangyingliang@huawei.com>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 8d953c65
...@@ -763,8 +763,8 @@ static int mbind_range(struct mm_struct *mm, unsigned long start, ...@@ -763,8 +763,8 @@ static int mbind_range(struct mm_struct *mm, unsigned long start,
vmstart = max(start, vma->vm_start); vmstart = max(start, vma->vm_start);
vmend = min(end, vma->vm_end); vmend = min(end, vma->vm_end);
if ((new_pol->mode == MPOL_BIND) if (new_pol && (new_pol->mode == MPOL_BIND) &&
&& nodemask_has_cdm(new_pol->v.nodes)) nodemask_has_cdm(new_pol->v.nodes))
set_vm_cdm(vma); set_vm_cdm(vma);
if (mpol_equal(vma_policy(vma), new_pol)) if (mpol_equal(vma_policy(vma), new_pol))
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册