summaryrefslogtreecommitdiffstats
path: root/arch/parisc
diff options
context:
space:
mode:
authorHelge Deller <deller@gmx.de>2018-10-12 22:37:46 +0200
committerHelge Deller <deller@gmx.de>2018-10-17 08:18:01 +0200
commit3c229b3f2dd8133f61bb81d3cb018be92f4bba39 (patch)
treebff3ada8bcb9d2b031300f94f8a0a79874aee84e /arch/parisc
parentparisc: Purge TLB entries after updating page table entry and set page access... (diff)
downloadlinux-3c229b3f2dd8133f61bb81d3cb018be92f4bba39.tar.xz
linux-3c229b3f2dd8133f61bb81d3cb018be92f4bba39.zip
parisc: Fix map_pages() to not overwrite existing pte entries
Fix a long-existing small nasty bug in the map_pages() implementation which leads to overwriting already written pte entries with zero, *if* map_pages() is called a second time with an end address which isn't aligned on a pmd boundry. This happens for example if we want to remap only the text segment read/write in order to run alternative patching on the code. Exiting the loop when we reach the end address fixes this. Cc: stable@vger.kernel.org Signed-off-by: Helge Deller <deller@gmx.de>
Diffstat (limited to 'arch/parisc')
-rw-r--r--arch/parisc/mm/init.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/arch/parisc/mm/init.c b/arch/parisc/mm/init.c
index 74842d28a7a1..aae9b0d71c1e 100644
--- a/arch/parisc/mm/init.c
+++ b/arch/parisc/mm/init.c
@@ -494,12 +494,8 @@ static void __init map_pages(unsigned long start_vaddr,
pte = pte_mkhuge(pte);
}
- if (address >= end_paddr) {
- if (force)
- break;
- else
- pte_val(pte) = 0;
- }
+ if (address >= end_paddr)
+ break;
set_pte(pg_table, pte);