Home Home > GIT Browse > SLE15
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Kara <jack@suse.cz>2019-05-16 12:04:39 +0200
committerJan Kara <jack@suse.cz>2019-05-20 14:48:49 +0200
commit50770c3d769d66e28fa613e8360ff84b57815c33 (patch)
treed1174c2e67f2adb89803d20dbf4a1885fbf5a089
parent0705678152b09fe676196922a8b6ffdee44067c8 (diff)
mm/huge_memory: fix vmf_insert_pfn_{pmd, pud}() crash, handle
unaligned addresses (bsc#1135330). suse-commit: 545b409ab9e3943a18e3789628e22b96c5f66e80
-rw-r--r--mm/huge_memory.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/mm/huge_memory.c b/mm/huge_memory.c
index 1828ace5411a..29463467900b 100644
--- a/mm/huge_memory.c
+++ b/mm/huge_memory.c
@@ -780,6 +780,8 @@ int vmf_insert_pfn_pmd(struct vm_area_struct *vma, unsigned long addr,
{
pgprot_t pgprot = vma->vm_page_prot;
pgtable_t pgtable = NULL;
+
+ addr &= PMD_MASK;
/*
* If we had pmd_special, we could avoid all these restrictions,
* but we need to be consistent with PTEs and architectures that
@@ -855,6 +857,8 @@ int vmf_insert_pfn_pud(struct vm_area_struct *vma, unsigned long addr,
pud_t *pud, pfn_t pfn, bool write)
{
pgprot_t pgprot = vma->vm_page_prot;
+
+ addr &= PUD_MASK;
/*
* If we had pud_special, we could avoid all these restrictions,
* but we need to be consistent with PTEs and architectures that