diff options
author | Helge Deller <deller@gmx.de> | 2018-10-12 22:37:46 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2018-11-13 11:16:46 -0800 |
commit | d35b161d487edd660dfb9759552b1e758a286de8 (patch) | |
tree | fc09a1757fc0de231ac9ae3271695ce7dd0939aa /arch/parisc/mm | |
parent | 662d2aef4cb1c73f2b7565dacf846f111a33ae0d (diff) | |
download | linux-stable-d35b161d487edd660dfb9759552b1e758a286de8.tar.gz linux-stable-d35b161d487edd660dfb9759552b1e758a286de8.tar.bz2 linux-stable-d35b161d487edd660dfb9759552b1e758a286de8.zip |
parisc: Fix map_pages() to not overwrite existing pte entries
commit 3c229b3f2dd8133f61bb81d3cb018be92f4bba39 upstream.
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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'arch/parisc/mm')
-rw-r--r-- | arch/parisc/mm/init.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/arch/parisc/mm/init.c b/arch/parisc/mm/init.c index e02ada312be8..b9db8e529e4d 100644 --- a/arch/parisc/mm/init.c +++ b/arch/parisc/mm/init.c @@ -491,12 +491,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); |