Commit 3a6ecd1b authored by Russell King's avatar Russell King Committed by Linus Torvalds

[PATCH] 7: 2.5.29-mmap

The following patch is required so that munmap(0x8000, *) does not cause
ARM kernels to crash.  The problem is that the machine vectors are at
virtual address 0.  Unfortunately, when free_pgtables() is called, it
clears first level page tables starting at 0 in this case, and takes
out the machine vectors.  This then results in an unrecoverable hang.

We already have FIRST_USER_PGD_NR to define the first entry in the pgd
which may be cleared, so we use this to clamp "start_index"
appropriately.  The following patch does this.  Tested on ARM.
parent 913ccfaa
......@@ -888,6 +888,8 @@ static void free_pgtables(mmu_gather_t *tlb, struct vm_area_struct *prev,
* old method of shifting the VA >> by PGDIR_SHIFT doesn't work.
*/
start_index = pgd_index(first);
if (start_index < FIRST_USER_PGD_NR)
start_index = FIRST_USER_PGD_NR;
end_index = pgd_index(last);
if (end_index > start_index) {
clear_page_tables(tlb, start_index, end_index - start_index);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment