make_page_readonly() must flush unused kmaps when handling

a high-memory page. Otherwise stale writable mappings may 
persist. This fixes a corner case for alloc_ldt (which can
vmalloc an LDT and hence use highmem pages).

Signed-off-by: Keir Fraser <keir@xensource.com>
This commit is contained in:
kaf24@firebug.cl.cam.ac.uk committed 2005-11-18 17:50:25 +01:00
1 parent cde43db53a
commit 931a2bf97f
1 file changed
+3 -1
@@ -409,7 +409,9 @@ void make_page_readonly(void *va)
if ((unsigned long)va >= (unsigned long)high_memory) {
unsigned long pfn = pte_pfn(*pte);
#ifdef CONFIG_HIGHMEM
if (pfn < highstart_pfn)
if (pfn >= highstart_pfn)
kmap_flush_unused(); /* flush stale writable kmaps */
else
#endif
make_lowmem_page_readonly(
phys_to_virt(pfn << PAGE_SHIFT));
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.