mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-27 22:51:31 +00:00
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>
This commit is contained in:
parent
4dd5b673fa
commit
3c229b3f2d
1 changed files with 2 additions and 6 deletions
|
@ -494,12 +494,8 @@ static void __init map_pages(unsigned long start_vaddr,
|
||||||
pte = pte_mkhuge(pte);
|
pte = pte_mkhuge(pte);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (address >= end_paddr) {
|
if (address >= end_paddr)
|
||||||
if (force)
|
break;
|
||||||
break;
|
|
||||||
else
|
|
||||||
pte_val(pte) = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
set_pte(pg_table, pte);
|
set_pte(pg_table, pte);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue