mm: Fix mremap not considering huge pmd devmap
mainline inclusion from mainline-v5.7 commit 5bfea2d9 category: bugfix bugzilla: NA CVE: CVE-2020-10757 --------------------------- The original code in mm/mremap.c checks huge pmd by: if (is_swap_pmd(*old_pmd) || pmd_trans_huge(*old_pmd)) { However, a DAX mapped nvdimm is mapped as huge page (by default) but it is not transparent huge page (_PAGE_PSE | PAGE_DEVMAP). This commit changes the condition to include the case. This addresses CVE-2020-10757. Fixes: 5c7fb56e ("mm, dax: dax-pmd vs thp-pmd vs hugetlbfs-pmd") Cc: <stable@vger.kernel.org> Reported-by:Fan Yang <Fan_Yang@sjtu.edu.cn> Signed-off-by:
Fan Yang <Fan_Yang@sjtu.edu.cn> Tested-by:
Fan Yang <Fan_Yang@sjtu.edu.cn> Tested-by:
Dan Williams <dan.j.williams@intel.com> Reviewed-by:
Dan Williams <dan.j.williams@intel.com> Acked-by:
Kirill A. Shutemov <kirill.shutemov@linux.intel.com> Signed-off-by:
Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by:
Yang Yingliang <yangyingliang@huawei.com> Reviewed-by:
Kefeng Wang <wangkefeng.wang@huawei.com> Reviewed-by:
Jason Yan <yanaijie@huawei.com> Signed-off-by:
Yang Yingliang <yangyingliang@huawei.com>
Please register or sign in to comment