[PATCH] parisc: Fix map_pages() to not overwrite existing pte

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



entries
Reply-To: 

Fix a long-existing 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 if we want to remap only the
text segment read/write in order to run alternative patching on the
code.  Fix this by exiting the loop when we read the end address.

Cc: stable@xxxxxxxxxxxxxxx
Signed-off-by: Helge Deller <deller@xxxxxx>

diff --git a/arch/parisc/mm/init.c b/arch/parisc/mm/init.c
index 74842d28a7a1..ff80ffdd09c7 100644
--- a/arch/parisc/mm/init.c
+++ b/arch/parisc/mm/init.c
@@ -494,12 +494,9 @@ 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;
-				}
+				/* Exit loop when reaching end address. */
+				if (address >= end_paddr)
+					break;
 
 				set_pte(pg_table, pte);
 



[Index of Archives]     [Linux SoC]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux