parisc: Fix map_pages() to not overwrite existing pte entries
authorHelge Deller <deller@gmx.de>
Fri, 12 Oct 2018 20:37:46 +0000 (22:37 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 13 Nov 2018 19:16:46 +0000 (11:16 -0800)
commitd35b161d487edd660dfb9759552b1e758a286de8
treefc09a1757fc0de231ac9ae3271695ce7dd0939aa
parent662d2aef4cb1c73f2b7565dacf846f111a33ae0d
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>
arch/parisc/mm/init.c